/* Modern Reviews Layout - Versión 1 columna (PC + móvil) */

/* -------------------------------------- */
/* Anuncios responsivos (Google Ads)      */
/* -------------------------------------- */
@media (max-width: 768px) {
    ins.adsbygoogle {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
    }

    #publiheader,
    .publi728,
    .review-sidebar__ad {
        max-width: 100% !important;
        overflow: hidden !important;
    }
}

/* =============================== */
/* CONTENEDOR PRINCIPAL            */
/* =============================== */

.review-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    background-color: #fff;
    font-family: sans-serif;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Cuando no hay juego asociado no necesitamos ajustar nada especial */
.review-container--full {
    /* reservado por si se quiere un estilo distinto en el futuro */
}

/* ===================== */
/* CABECERA (FAJA AMARILLA)
/* ===================== */

.review-header {
    order: 1;
    background-color: #F6B333;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 110px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.review-header__title-group,
.review-header__score-box {
    max-width: 100%;
}

.review-header__title-group {
    text-align: right;
    flex-grow: 1;
    padding-right: 30px;
}

.review-header__title {
    margin: 0;
    font-size: 2em;
    font-weight: bold;
}

.review-header__subtitle {
    font-size: 18px;
    margin-top: 5px;
}

.review-header__score-box {
    width: 135px;
    height: 110px;
    background-image: url(/images/fondo_nota.jpg);
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}

.review-header__score-value {
    font-size: 50px;
    font-weight: bold;
    line-height: 1;
}

/* ======================= */
/* CUERPO PRINCIPAL         */
/* ======================= */

.review-main {
    order: 3;
    padding: 20px;
}

.review-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.review-meta__author {
    font-style: italic;
}

.review-pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.review-pagination a,
.review-pagination span.current-page {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
    border: 1px solid #ddd;
}

.review-pagination a:hover {
    background-color: #e0e0e0;
    text-decoration: none;
}

.review-pagination span.current-page {
    background-color: #F6B333;
    color: #fff;
    border-color: #F6B333;
}

.review-pagination__info {
    font-size: 0.9em;
    color: #666;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.review-body {
    line-height: 1.6;
    color: #333;
}

.review-body h3 {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 0;
}

/* ======================= */
/* PANEL DE PUNTUACIONES    */
/* ======================= */

.rating-panel--gaming {
    margin-top: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.rating-panel__title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.rating-panel__row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.rating-panel__label {
    width: 120px;
    font-weight: 600;
}

.rating-panel__bar {
    flex-grow: 1;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin: 0 15px;
    overflow: hidden;
}

.rating-panel__bar-fill {
    height: 100%;
    background-color: #F6B333;
}

.rating-panel__bar-fill--empty {
    background-color: transparent;
}

.rating-panel__value {
    width: 30px;
    text-align: right;
    font-weight: bold;
}

.rating-panel__row--total {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-size: 1.2em;
}

.rating-panel__value--total {
    font-size: 1.5em;
    margin-left: auto;
}

/* ======================= */
/* LATERAL: FICHA + EXTRAS  */
/* ======================= */

.review-sidebar-info,
.review-sidebar-extras {
    width: 100%;
    box-sizing: border-box;
}

/* Ficha justo debajo de la cabecera */
.review-sidebar-info {
    order: 2;
    padding: 20px;
    border-left: none;
}

/* Extras (anuncio + galería) al final */
.review-sidebar-extras {
    order: 4;
    padding: 20px;
    border-top: 1px solid #eee;
}

.review-sidebar__cover {
    text-align: center;
    margin-bottom: 20px;
}

.review-sidebar__cover img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.review-sidebar__links {
    text-align: center;
}

.review-sidebar__ad {
    text-align: center;
    margin-bottom: 20px;
}

.review-sidebar__gallery {
    text-align: center;
}

.review-sidebar__gallery-item {
    margin-bottom: 10px;
}

/* La ficha (review-card / game-card) centrada y más ancha en PC */
.review-sidebar-info .review-card,
.review-sidebar-info .game-card {
    width: 100%;
    max-width: 420px;
    /* antes 320px: ahora algo más grande en escritorio */
    margin: 0 auto;
}

/* ========================= */
/* AJUSTES RESPONSIVE (MÓVIL)*/
/* ========================= */

@media (max-width: 768px) {

    html,
    body {
        margin: 0;
        padding: 0;
    }

    #site_layout,
    #site_body,
    #site_body .centerbody {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .review-container {
        max-width: 100%;
    }

    .review-header {
        flex-direction: column;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        padding: 15px 12px 10px 12px;
    }

    .review-header__title-group {
        padding-right: 0;
        margin-bottom: 10px;
        text-align: center;
    }

    .review-header__score-box {
        width: 100%;
        height: auto;
        padding: 10px;
        background-image: none;
        background-color: rgba(0, 0, 0, 0.2);
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        border-radius: 4px;
        margin-top: 10px;
    }

    .review-header__score-value {
        font-size: 2em;
    }

    .review-header__score-box::before {
        content: "Nota:";
        font-size: 1.2em;
        font-weight: bold;
        align-self: center;
        text-transform: uppercase;
    }

    .review-sidebar-info {
        padding: 15px;
        margin: 0;
    }

    .review-sidebar-extras {
        padding: 20px 0;
        background: #fafafa;
    }

    .review-sidebar__gallery {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding: 10px 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .review-body iframe {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    .video-responsive {
        position: relative;
        padding-bottom: 56.25%;
        padding-top: 25px;
        height: 0;
    }

    .video-responsive iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .review-sidebar__gallery-item {
        flex: 0 0 85%;
        scroll-snap-align: center;
        margin-bottom: 0;
    }

    .review-sidebar__gallery-item img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .review-sidebar__gallery::-webkit-scrollbar {
        display: none;
    }

    .review-sidebar__ad {
        margin-bottom: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        width: 100%;
        padding: 0 10px;
    }

    .review-sidebar__ad ins {
        max-width: 100% !important;
        width: 100% !important;
        display: block !important;
    }

    #publiheader {
        width: 100%;
        overflow: hidden;
        text-align: center;
        padding: 10px;
    }

    #publiheader ins {
        max-width: 100% !important;
        width: 100% !important;
        display: block !important;
    }

    .review-main {
        padding: 10px 12px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
    }

    .review-main img,
    .review-body img {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 10px auto;
    }

    .review-sidebar-info .review-card,
    .review-sidebar-info .game-card {
        max-width: 100%;
        /* en móvil sigue ocupando todo */
    }
}

/* ===================================== */
/* FICHA LATERAL TIPO "GEMINI" EN REVIEWS */
/* ===================================== */

.review-sidebar-info--card {
    display: block;
}

/* Tarjeta base */
.review-card {
    width: 100%;
    max-width: 420px;
    /* mismo ancho base que la de la sidebar */
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: inherit;
}

/* Cabecera de la tarjeta */
.review-card__header {
    display: flex;
    gap: 16px;
    padding: 12px;
    cursor: pointer;
    align-items: stretch;
}

.review-card__image-wrapper {
    width: 96px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.review-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.review-card__title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.review-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.review-card__subtitle {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Chevron "dibujado" en CSS */
.review-card__chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transform: rotate(45deg);
    margin-left: 8px;
    align-self: center;
    transition: transform 0.3s ease;
}

.review-card--open .review-card__chevron {
    transform: rotate(-135deg);
}

/* Nota */
.review-card__meta {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.review-card__score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    padding: 2px 8px;
    border-radius: 6px;
}

.review-card__score-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: #15803d;
    line-height: 1;
}

.review-card__score-text {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #16a34a;
    letter-spacing: 0.03em;
}

/* Menú desplegable */
.review-card__menu {
    background-color: #f9fafb;
    border-top: 1px solid #f3f4f6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.review-card--open .review-card__menu {
    max-height: 500px;
}

.review-card__menu-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #e5e7eb;
}

