/* ======================================================
     BASE STYLES (Frontend)

     Propósito:
     - Aquí van los estilos base que definen la estructura y
         componentes reutilizables del frontend público: reset,
         navbar (frontend), layout, footer, botones comunes y
         utilidades compartidas por varias vistas.

     Uso:
     - Debe cargarse DESPUÉS de `tokens.css` en todas las vistas
         públicas para que las variables estén disponibles.

     Recomendaciones para editores:
     - Mantener reglas generales y componentes que sean agnósticos
         a la vista. Evitar introducir estilos exclusivos del
         backoffice (usar `public/css/admin/` para eso).
     - Documentar secciones (ya marcadas con separadores) y agrupar
         por vista cuando los estilos sean específicos.
====================================================== */

/* =================================== RESET =================================== */
 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
}
 html {
     scroll-behavior: smooth;
}
 body {
     font-family: var(--font-family);
     background: linear-gradient( 180deg, #ffffff 0%, #f9e4ee 100% );
     color: var(--text-dark);
}
/* =================================== NAVBAR =================================== */
 .navbar-custom {
     background: linear-gradient( 180deg, rgba(255,255,255,.96), rgba(246,229,235,.96) );
     border-bottom: 1px solid var(--border-color);
     box-shadow: var(--shadow-light);
     padding: .5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
     width: 100%;
}
/* LOGO */
 .navbar-brand {
     font-family: var(--font-heading);
     color: #6d3f2f !important;
     font-size: var(--font-size-xxl);
     text-decoration: none;
}
 .navbar-logo-container {
     width: var(--logo-size);
     height: var(--logo-size);
     border-radius: 50%;
     overflow: hidden;
     display: flex;
     align-items: center;
     justify-content: center;
}
 .navbar-logo {
     width: 100%;
     height: 100%;
     object-fit: cover;
     transform: scale(var(--logo-zoom));
}
/* NAV LINKS */
 .navbar-nav .nav-link {
     color: #6d3f2f !important;
     font-weight: 600;
     transition: .2s ease;
}
 .navbar-nav .nav-link:hover {
     color: var(--primary-dark) !important;
}
/* =================================== TOGGLER =================================== */
 .navbar-toggler {
     border: none !important;
     background: transparent !important;
     width: 42px;
     height: 42px;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: none !important;
}
 .navbar-toggler:focus, .navbar-toggler:active {
     box-shadow: none !important;
}
 .navbar-toggler-icon {
     background-image: none !important;
     position: relative;
     width: 24px;
     height: 2px;
     background: #6d3f2f;
     transition: .25s ease;
}
 .navbar-toggler-icon::before, .navbar-toggler-icon::after {
     content: '';
     position: absolute;
     left: 0;
     width: 24px;
     height: 2px;
     background: #6d3f2f;
     transition: .25s ease;
}
 .navbar-toggler-icon::before {
     top: -7px;
}
 .navbar-toggler-icon::after {
     top: 7px;
}
 .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
     background: transparent;
}
 .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
     transform: rotate(45deg);
     top: 0;
}
 .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
     transform: rotate(-45deg);
     top: 0;
}
/* =================================== MEGA MENU DESKTOP =================================== */
 .mega-dropdown {
     position: relative;
}
 .mega-toggle {
     padding: 1rem;
}
 .mega-menu {
     position: absolute;
     top: 100%;
     right: 0;
     width: 900px;
     background: white;
     border-radius: 24px;
     padding: 1.5rem;
     box-shadow: 0 10px 30px rgba(0,0,0,.12);
     opacity: 0;
     visibility: hidden;
     transform: translateY(10px);
     transition: .25s ease;
     z-index: 999;
}
 .mega-dropdown:hover .mega-menu {
     opacity: 1;
     visibility: visible;
     transform: translateY(0);
}
 .mega-grid {
     display: grid;
     grid-template-columns: repeat(4,1fr);
     gap: 1rem;
}
/* =================================== CATEGORY CARDS =================================== */
 .category-nav-card {
     position: relative;
     display: block;
     height: 90px;
     border-radius: 20px;
     overflow: hidden;
     text-decoration: none;
     box-shadow: 0 6px 18px rgba(0,0,0,.10);
     transition: .3s ease;
}
 .category-nav-card img {
     width: 100%;
     height: 100%;
     object-fit: cover;
     transition: .4s ease;
}
 .category-nav-overlay {
     position: absolute;
     inset: 0;
     background: rgba(0,0,0,.28);
     display: flex;
     align-items: center;
     justify-content: center;
}
 .category-nav-overlay h6 {
     color: white;
     font-size: 1.1rem;
     font-weight: 700;
     margin: 0;
     text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
 .category-nav-card:hover {
     transform: translateY(-4px);
}
 .category-nav-card:hover img {
     transform: scale(1.06);
}
/* =================================== MOBILE CATEGORY GRID =================================== */
 .category-grid {
     display: none;
}
 @media (max-width: 991px) {
     .mega-menu {
         display: none !important;
    }
     .mega-dropdown {
         display: none !important;
    }
     .navbar-collapse.show .category-grid {
         display: grid !important;
         grid-template-columns: repeat(2,1fr);
         gap: 1rem;
         width: 100%;
         padding-top: 1rem;
    }
     .category-nav-card {
         height: 65px;
    }
     .category-nav-overlay h6 {
         font-size: 1rem;
    }
}
 @media (max-width: 480px) {
     .navbar-brand {
         font-size: 1.5rem;
    }
     .navbar-collapse.show .category-grid {
         gap: .75rem;
    }
     .category-nav-card {
         height: 55px;
    }
     .category-nav-overlay h6 {
         font-size: .95rem;
    }
}
/* =================================== MOBILE MENU LINKS =================================== */
/* Estilos para los botones del menú móvil (FAQ, Contacto, Categorías dinámicas) */
.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 0.75rem 0;
}
.mobile-menu-links .mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-radius: 12px;
    background: white;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 700;
    box-shadow: var(--shadow-light);
}
.mobile-menu-links .mobile-menu-btn i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(180deg, var(--hero-bg-start), var(--hero-bg-end));
    color: var(--text-dark);
}
/* Cuando hay muchas categorías, permitir scroll dentro del colapsado */
.navbar-collapse .mobile-menu-links {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* =================================== HERO =================================== */
 .hero-box {
     background: linear-gradient( 180deg, var(--hero-bg-start), var(--hero-bg-end) );
     margin: 1rem auto 2rem auto;
     max-width: 700px;
     border-radius: 24px;
     padding: 1.5rem;
     box-shadow: var(--shadow-light);
}
 .hero-box h1 {
     font-family: var(--font-heading);
     font-size: 2.5rem;
     color: #6d3f2f;
     margin: 0;
}
/* =================================== FILTERS =================================== */
 .filters-section {
     background: white;
     padding: 1.2rem;
     border-radius: 20px;
     margin-bottom: 2rem;
     box-shadow: var(--shadow-light);
     position: relative;
     z-index: 3000;
}
 .filters-section .form-select {
     border-radius: 12px;
     border: 1px solid var(--border-color);
}
/* =================================== PRODUCT CARDS =================================== */
 .product-card {
     height: 100%;
     border: 1px solid #e8dce5 !important;
     border-radius: 22px !important;
     overflow: hidden;
     background: white;
     box-shadow: var(--shadow-light);
     transition: .25s ease;
}
 .product-card:hover {
     transform: translateY(-6px);
     box-shadow: var(--shadow-medium);
}
 .product-img {
     width: 100%;
     height: 240px;
     object-fit: cover;
}
 .product-card .card-body {
     padding: 1rem;
}
 .product-price {
     color: var(--primary-dark);
     font-size: 1.25rem;
     font-weight: 700;
     margin-bottom: .35rem;
}
 .product-title {
     color: var(--text-dark);
     font-size: .95rem;
     line-height: 1.4;
     margin: 0;
     min-height: 45px;
}
/* =================================== FOOTER =================================== */
 .footer-custom {
     margin-top: 4rem;
     padding: 2.5rem 0;
     background: linear-gradient( 180deg, rgba(246,229,235,.95), rgba(240,214,226,.95) );
     border-top: 1px solid var(--border-color);
}
 .footer-logo {
     font-family: var(--font-heading);
     font-size: 2.2rem;
     color: #6d3f2f;
}
 .footer-text, .footer-copy {
     color: var(--text-light);
     font-size: .9rem;
}
 .footer-socials {
     display: flex;
     justify-content: center;
     gap: 1rem;
}
 .footer-icon {
     width: 45px;
     height: 45px;
     border-radius: 50%;
     background: white;
     display: flex;
     align-items: center;
     justify-content: center;
     color: #6d3f2f;
     text-decoration: none;
     box-shadow: var(--shadow-light);
     transition: .25s ease;
}
 .footer-icon:hover {
     background: var(--primary-color);
     color: white;
     transform: translateY(-4px);
}

/* BOTÓN SECUNDARIO PARA CARRITO: "Continuar comprando" */
.cart-secondary-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: .85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    margin-bottom: .75rem;
    transition: transform .18s ease, background .18s ease, color .18s ease;
}
.cart-secondary-btn:hover{transform: translateY(-3px);background:var(--primary-color);color:var(--white)}

