/* ===== MEGA MENU ===== */
@media (min-width: 992px) {
    .dropdown-mega:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

.dropdown-mega.position-static .dropdown-menu {
    left: 0;
    right: 0;
    top: 100%;
}

.dropdown-item {
    background: transparent;
    font-size: 14px;
}

.dropdown-item:hover {
    text-decoration: underline;
}

/* ===== TOP BAR ===== */
.top-bar-promo {
    background-color: #198754;
    height: 45px;
    width: 100%;
    font-size: 0.85rem;
    overflow: hidden;
}

/* ===== NAVBAR ===== */
.sticky-top {
    top: 0;
}

/* ===== HERO (solo index) ===== */
.hero-banner img {
    object-fit: cover;
    object-position: center;
    filter: brightness(0.8);
}

/* ===== SIDEBAR FILTROS ===== */
.sidebar-filtros {
    background: #fff;
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    position: sticky;
    top: 90px;
}

.sidebar-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #888;
    margin-bottom: 10px;
}

.sidebar-link {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: #f5f5f5;
}

.sidebar-link.active {
    background: #000;
    color: #fff;
}

/* ===== PRODUCTOS ===== */
.product-card {
    border: none;
    border-radius: 14px;
    transition: all 0.3s ease;
    overflow: hidden;
    background: #fff;
}   

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* CONTENEDOR IMAGEN */
.product-img-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;

    width: 100%;
    height: 260px;
}

/* =========================================
   PRODUCTO HOVER SEGUNDA IMAGEN
========================================= */

.product-image-link {
    position: relative;
    display: block;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #f8f8f8;
}

.product-image {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;

    transition:
        opacity 0.4s ease,
        transform 0.5s ease;
}

/* IMAGEN PRINCIPAL */
.principal-image {
    opacity: 1;
    z-index: 1;
}

/* SEGUNDA IMAGEN */
.hover-image {
    opacity: 0;
    z-index: 2;
}

/* HOVER DESKTOP */
@media (hover: hover) {

    .product-card:hover .principal-image {
        opacity: 0;
        transform: scale(1.03);
    }

    .product-card:hover .hover-image {
        opacity: 1;
        transform: scale(1.03);
    }
}

/* SPLIDE AJUSTADO */
.product-splide,
.product-splide .splide__track,
.product-splide .splide__list,
.product-splide .splide__slide {
    height: 100%;
}