.review-card__menu-row:last-child {
    border-bottom: none;
}

.review-card__menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    text-decoration: none;
    font-size: 0.8rem;
    color: #6b7280;
    border-right: 1px solid #e5e7eb;
    background-color: #f9fafb;
    font-weight: 500;
    text-align: center;
    min-height: 40px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.review-card__menu-row .review-card__menu-item:last-child {
    border-right: none;
}

.review-card__menu-item:hover {
    background-color: #ffffff;
    color: #4f46e5;
}

/* Versión responsive de la tarjeta */
@media (max-width: 768px) {
    .review-card {
        max-width: 100%;
    }

    .review-card__header {
        padding: 10px;
    }

    .review-card__title {
        font-size: 1rem;
    }

    .review-card__subtitle {
        font-size: 0.8rem;
    }

    .review-card__menu-item {
        padding: 10px 4px;
        font-size: 0.75rem;
    }
}

/* =========================================
   FIX GALERÍA GAMER EN REVIEWS (MÓVIL)
   ========================================= */

@media (max-width: 768px) {

    /* El section deja de ser flex: se comporta como en la ficha */
    .review-sidebar__gallery.tj-gallery-module {
        display: block;
        /* anula el display:flex anterior */
        scroll-snap-type: none;
        overflow: visible;
        padding: 0;
    }

    /* Ocupa todo el ancho del contenedor en móvil */
    .review-sidebar__gallery.tj-gallery-module {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 18px;
    }

    /* El carrusel funciona dentro del track, no en el section */
    .review-sidebar__gallery.tj-gallery-module .tj-gallery-track-wrapper {
        padding: 4px 4px 14px;
    }

    .review-sidebar__gallery.tj-gallery-module .tj-gallery-track {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding: 4px 8px 4px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .review-sidebar__gallery.tj-gallery-module .tj-gallery-track::-webkit-scrollbar {
        display: none;
    }

    .review-sidebar__gallery.tj-gallery-module .tj-gallery-card {
        flex: 0 0 100%;
        max-width: 100%;
        scroll-snap-align: center;
    }

    .review-sidebar__gallery.tj-gallery-module .tj-gallery-card-inner {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        overflow: hidden;
    }

    .review-sidebar__gallery.tj-gallery-module .tj-gallery-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

/* =========================================
   ESPACIADO DEL HEADER DE GALERÍA EN REVIEWS
   (solo móvil, no afecta a la ficha)
   ========================================= */

@media (max-width: 768px) {

    /* Un poco más de aire arriba dentro de la tarjeta
       cuando la galería está en el sidebar de reviews */
    .review-sidebar__gallery.tj-gallery-module .tj-gallery-header {
        padding-top: 22px;
        /* antes prácticamente heredaba el mínimo */
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 12px;
    }

    /* Y separamos ligeramente el módulo del bloque anterior */
    .review-sidebar__gallery.tj-gallery-module {
        margin-top: 16px;
    }
}

/* ===== LIGHTBOX CURSOR & STYLES ===== */

/* Wrapper generado por JS para poder poner ::after */
.tj-inline-wrapper {
    position: relative;
    display: block;
    margin: 24px auto;
    max-width: 100%;
    width: fit-content;
    /* Ajustarse al ancho de la imagen */
    border-radius: 8px;
    overflow: hidden;
    /* Para que el brillo no se salga */
}

/* La imagen dentro */
.tj-inline-wrapper img.tj-zoomable {
    display: block;
    margin: 0;
    /* El margen lo lleva el wrapper */
    border-radius: 8px;
    /* Redundante visualmente pero útil */
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: zoom-in;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Icono Overlay invisible por defecto */
.tj-inline-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    /* Dejar pasar el clic a la imagen */
    z-index: 2;
}

/* HOVER States */
.tj-inline-wrapper:hover img.tj-zoomable {
    transform: scale(1.02);
    filter: brightness(1.05);
}

.tj-inline-wrapper:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}