/* Acordeón FAQ: estilos simples para mantener look consistente */
.accordion-button {
    font-weight: 700;
    color: var(--text-dark);
    background: linear-gradient(90deg, rgba(255,255,255,0.92), rgba(255,255,255,0.92));
}
.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--hero-bg-start), var(--hero-bg-end));
    color: var(--text-dark);
}
.accordion-body{color:var(--text-light)}

/* FAQ: tarjetas informativas y bloque de stock */
.faq-stock-card {
    background: transparent;
}
.stock-option {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}
.stock-icon{
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--hero-bg-start), var(--hero-bg-end));
    color: var(--text-dark);
    font-size: 1.4rem;
    box-shadow: var(--shadow-light);
}

.faq-info-card{
    background: white;
    padding: 1.25rem;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}
.faq-info-header{
    display:flex;
    gap: .75rem;
    align-items:center;
    margin-bottom: .75rem;
}
.faq-info-icon{
    width:48px;
    height:48px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: var(--shadow-light);
}
.faq-info-title{font-weight:700;color:var(--text-dark)}
.faq-info-text{color:var(--text-light);margin-bottom:.75rem}
.faq-example-box{background:linear-gradient(180deg, #fff8fb, #fff1f6);padding: .85rem;border-radius:12px;border:1px solid #f4dfe8}

/* ===================================
   CART BUTTON
=================================== */

.cart-btn {

    position: relative;

    display: flex;

    align-items: center;

    gap: .7rem;

    background: white;

    padding: .8rem 1.1rem;

    border-radius: 999px;

    text-decoration: none;

    color: #6d3f2f;

    font-weight: 700;

    box-shadow: 0 4px 14px rgba(0,0,0,0.08);

    transition: all .25s ease;
}

.cart-btn:hover {

    transform: translateY(-2px);

    background: #fff7fb;

    color: #6d3f2f;
}

.cart-btn i {

    font-size: 1rem;
}

.cart-badge {

    min-width: 22px;

    height: 22px;

    padding: 0 .45rem;

    border-radius: 999px;

    background: #ff6b6b;

    color: white;

    font-size: .75rem;

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: 700;
}

/* ===================================
   MOBILE CART
=================================== */

.mobile-cart-btn {

    margin-top: 1rem;

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: .7rem;

    background: white;

    padding: 1rem;

    border-radius: 18px;

    text-decoration: none;

    color: #6d3f2f;

    font-weight: 700;

    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

/* ===================================
   FLOATING WHATSAPP
=================================== */

.floating-whatsapp {

    position: fixed;

    right: 22px;

    bottom: 22px;

    width: 64px;

    height: 64px;

    border-radius: 50%;

    background: #25D366;

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 2rem;

    text-decoration: none;

    z-index: 9999;

    box-shadow:
        0 10px 30px rgba(37,211,102,0.35);

    transition: all .25s ease;

    animation: whatsappPulse 2s infinite;

}

.floating-whatsapp:hover {

    transform: scale(1.08);

    color: white;

    box-shadow:
        0 14px 35px rgba(37,211,102,0.45);

}

@keyframes whatsappPulse {

    0% {

        box-shadow:

            0 0 0 0 rgba(37,211,102,0.45);

    }

    70% {

        box-shadow:

            0 0 0 18px rgba(37,211,102,0);

    }

    100% {

        box-shadow:

            0 0 0 0 rgba(37,211,102,0);

    }

}

/* ===================================
   FILTERS SECTION
=================================== */

.filters-section {

    background: rgba(255,255,255,0.9);

    backdrop-filter: blur(10px);

    padding: 1.5rem;

    border-radius: 24px;

    border: 1px solid #f0dfe8;

    box-shadow:

        0 8px 24px rgba(0,0,0,0.06);

    margin-bottom: 2rem;

}

/* LABEL */

.filters-section .form-label {

    color: #6d3f2f;

    font-size: .95rem;

    margin-bottom: .55rem;

    letter-spacing: .2px;
}
/* ===================================
   CUSTOM FILTER DROPDOWN
=================================== */

.custom-filter-dropdown {

    position: relative;

    z-index: 3000;

}

/* BOTON */

.filter-dropdown-btn {

    width: 100%;

    height: 56px;

    border: 1px solid var(--border-color);

    border-radius: 18px;

    background:

        linear-gradient(

            180deg,

            #ffffff 0%,

            #fff8fb 100%

        );

    color: var(--text-dark);

    font-weight: 600;

    padding: 0 1.2rem;

    text-align: left;

    box-shadow:

        0 4px 14px rgba(0,0,0,.05);

    transition: all .25s ease;

}

/* HOVER */

.filter-dropdown-btn:hover {

    border-color: var(--primary-dark);

    transform: translateY(-1px);

}

/* FOCUS */

.filter-dropdown-btn:focus {

    border-color: var(--primary-dark);

    box-shadow:

        0 0 0 4px rgba(197,169,214,.18);

}

/* MENU */

.custom-dropdown-menu {

    width: 100%;

    margin-top: .7rem;

    border: none;

    border-radius: 22px;

    padding: .55rem;

    background: white;

    z-index: 3000 !important;

    box-shadow:

        0 14px 34px rgba(0,0,0,.14);

    overflow: hidden;

    animation: dropdownFade .18s ease;

}

/* ITEMS */

.custom-dropdown-menu .dropdown-item {

    border-radius: 16px;

    padding: .9rem 1rem;

    font-weight: 600;

    color: var(--text-dark);

    transition: all .2s ease;

}

/* HOVER ITEM */

.custom-dropdown-menu .dropdown-item:hover {

    background: #f8edf4;

    color: #6d3f2f;

    transform: translateX(2px);

}

/* ACTIVE */

.custom-dropdown-menu .dropdown-item.active {

    background:

        linear-gradient(

            135deg,

            var(--primary-color),

            var(--primary-dark)

        );

    color: white;

}

/* PRODUCT CARDS */

.product-card {

    overflow: visible !important;

    z-index: 1500;

}

/* CONTAINERS */

.container,
.row,
.col-lg-3,
.col-md-4 {

    overflow: visible !important;

}

/* ANIMATION */

@keyframes dropdownFade {

    from {

        opacity: 0;

        transform: translateY(8px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}

/* MOBILE */

@media(max-width: 768px) {

    .filters-section {

        padding: 1rem;

        border-radius: 20px;

    }

    .filter-dropdown-btn {

        height: 52px;

    }

}
