/* ==========================================================================
   VARIABLES
   ========================================================================== */
:root {
    --color-brown: #5D3A1B;
    --color-gold: #C3975A;
    --color-background: #FAF6F1;
    --color-white: #FFFFFF;
    --color-text-muted: #8c7d6e;
    --font-primary: 'Poppins', sans-serif;
    --border-radius: 12px;
}

/* ==========================================================================
   BASE
   ========================================================================== */
body {
    background-color: var(--color-background);
    font-family: var(--font-primary);
    color: var(--color-brown);
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.top-navbar {
    background-color: var(--color-brown);
    padding: 0.75rem 0;
}

.top-navbar .navbar-brand {
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn-primary,
.btn-outline-primary,
.btn-warning,
.btn-postular {
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-white);
    padding: 0.75rem 2rem;
}

.btn-primary:hover {
    background-color: #ad8249;
    border-color: #ad8249;
}

.btn-outline-primary {
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: 0.75rem 2rem;
}

.btn-outline-primary:hover {
    background-color: var(--color-gold);
    color: var(--color-white);
}

.btn-warning {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-white);
}

.btn-postular {
    background-color: #28a745;
    border: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    color: var(--color-white);
}

.btn-postular:hover {
    background-color: #218838;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero-section {
    padding: 4rem 0;
    text-align: center;
    /* background-image: url(./public/img/backgroundalfajor.png);
     background-position: center;
     background-size: contain;
     background-repeat: no-repeat; */
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   TITULOS DE SECCION
   ========================================================================== */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* ==========================================================================
   CARDS - CHAMPION
   ========================================================================== */
.champion-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(186, 162, 129, 0.15);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.champion-card:hover {
    transform: scale(1.05);
}

.champion-badge {
    position: absolute;
    top: -1px;
    left: 2rem;
    background-color: var(--color-gold);
    color: var(--color-white);
    padding: 1.5rem 0.75rem 0.5rem;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    font-weight: 700;
}

.champion-card img {
    width: 100%;
    max-width: 250px;
    height: auto;
    object-fit: contain;
}

.champion-score {
    font-size: 2.5rem;
    font-weight: 700;
}

.champion-score small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* ==========================================================================
   CARDS - INFO
   ========================================================================== */
#guia-alfajor .info-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

#guia-alfajor .info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

#guia-alfajor h4 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

#guia-alfajor p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ==========================================================================
   CARDS - RANKING
   ========================================================================== */
.ranking-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(186, 162, 129, 0.1);
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: all 0.2s ease;
    flex-wrap: wrap;
}


.ranking-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(186, 162, 129, 0.15);
}

.ranking-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: var(--color-text-muted);
    color: var(--color-white);
    font-weight: 700;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.ranking-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.ranking-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-brown);
}

.ranking-card .card-score {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   MARCAS
   ========================================================================== */
.marcas-container {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(186, 162, 129, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.marca-logo {
    width: 100px;
    height: 60px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.marca-logo:hover {
    filter: none;
    opacity: 1;
}

/* ==========================================================================
   RANKING DE MARCAS
   ========================================================================== */
.marca-ranking-item {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    text-decoration: none;
    color: var(--color-brown);
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(186, 162, 129, 0.08);
}

.marca-ranking-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(186, 162, 129, 0.15);
}

.marca-ranking-item .rank-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-muted);
    min-width: 30px;
    text-align: center;
}

.marca-ranking-item .rank-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background-color: #f8f9fa;
    padding: 5px;
}

.marca-ranking-item .rank-info {
    flex-grow: 1;
}

.marca-ranking-item .rank-info h5 {
    margin-bottom: 0;
    font-weight: 700;
}

.marca-ranking-item .rank-info small {
    color: var(--color-text-muted);
}

.marca-ranking-item .rank-score {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gold);
    text-align: right;
}

.marca-ranking-item .rank-score small {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* ==========================================================================
   RATING (ESTRELLAS)
   ========================================================================== */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.rating-input input {
    display: none;
}

.rating-input label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-input input:checked~label,
.rating-input label:hover,
.rating-input label:hover~label {
    color: #f7c843;
}

/* ====================================================== */
/* CSS PARA EL CARRUSEL DE ÚLTIMOS COMENTARIOS */
/* ====================================================== */

.comentarios-swiper {
    width: 100%;
    padding-top: 10px;
    padding-bottom: 40px;
}

.comentarios-swiper .swiper-slide {
    height: auto;
    display: flex;
}

.comment-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    /* Asegura que todas las tarjetas en la vista tengan la misma altura */
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(186, 162, 129, 0.08);
    border: 1px solid transparent;
}

