/* ==========================================================================
   ESTILOS GENERALES Y DISEÑO DE LA PÁGINA DE PRODUCTOS
   Comercializadora Robles Aceves y Asociados
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

body {
    background: #ffffff;
    font-family: 'Noto Serif', serif;
}

/* Evitar que la navbar tape los títulos al navegar por anclajes */
section[id^="seccion"] {
    scroll-margin-top: 105px;
}

@media (min-width: 1200px) {
    .container {
        max-width: 90% !important;
    }
}

/* ==========================================================================
   1. MENÚ LATERAL DE CATEGORÍAS (SIDEBAR)
   ========================================================================== */

/* Botón flotante izquierdo para abrir categorías */
.btn-abrir-categorias {
    position: fixed;
    left: 18px;
    top: 120px;
    z-index: 9997;
    background: #00177c;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 12px 18px;
    font-family: 'Noto Serif', serif;
    font-weight: bold;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    gap: 9px;
    transition: all 0.3s ease;
}

.btn-abrir-categorias:hover {
    background: #b8860b;
    color: white;
    transform: translateX(5px);
    text-decoration: none;
}

/* Panel lateral deslizante */
.panel-categorias-productos {
    position: fixed;
    top: 95px;
    left: 18px;
    width: 285px;
    max-height: 78vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 18px;
    z-index: 9998;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
    transform: translateX(-120%);
    opacity: 0;
    transition: all 0.35s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-family: 'Noto Serif', serif;
}

.panel-categorias-productos.activo {
    transform: translateX(0);
    opacity: 1;
}

/* Encabezado del panel lateral */
.panel-categorias-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 12px;
}

.panel-categorias-header h4 {
    color: #00177c;
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
}

.panel-categorias-header h4::after {
    content: "";
    display: block;
    width: 55px;
    height: 3px;
    background: #b8860b;
    border-radius: 20px;
    margin-top: 8px;
}

.panel-categorias-header button {
    background: #f3eee6;
    color: #00177c;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.panel-categorias-header button:hover {
    background: #b8860b;
    color: white;
}

/* Enlaces del panel */
.panel-categorias-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.panel-categorias-links a {
    color: #222;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.93rem;
    transition: all 0.3s ease;
}

.panel-categorias-links a i {
    color: #00177c;
    width: 18px;
    text-align: center;
}

.panel-categorias-links a:hover {
    background: #f8f6f0;
    color: #b8860b;
    text-decoration: none;
    transform: translateX(5px);
}

.panel-categorias-links a:hover i {
    color: #b8860b;
}

/* Fondo oscuro translúcido al abrir panel */
.fondo-categorias {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 9996;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.fondo-categorias.activo {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================
   2. CARRUSEL DE OFERTAS Y TÍTULOS
   ========================================================== */

#seccion0 {
    padding-top: 110px;
    margin-bottom: 45px;
}

#carouselExampleControls {
    max-width: 430px;
    margin: 0 auto;
}

.img-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
}

.img-wrapper img {
    width: 100%;
    max-width: 430px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Título de la sección general */
section.container.my-5:not([id]) h2 {
    color: #111;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 18px;
}

section.container.my-5:not([id]) p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Títulos de categorías de productos */
section[id^="seccion"] > h2 {
    color: #00177c;
    font-size: 2.2rem;
    font-weight: bold !important;
    letter-spacing: 1px;
    margin-bottom: 38px !important;
    position: relative;
    text-align: center;
}

section[id^="seccion"] > h2::after {
    content: "";
    width: 90px;
    height: 4px;
    background: #b8860b;
    display: block;
    margin: 16px auto 0 auto;
    border-radius: 20px;
}

/* ==========================================================
   3. TARJETAS DE PRODUCTOS (GRID Y CARDS)
   ========================================================== */

.row.g-4 > .col {
    margin-bottom: 30px;
}

.product-card {
    border-radius: 26px !important;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10) !important;
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16) !important;
}

/* Contenedor de la imagen de producto */
.card-img-wrapper {
    position: relative;
    height: 235px;
    background: #faf7f0;
    padding: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.card-img-wrapper img, .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.4s ease;
}

.product-card:hover .card-img-wrapper img {
    transform: scale(1.06);
}