.product-splide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* FLECHAS SOLO EN HOVER */
.splide__arrow {
    background: rgba(255,255,255,0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .splide__arrow {
    opacity: 1;
}

/* PAGINACIÓN */
.splide__pagination__page {
    background: #ccc;
    height: 4px;
    width: 12px;
    border-radius: 2px;
}

.splide__pagination__page.is-active {
    background: #000;
    transform: scale(1.2);
}

/* TEXTO PRODUCTO */
.product-title {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.product-price {
    font-weight: bold;
    font-size: 1.2rem;
    color: #000;
}

/* ESPACIADO DESKTOP */
@media (min-width: 1200px) {
    main.container-fluid {
        padding-left: 60px;
        padding-right: 60px;
    }
}

@media (max-width: 991px) {
    .dropdown-mega .dropdown-menu {
        max-height: 60vh;
    }
}
/* ===== MEGA MENU SCROLL FIX + STABILITY ===== */

.dropdown-mega .dropdown-menu {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    will-change: transform;
}

@media (max-width: 991px) {
    .dropdown-mega .dropdown-menu {
        max-height: 60vh;
    }
}

.dropdown-mega:hover .dropdown-menu {
    pointer-events: auto;
}
/* =========================
   FASE 3 - MOBILE UX LAYER
========================= */

/* ===== TOP BAR MOBILE FIX ===== */
@media (max-width: 480px) {
    .top-bar-promo {
        height: auto;
        padding: 6px 10px;
        font-size: 0.75rem;
        text-align: center;
    }
}

/* ===== NAVBAR MOBILE CLEAN ===== */
@media (max-width: 480px) {

    .navbar {
        padding: 8px 10px;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    /* ICONOS MÁS CÓMODOS */
    .navbar .fs-5,
    .navbar .fs-4 {
        font-size: 1.2rem !important;
    }
}

/* ===== OCULTAR HOVER EFECTS EN MOBILE ===== */
@media (max-width: 768px) {
    .product-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .splide__arrow {
        display: none !important;
    }
}

/* ===== OFFCANVAS FULL CLEAN ===== */
.offcanvas {
    z-index: 2000;
}

/* ===== SEARCH OVERLAY (NUEVO SISTEMA) ===== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.98);
    z-index: 3000;
}

/* INPUT CENTRADO UX */
.search-overlay input {
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1.1rem;
}

/* =========================
   FASE 3 - MOBILE UX FIX FINAL
========================= */

/* ===== HEADER MOBILE HEIGHT CONTROL ===== */
@media (max-width: 480px) {
    .navbar {
        min-height: 56px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .navbar-brand {
        font-size: 1rem;
        line-height: 1;
    }

    .navbar-toggler {
        border: none;
        padding: 4px 8px;
    }

    .navbar .nav-link {
        padding: 4px 6px;
    }
}

/* ===== ICON ALIGNMENT FIX ===== */
@media (max-width: 767px) {
    .navbar .d-flex {
        align-items: center;
    }

    .navbar .bi {
        line-height: 1;
    }
}

/* ===== TOUCH UX IMPROVEMENT ===== */
a, button {
    touch-action: manipulation;
}

/* ===== CATEGORY LIST MOBILE CLEAN (COLLAPSE) ===== */
@media (max-width: 767px) {
    #navbarCategorias .container {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    #navbarCategorias strong {
        display: block;
        margin-bottom: 6px;
        font-size: 0.9rem;
    }

    #navbarCategorias .nav-link {
        padding: 6px 0;
        font-size: 0.95rem;
    }
}

/* ===== PRODUCT GRID MOBILE POLISH ===== */
@media (max-width: 576px) {
    .product-title {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-card {
        border-radius: 10px;
    }
}

/* ===== SAFE SCROLL IMPROVEMENT ===== */
html {
    scroll-behavior: smooth;
}

/* =========================
   MEGA SEARCH (DESKTOP)
========================= */

/* CONTENEDOR GENERAL */
#searchMega {
    display: none;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1055;
}

/* INPUT */
#searchInput {
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #e5e5e5;
    box-shadow: none;
}

#searchInput:focus {
    border-color: #000;
    box-shadow: none;
}

/* BOTÓN LIMPIAR */
#clearSearch {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
}

#clearSearch:hover {
    color: #000;
}

/* RESULTADOS */
#searchResults {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 10px;
}

/* ITEM RESULTADO */
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.search-item:hover {
    background: #f5f5f5;
}

/* IMAGEN PRODUCTO */
.search-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

/* TEXTO */
.search-item .name {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.search-item .price {
    font-size: 0.85rem;
    font-weight: 600;
    color: #000;
}

/* SCROLL SUAVE */
#searchResults::-webkit-scrollbar {
    width: 6px;
}

#searchResults::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* =========================
   ANIMACIÓN SUAVE
========================= */

#searchMega.show {
    display: block;
    animation: fadeSlideDown 0.25s ease;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
main.container-fluid {
    background: #ebebeb;
    padding-top: 30px;
    padding-bottom: 40px;
}
/* PAGINACIÓN */
.pagination .page-link {
    color: #333;
    padding: 6px 12px;
    font-size: 0.9rem;

    background: #fff;
    border: 1px solid #e5e5e5; /* 🔥 borde suave */
    border-radius: 8px;
}

.pagination {
    display: flex;
    gap: 6px;
}

.pagination .page-item.active .page-link {
    background: #000;
    color: #fff;
    border-color: #000; /* 🔥 consistente */
}

.pagination .page-link:hover {
    background: #f5f5f5;
    border-color: #dcdcdc;
}