.comment-card .comment-text {
    font-style: italic;
    color: var(--color-text-muted);
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    /* Limita la altura del comentario para que no se desborde */
    max-height: 100px;
    overflow: hidden;
}

.comment-card .comment-text::before {
    content: '“';
    /* Comilla de apertura */
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 3rem;
    color: #e0d9cf;
    font-weight: 700;
}

.comment-card .comment-author {
    margin-bottom: 1.5rem;
}

.comment-card .comment-author strong {
    color: var(--color-brown);
}

/* El enlace al alfajor se empuja al final de la tarjeta */
.comment-card .comment-alfajor-link {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--color-brown);
    transition: background-color 0.2s;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.comment-card .comment-alfajor-link:hover {
    background-color: #f8f9fa;
}

.comment-card .comment-alfajor-link img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-card .comment-alfajor-link .alfajor-info span {
    display: block;
    line-height: 1.2;
}

.comment-card .comment-alfajor-link .alfajor-info .alfajor-name {
    font-weight: 700;
}

.comment-card .comment-alfajor-link .alfajor-info .marca-name {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.comment-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* máximo 3 líneas visibles */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    /* asegura el corte en pantallas chicas */
}

.comment-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* mejor balance */
}

.comment-alfajor-link {
    margin-top: auto;
    /* ya lo tenías */
    display: flex;
    justify-content: space-between;
    /* asegura alineación */
    align-items: center;
}

/* ==========================================================================
   MODAL - REVIEWS
   ========================================================================== */
.modal-body .review {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-body .review:last-child {
    border-bottom: none;
}

/* ==========================================================================
   BRAND HERO
   ========================================================================== */
.brand-hero {
    background-color: #f8f9fa;
    padding: 3rem 0;
    border-bottom: 1px solid #dee2e6;
}

.brand-hero-logo {
    max-width: 200px;
    max-height: 150px;
    object-fit: contain;
}

.alfajor-card-img {
    height: 200px;
    object-fit: contain;
}

.stats-section {
    margin-top: 2.3rem;
    margin-bottom: 6rem;
}

.stats-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(186, 162, 129, 0.12);
    transition: all 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(186, 162, 129, 0.18);
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
}

.stats-card p {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background-color: #211811;
    color: #a09385;
    padding-top: 3rem;
    padding-bottom: 1rem;
    margin-top: 4rem;
}

.footer h5 {
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1rem;
}

.footer a {
    color: #a09385;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--color-white);
}

.footer-social a {
    font-size: 1.2rem;
    margin: 0 0.5rem;
}


/* Mobile: lista apilada estilo ranking */
@media (max-width: 767px) {
    .ranking-card {
        flex-direction: row !important;
        text-align: left !important;
    }


    .ranking-card .rank-number {
        font-size: 1.2rem;
        width: 40px;
    }

    .ranking-card .rank-logo {
        width: 50px !important;
        height: 50px !important;
    }

    .ranking-card img {
        margin-bottom: 0rem;
    }
}


/*
 * Contenedor para la imagen del producto que se vuelve 'pegajoso' en escritorio.
 * - 'top' debe ser la altura de tu navbar + un margen (ej. 70px + 20px).
 * - En móviles (abajo de 768px), se desactiva el 'sticky' para un scroll normal.
*/
.sticky-image-container {
    position: sticky;
    top: 90px;
    /* <--- AJUSTA ESTE VALOR a la altura de tu menú + 20px */
}

@media (max-width: 767.98px) {
    .sticky-image-container {
        position: static;
        /* Desactiva el sticky en móviles */
    }
}

/* Espaciado y alto fluido para que las cards no “corten” */
.swiper {
    overflow: hidden;
    padding: 4px 0;
}

.swiper-wrapper {
    align-items: stretch;
}

.swiper-slide {
    height: auto;
}

/* Asegura que la card llene el alto del slide */
.ranking-card,
.marca-ranking-item {
    display: flex;
    flex-direction: column;
}

/* Botones centrados verticalmente en desktop */
.podio-swiper .swiper-button-next,
.podio-swiper .swiper-button-prev,
.marcas-swiper .swiper-button-next,
.marcas-swiper .swiper-button-prev,
.ultimos-swiper .swiper-button-next,
.ultimos-swiper .swiper-button-prev {
    top: 40%;
}

/* Ocultar flechas en mobile */
@media (max-width: 767.98px) {

    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }
}

/* Un poco de aire entre slides */
.podio-swiper .swiper-slide,
.marcas-swiper .swiper-slide,
.ultimos-swiper .swiper-slide {
    padding: 4px;
}

/* Evita conflictos: NO metas .row/.col dentro de .swiper-wrapper */