/* ========================================================================
   GOOGLE REVIEWS WIDGET
   Estilos centralizados para las tres variantes: footer, product, hero.

   Aligned to the global design-token system (--border-color, --radius,
   --muted-foreground, --transition-base, --shadow-sm).
   ======================================================================== */

/* ========================================
   BASE: Estilos compartidos
   ======================================== */
.gr-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.gr-widget--error {
    display: none;
}

/* Atribucion Google Maps */
.gr-attribution {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-medium, 500);
    color: var(--muted-foreground, #71717a);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gr-attribution-text {
    white-space: nowrap;
}

.gr-attribution-logo {
    display: inline-block;
    vertical-align: middle;
}

.gr-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

@media (min-width: 576px) {
    .gr-content {
        flex-direction: row;
        gap: 0.75rem;
    }
}

/* Footer y product: fila horizontal en pantalla grande.
   Hero excluido: tiene su propia estructura interna. */
@media (min-width: 576px) {
    .gr-widget:not(.gr-widget--hero) {
        flex-direction: row;
        gap: 1rem;
    }
}

/* Estrellas */
.gr-stars {
    display: flex;
    gap: 0.125rem;
}

.gr-star {
    font-size: 1.125rem;
    line-height: 1;
}

.gr-star--full {
    color: #FBBC04;
}