/* Cuerpo de la tarjeta */
.product-card .card-body {
    padding: 22px 18px 24px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card .card-title {
    color: #00177c;
    font-weight: bold;
    font-size: 1.08rem;
    line-height: 1.35;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    text-align: center;
}

/* Mensaje corto de confianza en tarjeta */
.producto-confianza {
    font-size: 0.86rem;
    color: #555;
    background: #f8f6f0;
    border-left: 4px solid #b8860b;
    padding: 8px 10px;
    border-radius: 12px;
    margin: 0 0 16px 0;
    line-height: 1.4;
    text-align: left;
}

.producto-confianza i {
    color: #b8860b;
    margin-right: 5px;
}

/* ==========================================================
   4. BOTONES Y DROPDOWNS DE ACCIÓN
   ========================================================== */

/* Botón Cotizar Producto */
.botones {
    background: #00177c !important;
    color: white !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 10px 20px !important;
    font-weight: bold !important;
    font-family: 'Noto Serif', serif !important;
    box-shadow: 0 6px 16px rgba(0, 23, 124, 0.22) !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.botones:hover {
    background: #b8860b !important;
    color: white !important;
    transform: translateY(-3px) scale(1.04) !important;
    box-shadow: 0 10px 22px rgba(184, 134, 11, 0.32) !important;
}

/* Menú Desplegable Contactar */
.dropdown-menu {
    border-radius: 16px;
    border: none;
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
}

.dropdown-menu .dropdown-item {
    border-radius: 10px;
    padding: 9px 12px;
    font-family: 'Noto Serif', serif;
}

.dropdown-menu .dropdown-item:hover {
    background: #f3eee6;
    color: #b8860b;
}

/* ==========================================================
   5. BOTÓN FLOTANTE DE WHATSAPP
   ========================================================== */

.whatsapp-flotante {
    position: fixed;
    right: 25px;
    bottom: 25px;
    background: #25d366;
    color: white !important;
    height: 58px;
    padding: 0 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Noto Serif', serif;
    font-size: 17px;
    font-weight: bold;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    z-index: 9999;
    transition: all 0.35s ease;
}

.whatsapp-flotante:hover {
    background-color: #20ba5a;
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.45);
}

/* ==========================================================
   6. DISEÑO RESPONSIVO (MEDIA QUERIES)
   ========================================================== */

@media (max-width: 768px) {
    /* Ajustes generales carrusel móvil */
    #seccion0 {
        padding-top: 95px;
        margin-bottom: 35px;
    }

    #carouselExampleControls {
        max-width: 320px;
    }

    .img-wrapper img {
        max-width: 320px;
    }

    /* Redimensionar textos en móviles */
    section.container.my-5:not([id]) h2 {
        font-size: 2rem;
    }

    section[id^="seccion"] > h2 {
        font-size: 1.65rem;
        line-height: 1.35;
    }

    /* Tarjetas de productos en móviles */
    .card-img-wrapper {
        height: 190px;
        padding: 12px;
    }

    .product-card {
        border-radius: 22px !important;
    }

    .product-card .card-title {
        font-size: 0.98rem;
        min-height: auto;
    }

    .producto-confianza {
        font-size: 0.8rem;
    }

    .botones {
        font-size: 0.82rem !important;
        padding: 9px 14px !important;
    }

    /* Botón flotante móvil de categorías */
    .btn-abrir-categorias {
        top: auto;
        bottom: 88px;
        left: 16px;
        padding: 0;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        justify-content: center;
        font-size: 0;
    }

    .btn-abrir-categorias i {
        font-size: 22px;
    }

    /* Panel móvil de categorías */
    .panel-categorias-productos {
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 80px;
        width: auto;
        max-height: 65vh;
        border-radius: 24px;
    }
}

/* ==========================================================
   MEJORAS PREMIUM DE CARRUSEL Y PRODUCTOS
   ========================================================== */
#seccion0 {
    padding-top: 110px;
    margin-bottom: 45px;
}
@media (max-width: 768px) {
    #seccion0 {
        padding-top: 95px;
    }
}
#carouselExampleControls {
    max-width: 1150px;
    margin: 0 auto;
}
.img-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
}
.img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.img-wrapper img:hover {
    transform: scale(1.035);
    box-shadow: 0 12px 30px rgba(1, 35, 113, 0.15);
}
.carousel-flecha {
    font-size: 2.8rem;
    color: rgb(1, 35, 113) !important;
    transition: all 0.35s ease;
}
.carousel-control-prev:hover .carousel-flecha,
.carousel-control-next:hover .carousel-flecha {
    color: #b8860b !important;
    transform: scale(1.2);
}
@media (min-width: 1200px) {
    .carousel-control-prev {
        left: -80px !important;
        width: 50px !important;
    }
    .carousel-control-next {
        right: -80px !important;
        width: 50px !important;
    }
}
