/* Flechas del carrusel: fuera del swiper, posicionadas en el contenedor (límite / exterior / interior) */
.etn-egr-slider-container .swiper-button-next,
.etn-egr-slider-container .swiper-button-prev {
    position: absolute;
    width: var(--etn-egr-arrow-size, 40px);
    height: var(--etn-egr-arrow-size, 40px);
    margin: 0;
    z-index: 10;
    background: var(--etn-egr-arrow-bg, #ffffff);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 50%;
    color: var(--etn-egr-arrow-color, #555555);
    transition: opacity 0.2s, background 0.2s;
}
.etn-egr-slider-container .swiper-button-next::after,
.etn-egr-slider-container .swiper-button-prev::after {
    font-size: calc(var(--etn-egr-arrow-size, 40px) * 0.4);
    color: var(--etn-egr-arrow-color, #555555);
}
/* Sin círculo: solo icono */
.etn-egr-slider-container.etn-egr-arrows-no-circle .swiper-button-next,
.etn-egr-slider-container.etn-egr-arrows-no-circle .swiper-button-prev {
    background: transparent;
    border: none;
    border-radius: 0;
}
.etn-egr-slider-container.etn-egr-arrows-no-circle .swiper-button-next::after,
.etn-egr-slider-container.etn-egr-arrows-no-circle .swiper-button-prev::after {
    color: var(--etn-egr-arrow-color, #555555);
}

/* Posición horizontal: en el límite (mitad fuera, mitad dentro), exterior o interior */
.etn-egr-slider-container.etn-egr-arrow-h-limit .swiper-button-prev { left: 50px; }
.etn-egr-slider-container.etn-egr-arrow-h-limit .swiper-button-next { right: 50px; }
.etn-egr-slider-container.etn-egr-arrow-h-exterior .swiper-button-prev { left: 8px; }
.etn-egr-slider-container.etn-egr-arrow-h-exterior .swiper-button-next { right: 8px; }
.etn-egr-slider-container.etn-egr-arrow-h-interior .swiper-button-prev { left: 58px; }
.etn-egr-slider-container.etn-egr-arrow-h-interior .swiper-button-next { right: 58px; }

/* Posición vertical + transform horizontal (límite centra la flecha en el borde) */
.etn-egr-slider-container.etn-egr-arrow-v-middle .swiper-button-prev,
.etn-egr-slider-container.etn-egr-arrow-v-middle .swiper-button-next { top: 50%; bottom: auto; }
.etn-egr-slider-container.etn-egr-arrow-v-top .swiper-button-prev,
.etn-egr-slider-container.etn-egr-arrow-v-top .swiper-button-next { top: 15px; bottom: auto; }
.etn-egr-slider-container.etn-egr-arrow-v-bottom .swiper-button-prev,
.etn-egr-slider-container.etn-egr-arrow-v-bottom .swiper-button-next { top: auto; bottom: 15px; }

.etn-egr-slider-container.etn-egr-arrow-h-limit.etn-egr-arrow-v-middle .swiper-button-prev { transform: translateY(-50%) translateX(-50%); }
.etn-egr-slider-container.etn-egr-arrow-h-limit.etn-egr-arrow-v-middle .swiper-button-next { transform: translateY(-50%) translateX(50%); }
.etn-egr-slider-container.etn-egr-arrow-h-limit.etn-egr-arrow-v-top .swiper-button-prev { transform: translateX(-50%); }
.etn-egr-slider-container.etn-egr-arrow-h-limit.etn-egr-arrow-v-top .swiper-button-next { transform: translateX(50%); }
.etn-egr-slider-container.etn-egr-arrow-h-limit.etn-egr-arrow-v-bottom .swiper-button-prev { transform: translateX(-50%); }
.etn-egr-slider-container.etn-egr-arrow-h-limit.etn-egr-arrow-v-bottom .swiper-button-next { transform: translateX(50%); }

.etn-egr-slider-container.etn-egr-arrow-h-exterior.etn-egr-arrow-v-middle .swiper-button-prev,
.etn-egr-slider-container.etn-egr-arrow-h-interior.etn-egr-arrow-v-middle .swiper-button-prev { transform: translateY(-50%); }
.etn-egr-slider-container.etn-egr-arrow-h-exterior.etn-egr-arrow-v-middle .swiper-button-next,
.etn-egr-slider-container.etn-egr-arrow-h-interior.etn-egr-arrow-v-middle .swiper-button-next { transform: translateY(-50%); }
.etn-egr-slider-container.etn-egr-arrow-h-exterior.etn-egr-arrow-v-top .swiper-button-prev,
.etn-egr-slider-container.etn-egr-arrow-h-exterior.etn-egr-arrow-v-bottom .swiper-button-prev,
.etn-egr-slider-container.etn-egr-arrow-h-interior.etn-egr-arrow-v-top .swiper-button-prev,
.etn-egr-slider-container.etn-egr-arrow-h-interior.etn-egr-arrow-v-bottom .swiper-button-prev { transform: none; }
.etn-egr-slider-container.etn-egr-arrow-h-exterior.etn-egr-arrow-v-top .swiper-button-next,
.etn-egr-slider-container.etn-egr-arrow-h-exterior.etn-egr-arrow-v-bottom .swiper-button-next,
.etn-egr-slider-container.etn-egr-arrow-h-interior.etn-egr-arrow-v-top .swiper-button-next,
.etn-egr-slider-container.etn-egr-arrow-h-interior.etn-egr-arrow-v-bottom .swiper-button-next { transform: none; }

.etn-egr-slider-container { position: relative; padding: 0 50px; width: 100%; box-sizing: border-box; }
.etn-egr-slider { width: 100%; height: auto; padding-bottom: 50px; overflow: hidden; }
.etn-egr-slider-container .swiper-slide {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.etn-egr-slider-container .swiper-slide .etn-egr-card-slider {
    flex: 0 0 auto;
}

/* Variables de margen/padding (configurables en admin) */
.etn-egr-card {
    background: var(--etn-egr-bg);
    border-radius: var(--etn-egr-br);
    padding: var(--etn-egr-card-padding, 16px);
    height: 100%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Proporción 16:9 (paisaje) – tarjeta compacta: menos espacio interno */
.etn-egr-aspect-16_9 .etn-egr-card-slider {
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    padding: 10px 12px;
}
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-author,
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-stars {
    flex-shrink: 0;
}
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-author {
    gap: 6px;
    margin-bottom: 4px;
}
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-stars {
    margin: 2px 0 4px 0;
    font-size: 15px;
}
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-text {
    flex: 1 1 auto;
    min-height: 2.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    word-wrap: break-word;
    word-break: break-word;
    margin-top: 2px;
    line-height: 1.45;
    font-size: 0.95em;
}
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-read-more-wrap {
    flex-shrink: 0;
    margin-top: var(--etn-egr-read-more-gap, 4px);
}
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-read-more {
    font-size: 0.9em;
    color: var(--etn-egr-ct, #FDFDFD);
    text-decoration: underline;
    cursor: pointer;
}
.etn-egr-aspect-16_9 .etn-egr-card-slider .etn-egr-read-more:hover {
    opacity: 0.85;
}
.etn-egr-aspect-16_9 .etn-egr-avatar {
    width: 32px;
    height: 32px;
}

/* Proporción 4:3 – misma compactación */
.etn-egr-aspect-4_3 .etn-egr-card-slider {
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    padding: 10px 12px;
}
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-author,
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-stars {
    flex-shrink: 0;
}
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-author {
    gap: 6px;
    margin-bottom: 4px;
}
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-stars {
    margin: 2px 0 4px 0;
    font-size: 15px;
}
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-text {
    flex: 1 1 auto;
    min-height: 2.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    word-wrap: break-word;
    word-break: break-word;
    margin-top: 2px;
    line-height: 1.45;
    font-size: 0.95em;
}
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-read-more-wrap {
    flex-shrink: 0;
    margin-top: var(--etn-egr-read-more-gap, 4px);
}
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-read-more {
    font-size: 0.9em;
    color: var(--etn-egr-ct, #FDFDFD);
    text-decoration: underline;
    cursor: pointer;
}
.etn-egr-aspect-4_3 .etn-egr-card-slider .etn-egr-read-more:hover {
    opacity: 0.85;
}
.etn-egr-aspect-4_3 .etn-egr-avatar {
    width: 32px;
    height: 32px;
}

/* Automática: sin relación de aspecto fija */
.etn-egr-aspect-auto .etn-egr-card-slider {
    display: block;
}
.etn-egr-aspect-auto .etn-egr-card-slider .etn-egr-text {
    word-wrap: break-word;
    word-break: break-word;
}

.etn-egr-card-slider .etn-egr-text {
    word-wrap: break-word;
    word-break: break-word;
}

/* "Leer más" dentro de la tarjeta */
.etn-egr-card-slider .etn-egr-read-more-wrap {
    margin-top: var(--etn-egr-read-more-gap, 4px);
}
.etn-egr-card-slider .etn-egr-read-more {
    font-size: 0.9em;
    color: var(--etn-egr-ct, #FDFDFD);
    text-decoration: underline;
    cursor: pointer;
}
.etn-egr-card-slider .etn-egr-read-more:hover {
    opacity: 0.85;
}

/* Igualar alturas cuando "Altura idéntica" + modo automático */
.etn-egr-equal-height .swiper-wrapper {
    display: flex;
    align-items: stretch;
}
.etn-egr-equal-height .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}
.etn-egr-equal-height.etn-egr-aspect-auto .etn-egr-card-slider {
    flex: 1;
    display: block;
}
.etn-egr-author { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 10px; 
    position: relative; 
}
.etn-egr-avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}
.etn-egr-name { 
    color: var(--etn-egr-cn); 
    font-weight: bold; 
    flex: 1;
}
.etn-egr-g-icon { 
    position: absolute; 
    right: 0; 
}
.etn-egr-stars {
    margin: 10px 0;
    font-size: 18px;
    line-height: 1;
}
.etn-egr-star {
    display: inline-block;
}
.etn-egr-text {
    margin-top: 10px;
    line-height: 1.6;
}
/* Enlace "Leer más" genérico (panel lateral y carrusel: mismo estilo de enlace) */
.etn-egr-read-more {
    color: var(--etn-egr-cn);
    text-decoration: underline;
    cursor: pointer;
}
.etn-egr-read-more:hover {
    opacity: 0.8;
}

/* Modal Leer más: siempre por encima del panel lateral (y barra admin) */
.etn-egr-modal {
    display: none;
    position: fixed;
    z-index: 999999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}
.etn-egr-modal-content {
    background-color: #fff;
    padding: 24px 56px 24px 24px;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
/* Botón cerrar: franja lateral derecha, todo el alto del panel, más asequible */
.etn-egr-modal-close {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: none;
    border-left: 1px solid #ddd;
    border-radius: 0 10px 10px 0;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}
.etn-egr-modal-close:hover {
    background: #2271b1;
    color: #fff;
}
#etn-egr-modal-body {
    margin-top: 12px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

/* Badge flotante */
.etn-egr-badge-fixed {
    position: fixed;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}
.etn-egr-badge-fixed:hover {
    transform: scale(1.05);
}
.etn-egr-badge-clickable {
    cursor: pointer !important;
    user-select: none;
}
.etn-egr-b-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.etn-egr-b-stars {
    font-size: 14px;
    line-height: 1;
}
.etn-egr-b-txt {
    font-size: 13px;
    color: #333;
    line-height: 1.2;
}

/* Badge clickeable */
.etn-egr-badge-clickable:hover {
    transform: scale(1.05);
}

/* Overlay del panel lateral */
.etn-egr-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    cursor: pointer;
}

/* Panel lateral */
.etn-egr-sidebar-panel {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
/* Contenedor de scroll interno (sin transform) para que position:sticky funcione */
.etn-egr-sidebar-panel-scroll {
    -webkit-overflow-scrolling: touch;
}

/* Cabecera del panel lateral: título y nota en blanco, cierre en columna grande */
.etn-egr-sidebar-header {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 20px;
    min-height: 56px;
}
/* Cabecera fija por estructura: fuera del scroll, no usa position:sticky */
.etn-egr-sidebar-header.etn-egr-sidebar-header-fixed {
    flex-shrink: 0;
    margin-bottom: 0;
}
.etn-egr-sidebar-header-inner {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}
.etn-egr-sidebar-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #FDFDFD;
}
.etn-egr-sidebar-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}
.etn-egr-sidebar-rating-text {
    font-size: 16px;
    color: #FDFDFD;
}
/* Cruz de cierre: blanca, columna ancha, X grande */
.etn-egr-sidebar-close {
    flex-shrink: 0;
    width: 64px;
    min-height: 48px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    background: rgba(0,0,0,0.15);
    border: none;
    border-radius: 0 0 10px 0;
    font-size: 50px;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.etn-egr-sidebar-close:hover {
    color: #ffffff;
    background: rgba(0,0,0,0.25);
}

/* Tarjetas de reseña en el sidebar */
.etn-egr-sidebar-review-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.etn-egr-sidebar-review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(81, 154, 232, 0.95) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .etn-egr-slider-container {
        padding: 0 20px;
    }
    .etn-egr-avatar {
        width: 35px;
        height: 35px;
    }
    .etn-egr-sidebar-panel {
        width: 90% !important;
        max-width: 400px !important;
        /* En móvil asegurar altura para que el flex child pueda hacer scroll */
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow: hidden;
    }
    /* Área de scroll en móvil: forzar scroll táctil (iOS/Android) */
    .etn-egr-sidebar-panel-scroll {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        overscroll-behavior-y: contain;
        /* En flex, algunos móviles necesitan min-height: 0 y flex explícito para que el scroll aparezca */
        min-height: 0 !important;
        flex: 1 1 0% !important;
    }
}