.gr-star--empty {
    color: var(--border-color, #e4e4e7);
}

/* Resumen de valoracion */
.gr-summary {
    display: flex;
    align-items: baseline;
    gap: 0.125rem;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--foreground, #09090b);
    white-space: nowrap;
}

.gr-rating {
    font-weight: var(--font-weight-semibold, 600);
    font-size: var(--font-size-base, 1rem);
    color: var(--foreground, #09090b);
}

.gr-separator,
.gr-max {
    color: var(--muted-foreground, #71717a);
    font-size: var(--font-size-sm, 0.875rem);
}

/* Enlace a Google (shadcn outline button) */
.gr-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-medium, 500);
    color: var(--theme-primary, #2563eb);
    text-decoration: none;
    border: 1px solid var(--border-color, #e4e4e7);
    border-radius: var(--border-radius-sm, 0.375rem);
    background-color: transparent;
    transition: background-color var(--transition-base, 0.2s ease),
                border-color var(--transition-base, 0.2s ease);
    white-space: nowrap;
}

.gr-link:hover {
    background-color: var(--accent, #f4f4f5);
    border-color: var(--theme-primary, #2563eb);
    color: var(--theme-primary, #2563eb);
}

.gr-google-icon {
    flex-shrink: 0;
}

/* ========================================
   VARIANTE: FOOTER
   ======================================== */
/* Usa los estilos base */

/* ========================================
   VARIANTE: PRODUCT
   ======================================== */
.gr-widget--product {
    text-align: center;
}

.gr-widget--product .gr-content {
    flex-wrap: wrap;
    justify-content: center;
}

@media (min-width: 576px) {
    .gr-widget--product .gr-content {
        flex-direction: row;
    }
}

/* Ajustes en contexto product-reviews-widget */
.product-reviews-widget {
    background-color: var(--card, #fff);
    border: 1px solid var(--border-color, #e4e4e7);
    border-radius: var(--border-radius-md, 0.5rem);
    padding: 0.75rem;
}

.product-reviews-widget .gr-widget {
    padding: 0;
}

.product-reviews-widget .gr-attribution {
    margin-bottom: 0.25rem;
}

@media (min-width: 576px) {
    .product-reviews-widget .gr-attribution {
        margin-bottom: 0;
    }
}

.product-reviews-widget .gr-content {
    flex-wrap: wrap;
}

/* ========================================
   VARIANTE: HERO (wide layout)
   ======================================== */
.gr-widget--hero {
    align-items: stretch;
    background: var(--muted, #f4f4f5);
    border: 1px solid var(--border-color, #e4e4e7);
    border-radius: var(--border-radius-lg, 0.75rem);
    padding: 1.25rem 1.5rem;
    gap: 1rem;
}

.gr-hero-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e4e4e7);
}

.gr-hero-header .gr-attribution {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--foreground, #09090b);
    text-transform: none;
    letter-spacing: var(--tracking-normal, 0);
}

.gr-hero-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.gr-hero-summary .gr-stars {
    gap: 0.125rem;
}

.gr-hero-summary .gr-star {
    font-size: 1.25rem;
}

.gr-hero-summary .gr-rating {
    font-size: var(--font-size-lg, 1.25rem);
    font-weight: var(--font-weight-bold, 700);
}

/* ----------------------------------------
   CLS FIX: Layout pre-Slick
   ---------------------------------------- */
.gr-hero-carousel:not(.slick-initialized) {
    display: flex;
    overflow: hidden;
    gap: 0.75rem;
}

.gr-hero-carousel:not(.slick-initialized) .gr-hero-review {
    flex: 0 0 calc(33.333% - 0.5rem);
    min-width: 0;
}

@media (max-width: 1199.98px) {
    .gr-hero-carousel:not(.slick-initialized) .gr-hero-review {
        flex: 0 0 calc(50% - 0.375rem);
    }
}

@media (max-width: 767.98px) {
    .gr-hero-carousel:not(.slick-initialized) .gr-hero-review {
        flex: 0 0 100%;
    }
}

/* Carousel Slick activo */
.gr-hero-reviews {
    margin: 0 -0.375rem;
}

.gr-hero-reviews .slick-slide {
    padding: 1rem;
    margin: 0 0.5rem;
    box-sizing: border-box;
}

.gr-hero-reviews .slick-track {
    display: flex;
    align-items: stretch;
}

.gr-hero-reviews .slick-slide > div {
    height: 100%;
}

.gr-hero-reviews .slick-slide .gr-hero-review {
    height: 100%;
}

/* Card individual de resena — misma logica que auth card */
.gr-hero-review {
    background: var(--card, #fff);
    border: 1px solid var(--border-color, #e4e4e7);
    border-radius: var(--border-radius-md, 0.5rem);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    transition: box-shadow var(--transition-base, 0.2s ease);
}

.gr-hero-review:hover {
    box-shadow: var(--shadow-sm);
}

.gr-review-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gr-review-author {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--foreground, #09090b);
}

.gr-review-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.gr-review-meta .gr-stars {
    gap: 0.0625rem;
}

.gr-review-meta .gr-star {
    font-size: var(--font-size-sm, 0.875rem);
}

.gr-review-time {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--muted-foreground, #71717a);
}

.gr-review-text {
    font-size: var(--font-size-sm, 0.875rem);
    line-height: var(--line-height-normal, 1.5);
    color: var(--muted-foreground, #71717a);
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Enlace hero — outline button style */
.gr-link--hero {
    align-self: center;
    padding: 0.5rem 1.25rem;
    font-size: var(--font-size-sm, 0.875rem);
    border-radius: var(--border-radius-sm, 0.375rem);
    background: transparent;
    border: 1px solid var(--border-color, #e4e4e7);
    color: var(--foreground, #09090b);
    font-weight: var(--font-weight-medium, 500);
    transition: background-color var(--transition-base, 0.2s ease),
                border-color var(--transition-base, 0.2s ease);
}

.gr-link--hero:hover {
    background-color: var(--accent, #f4f4f5);
    border-color: var(--border-color, #e4e4e7);
    color: var(--foreground, #09090b);
}

/* Responsive hero header */
@media (min-width: 768px) {
    .gr-hero-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .gr-hero-summary {
        flex-wrap: nowrap;
    }
}

/* Slick dots - Hero carousel */
.gr-widget--hero .slick-dots {
    position: relative;
    bottom: auto;
    margin-top: 0.75rem;
}

.gr-widget--hero .slick-dots li {
    margin: 0 2px;
}

.gr-widget--hero .slick-dots li button:before {
    font-size: 20px;
    color: var(--border-color, #e4e4e7);
    opacity: 1;
}

.gr-widget--hero .slick-dots li.slick-active button:before {
    color: var(--theme-primary, #2563eb);
    opacity: 1;
}

.gr-widget--hero .slick-dotted.slick-slider {
    margin-bottom: 0;
}
