/*
 * Custom Reviews Plugin v5.0.0
 * Tipografías: Poppins (títulos) + ABeeZee (texto)
 * UI modernizada, pills dentro del flujo (sin tapar contenido)
 */

/* === 1. Variables === */
:root {
    /* Paleta */
    --crp-primary: #1c34c7;
    --crp-primary-hover: #1527a0;
    --crp-primary-soft: rgba(28, 52, 199, 0.08);
    --crp-secondary: #FF8383;

    --crp-text-main: #0b0f1a;
    --crp-text-muted: #6b7280;
    --crp-text-light: #9ca3af;

    --crp-star: #FACC15;
    --crp-bg-bar-track: #f3f4f6;

    --crp-bg-white: #ffffff;
    --crp-bg-positive: #f0fdf4;
    --crp-bg-critical: #fafafb;

    --crp-border: #f3f4f6;
    --crp-border-dark: #e5e7eb;
    --crp-border-positive: #dcfce7;
    --crp-border-critical: #e5e7eb;

    --crp-text-positive: #15803d;
    --crp-text-critical: #374151;

    --crp-radius: 16px;
    --crp-radius-lg: 24px;
    --crp-shadow-sm: 0 8px 20px rgba(18, 23, 38, 0.06);
    --crp-shadow-md: 0 12px 28px rgba(18, 23, 38, 0.08);
    --crp-shadow-btn: 0 10px 18px -6px rgba(28, 52, 199, 0.35);

    --crp-font-body: 'ABeeZee', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --crp-font-heading: 'Poppins', 'ABeeZee', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === 2. Contenedor Principal === */
.reseñas-avanzadas {
    font-family: var(--crp-font-body);
    max-width: 1400px;
    margin: 40px auto;
    color: var(--crp-text-main);
    box-sizing: border-box;
    line-height: 1.6;
}

.reseñas-avanzadas *,
.reseñas-avanzadas *::before,
.reseñas-avanzadas *::after {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    .reseñas-avanzadas *,
    .reseñas-avanzadas *::before,
    .reseñas-avanzadas *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.reseñas-avanzadas h2,
.reseñas-avanzadas h3,
.reseñas-avanzadas h4 {
    font-family: var(--crp-font-heading);
    color: var(--crp-text-main);
    margin-top: 0;
    letter-spacing: -0.01em;
}

.titulo-reseñas h2 {
    font-family: var(--crp-font-heading);
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 700;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.crp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* === 3. Grid Principal === */
.contenedor-resumen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
    align-items: stretch;
}

/* === 4. Tarjeta Resumen === */
.tarjeta-resumen {
    background: var(--crp-bg-white);
    border: 1px solid var(--crp-border-dark);
    border-radius: var(--crp-radius-lg);
    padding: 28px;
    box-shadow: var(--crp-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tarjeta-resumen:hover {
    transform: translateY(-2px);
    box-shadow: var(--crp-shadow-md);
}

.calificacion-general {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.calificacion-valor {
    font-family: var(--crp-font-heading);
    font-size: 52px;
    font-weight: 800;
    color: var(--crp-primary);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.calificacion-estrellas-contenedor {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.calificacion-estrellas-contenedor .star-rating {
    margin: 0;
    float: none;
    font-size: 1.2rem;
    color: var(--crp-star);
    font-weight: 400;
}

.star-rating,
.star-rating span,
.star-rating strong {
    font-weight: 400;
}

.calificacion-promedio,
.calificacion-promedio-vacio {
    font-family: var(--crp-font-body);
    font-weight: 400;
}

.calificacion-promedio .star-rating,
.calificacion-promedio .star-rating span,
.calificacion-promedio-vacio .star-rating,
.calificacion-promedio-vacio .star-rating span {
    color: #FFC107 !important;
    font-weight: 400 !important;
}

.calificacion-promedio .enlace-reseñas,
.calificacion-promedio-vacio .enlace-reseñas-vacio,
.calificacion-promedio .enlace-reseñas span,
.calificacion-promedio-vacio .enlace-reseñas-vacio span,
.calificacion-promedio strong,
.calificacion-promedio-vacio strong {
    color: inherit !important;
    font-weight: 400 !important;
}

.calificacion-base {
    font-family: var(--crp-font-body);
    font-size: 14px;
    color: var(--crp-text-muted);
    margin: 0;
}

/* Barras de calificación */
.barra-calificaciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.barra-fila {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.barra-estrella-num {
    width: 14px;
    font-weight: 600;
    color: var(--crp-text-muted);
    font-family: var(--crp-font-heading);
}

.barra-estrella-icon {
    color: var(--crp-star);
    font-size: 16px;
    line-height: 1;
}

.barra-progreso-track {
    flex: 1;
    height: 8px;
    background-color: var(--crp-bg-bar-track);
    border-radius: 999px;
    overflow: hidden;
}

.barra-progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, #FCD34D, var(--crp-star));
    border-radius: 999px;
    transition: width 0.4s ease;
}

.barra-total {
    width: 32px;
    text-align: right;
    font-size: 12px;
    color: var(--crp-text-light);
    font-variant-numeric: tabular-nums;
}

.escribir-opinion {
    display: block;
    width: 100%;
    background: var(--crp-primary);
    color: #ffffff;
    font-family: var(--crp-font-heading);
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    box-shadow: var(--crp-shadow-btn);
    transition: background-color 0.2s, transform 0.15s;
    text-decoration: none;
    letter-spacing: 0.01em;
    Margin-top: 15px;
}

.escribir-opinion:hover {
    background-color: var(--crp-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.escribir-opinion:active {
    transform: translateY(0);
}

.escribir-opinion::before { display: none; }

/* === 5. Tarjetas Destacadas (pills DENTRO del flujo) === */
.tarjeta-destacada-contenedor {
    height: 100%;
}

.reseña-destacada-columna {
    height: 100%;
    border-radius: var(--crp-radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    border-width: 1px;
    border-style: solid;
    box-shadow: var(--crp-shadow-sm);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reseña-destacada-columna:hover {
    transform: translateY(-2px);
    box-shadow: var(--crp-shadow-md);
}

.reseña-destacada-columna.reseña-positiva {
    background-color: var(--crp-bg-positive);
    border-color: var(--crp-border-positive);
}

.reseña-destacada-columna.reseña-critica {
    background-color: var(--crp-bg-white);
    border-color: var(--crp-border-critical);
}

/* HEADER: pill arriba (en el flujo), debajo el avatar + identidad */
.destacada-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.destacada-identidad {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.destacada-identidad img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    line-height: 1;
}

.destacada-placeholder-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 50%;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.6);
}

.destacada-placeholder-emoji {
    display: inline-block;
    font-size: 20px;
    line-height: 1;
}

.destacada-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.destacada-autor {
    display: block;
    font-family: var(--crp-font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--crp-text-main);
    line-height: 1.3;
}

.destacada-verificada {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-family: var(--crp-font-body);
}

.reseña-positiva .destacada-verificada { color: var(--crp-text-positive); }
.reseña-critica .destacada-verificada { color: var(--crp-text-muted); }

/* PILL: dentro del flujo, encima del header — ya NO absoluto */
.destacada-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--crp-font-heading);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: var(--crp-bg-white);
    border: 1px solid var(--crp-border-dark);
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.2;
    position: static; /* anula absoluto antiguo */
}

.reseña-positiva .destacada-pill {
    color: var(--crp-text-positive);
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--crp-border-positive);
}

.reseña-critica .destacada-pill {
    color: var(--crp-text-critical);
    background: var(--crp-bg-white);
    border-color: var(--crp-border-dark);
}

.destacada-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

/* Contenido de la tarjeta */
.reseña-resumen {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.reseña-resumen .star-rating {
    font-size: 16px;
    color: var(--crp-star);
    margin-bottom: 10px;
    float: none;
    width: auto;
    font-weight: 400;
}

.reseña-critica .star-rating::before {
    color: var(--crp-star);
}

.destacada-titulo {
    font-family: var(--crp-font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    color: var(--crp-text-main);
}

.reseña-resumen p {
    font-family: var(--crp-font-body);
    font-size: 14px;
    color: var(--crp-text-muted);
    line-height: 1.65;
    margin: 0 0 20px 0;
    flex: 1;
}

.destacada-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.destacada-ayuda {
    font-size: 12px;
    font-weight: 500;
    color: var(--crp-text-muted);
    margin: 0;
}

.destacada-ayuda.is-hidden { display: none; }

.destacada-helpful {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--crp-border-dark);
    background: var(--crp-bg-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.destacada-helpful:hover {
    border-color: var(--crp-primary);
    color: var(--crp-primary);
}

.destacada-helpful.is-active {
    background: var(--crp-primary);
    border-color: var(--crp-primary);
    color: #ffffff;
}

/* Tarjeta vacía */
.reseña-vacia {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.reseña-vacia .destacada-header {
    margin-bottom: 0;
    align-items: center;
    width: 100%;
}

.reseña-vacia .destacada-identidad {
    justify-content: center;
}

.reseña-vacia .destacada-texto {
    align-items: center;
}

.reseña-vacia .destacada-verificada {
    color: var(--crp-text-light);
}

.reseña-vacia .destacada-pill {
    align-self: center;
}

/* === 6. Lista de Reseñas === */
.lista-reseñas {
    background: var(--crp-bg-white);
    border: 1px solid var(--crp-border-dark);
    border-radius: var(--crp-radius-lg);
    padding: 32px;
    margin-top: 32px;
    box-shadow: var(--crp-shadow-sm);
}

.lista-reseñas[aria-busy="true"] .lista-reseñas-contenido {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.filtros-reseñas {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid var(--crp-border);
    padding-bottom: 24px;
    margin-bottom: 24px;
    align-items: center;
    justify-content: space-between;
}

.filtros-reseñas-select {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.filtros-reseñas-orden {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.filtros-reseñas-label {
    font-family: var(--crp-font-heading);
    font-size: 11px;
    font-weight: 600;
    color: var(--crp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filtros-reseñas-dropdown {
    width: 100%;
    border: 1px solid var(--crp-border-dark);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    background-color: var(--crp-bg-white);
    color: var(--crp-text-main);
    font-family: var(--crp-font-body);
    cursor: pointer;
    transition: border-color 0.15s;
}

.filtros-reseñas-dropdown:hover {
    border-color: var(--crp-primary);
}

.filtros-reseñas-dropdown:focus {
    outline: 2px solid var(--crp-primary-soft);
    outline-offset: 2px;
    border-color: var(--crp-primary);
}

.filtros-reseñas-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.filtro-pill {
    background: #f3f4f6;
    color: #374151;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--crp-font-body);
}

.filtro-pill:hover {
    background: #e5e7eb;
}

.filtro-pill.is-active {
    background: var(--crp-text-main);
    color: #ffffff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .filtros-reseñas {
        align-items: stretch;
        flex-direction: column;
    }

    .filtros-reseñas-select {
        display: flex;
    }

    .filtros-reseñas-pills {
        display: none;
    }

    .filtros-reseñas-orden {
        min-width: 0;
        width: 100%;
    }
}

/* Item Reseña */
.lista-reseñas-contenido .reseña {
    display: flex;
    gap: 18px;
    padding: 28px 0;
    border-bottom: 1px solid var(--crp-border);
    align-items: flex-start;
    content-visibility: auto;
    contain-intrinsic-size: 220px;
}

.lista-reseñas-contenido .reseña:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.lista-reseñas-contenido .reseña:first-child {
    padding-top: 0;
}

.reseña-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.reseña-cuerpo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reseña-identidad {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reseña-autor {
    font-family: var(--crp-font-heading);
    font-weight: 700;
    font-size: 14px;
}

.reseña-verificada {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--crp-text-muted);
    background: var(--crp-bg-positive);
    color: var(--crp-text-positive);
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 500;
}

.reseña-fecha time {
    font-size: 12px;
    color: var(--crp-text-light);
    font-variant-numeric: tabular-nums;
}

.crp-review-rating {
    font-size: 12px;
    color: var(--crp-star);
    display: flex;
    justify-content: flex-start;
    text-align: left;
    font-weight: 400;
}

.crp-review-rating .star-rating {
    float: none;
    margin: 0;
}

.reseña-titulo {
    font-family: var(--crp-font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--crp-text-main);
    margin: 0;
    line-height: 1.3;
}

.reseña .contenido {
    font-family: var(--crp-font-body);
    font-size: 14px;
    color: var(--crp-text-muted);
    line-height: 1.65;
    margin: 0 0 8px 0;
}

.reseña-derecha {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    text-align: right;
}

.reseña-utilidad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--crp-text-light);
    font-size: 12px;
}

.reseña-ayuda-boton {
    border: 1px solid var(--crp-border-dark);
    background: var(--crp-bg-white);
    color: var(--crp-text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.reseña-ayuda-boton:hover {
    color: var(--crp-primary);
    border-color: var(--crp-primary);
    background: var(--crp-primary-soft);
    transform: scale(1.05);
}

.reseña-ayuda-boton.is-active {
    color: #ffffff;
    border-color: var(--crp-primary);
    background: var(--crp-primary);
}

.reseña-ayuda-boton:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.reseña-ayuda-conteo {
    font-weight: 600;
    color: var(--crp-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Fotos */
.reseña-fotos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.reseña-foto {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--crp-border);
    cursor: pointer;
    transition: transform 0.2s;
}

.reseña-foto:hover {
    transform: scale(1.04);
}

/* === 7. Paginación === */
.paginacion {
    margin-top: 32px;
    padding-top: 20px;
    text-align: center;
    border-top: 1px solid var(--crp-border);
}

.paginacion[hidden] {
    display: none;
}

#crp-load-more {
    background: var(--crp-primary-soft) !important;
    color: var(--crp-primary) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    font-family: var(--crp-font-heading);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

#crp-load-more:hover {
    background: var(--crp-primary) !important;
    color: #ffffff !important;
    text-decoration: none;
}

#crp-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#crp-load-more .icono-ver-mas { display: none; }

.crp-no-results {
    text-align: center;
    color: var(--crp-text-muted);
    padding: 24px 0;
    display: none;
    font-family: var(--crp-font-body);
}

.crp-no-results.is-visible {
    display: block;
}

/* === 8. Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 15, 26, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: crpFadeIn 0.2s ease;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-overlay.is-active {
    display: flex;
}

@keyframes crpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--crp-bg-white);
    width: 100%;
    max-width: 880px;
    max-height: calc(100vh - 32px);
    border-radius: var(--crp-radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 48px -8px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    animation: crpSlideUp 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes crpSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-cerrar {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--crp-bg-white);
    border: 1px solid var(--crp-border-dark);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--crp-text-main);
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}

.modal-cerrar:hover {
    background: #f3f4f6;
    transform: rotate(90deg);
}

.modal-contenido {
    display: flex;
    flex-direction: row;
    min-height: 480px;
    overflow-y: auto;
    flex: 1;
}

.modal-imagen {
    width: 40%;
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-imagen img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    border-radius: 12px;
    mix-blend-mode: multiply;
}

.modal-formulario {
    flex: 1;
    padding: 36px;
    display: flex;
    flex-direction: column;
    font-family: var(--crp-font-body);
}

.modal-formulario h3 {
    font-family: var(--crp-font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.modal-formulario p {
    font-family: var(--crp-font-body);
    color: var(--crp-text-muted);
    font-size: 14px;
    margin: 0 0 8px 0;
}

.estrellas {
    display: flex;
    gap: 8px;
    margin: 12px 0 24px 0;
}

.estrellas .estrella {
    font-size: 34px;
    color: #e5e7eb;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
}

.estrellas .estrella:focus-visible {
    outline: 2px solid var(--crp-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.estrellas .estrella.hover,
.estrellas .estrella.selected {
    color: var(--crp-star);
    transform: scale(1.05);
}

#crp-review-form input,
#crp-review-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--crp-border-dark);
    border-radius: 10px;
    font-family: var(--crp-font-body);
    margin-bottom: 12px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: var(--crp-text-main);
    background: var(--crp-bg-white);
}

#crp-review-form input:focus,
#crp-review-form textarea:focus {
    outline: none;
    border-color: var(--crp-primary);
    box-shadow: 0 0 0 3px var(--crp-primary-soft);
}

#crp-review-form textarea {
    min-height: 110px;
    resize: vertical;
}

.crp-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.crp-file-label {
    display: block;
    border: 2px dashed var(--crp-border-dark);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    color: var(--crp-text-muted);
    background: #fafbfc;
    margin-bottom: 12px;
    transition: border-color 0.2s, background 0.2s;
}

.crp-file-label:hover {
    border-color: var(--crp-primary);
    background: var(--crp-primary-soft);
    color: var(--crp-primary);
}

.crp-file-label input[type="file"] {
    display: block;
    margin: 8px auto 0;
    font-size: 13px;
    color: var(--crp-text-muted);
    background: none;
}

.crp-foto-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.crp-foto-preview .crp-foto-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--crp-border-dark);
}

#enviar-reseña {
    width: 100%;
    background-color: var(--crp-primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 999px;
    font-family: var(--crp-font-heading);
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    font-size: 14px;
    letter-spacing: 0.01em;
    transition: background-color 0.2s, transform 0.15s;
    box-shadow: var(--crp-shadow-btn);
}

#enviar-reseña:hover {
    background-color: var(--crp-primary-hover);
    transform: translateY(-1px);
}

#enviar-reseña:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

#crp-form-feedback {
    margin-top: 12px;
    padding: 0;
    font-size: 13px;
    font-family: var(--crp-font-body);
}

#crp-form-feedback.success,
#crp-form-feedback.error {
    padding: 12px 16px;
    border-radius: 10px;
}

#crp-form-feedback.success {
    background: var(--crp-bg-positive);
    color: var(--crp-text-positive);
    border: 1px solid var(--crp-border-positive);
}

#crp-form-feedback.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.crp-debug-box {
    margin-top: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.04);
    border-radius: 6px;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    max-height: 200px;
    overflow: auto;
}

body.crp-modal-open {
    overflow: hidden;
}

/* === 9. Estrella + total (shortcode) === */
.crp-product-reviews-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--crp-font-body);
    font-size: 13px;
}

.crp-product-reviews-count__star {
    color: var(--crp-star);
}

.crp-grid-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--crp-font-body);
}

/* === 10. Responsive === */
@media (max-width: 1024px) {
    .contenedor-resumen-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .reseñas-avanzadas {
        margin: 24px auto;
    }

    .modal-contenido {
        flex-direction: column;
    }

    .modal-imagen {
        width: 100%;
        height: clamp(200px, 55vw, 280px);
        border-bottom: 1px solid var(--crp-border);
        padding: 16px;
    }

    .modal-imagen img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .modal-formulario {
        padding: 24px;
    }

    #crp-review-form input,
    #crp-review-form textarea {
        font-size: 16px; /* evita zoom iOS */
    }

    .lista-reseñas {
        padding: 24px;
    }

    .lista-reseñas-contenido .reseña {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .reseña-avatar img {
        width: 44px;
        height: 44px;
    }

    .reseña-derecha {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-width: 0;
        width: 100%;
        text-align: left;
        gap: 12px;
    }

    .reseña-utilidad {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .reseña-ayuda-conteo {
        font-size: 12px;
    }

    .destacada-pill {
        font-size: 10px;
        padding: 5px 10px;
    }
}
