.main-navbar {
    background: white;
    height: 55px;
    /* min-height: var(--nav-height); */
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: var(--top-bar-height);
    width: 100%;
    z-index: 1030;
}



@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        justify-content: center;
        flex-basis: auto;
    }

    .navbar-nav {
        margin-left: 0 !important;
        display: flex;
        gap: 1.5rem;

    }

    .navbar-brand-container,
    .navbar-actions-container {
        flex: 1;
        display: flex;
        align-items: center;
    }

    .navbar-actions-container {
        justify-content: flex-end;
    }

    .fa-shopping-cart {
        font-size: 22px;
    }
}

@media (min-width: 1920px) {
    .navbar-collapse {

        justify-content: end;

    }
}

.logo-mobile {
    display: none;
}

/* Cuando la pantalla sea 1366px o menor */
@media (max-width: 1366px) {
    .logo-desktop {
        display: none;
    }

    .logo-mobile {
        display: block;
    }
}

@media(min-width:1920px) {
    .navbar-nav {
        margin-right: 25%;
    }
}

/* .navbar-nav {
            margin-left: 40%;
        } */

.navbar-brand {
    font-size: 1.25rem;
    white-space: nowrap;
}

.nav-link {
    font-weight: normal !important;
    font-family: var(--Bold);
}

/* --- MEGA MENU (Desktop Only) --- */
@media (min-width: 992px) {
    .has-megamenu {
        position: static !important;
    }

    .megamenu {
        width: 100%;
        left: 0;
        right: 0;
        padding: 2.5rem;
        border: none;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
        display: none;
        opacity: 0;
        transform: translateY(10px);
        transition: all 0.3s ease;
    }

    .has-megamenu:hover .megamenu {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
}

.megamenu-title {
    font-size: 0.85rem;
    font-family: var(--Bold);
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.megamenu-list {
    list-style: none;
    padding: 0;
}

.megamenu-item a {
    font-family: var(--Regular);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    transition: 0.2s;
}

.megamenu-item a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.megamenu-item i {
    width: 25px;
    color: var(--text-muted);
}

/* Buscador en tiempo real */
/* --- Real-Time Search --- */
.link-category {
    font-family: var(--Medium);
}

.search-wrapper {
    position: relative;
    width: 200px;
}

.search-input {
    border-radius: 50px;
    padding-left: 2.5rem;
    font-size: 0.9rem;
    transition: 0.3s;
    border: 1px solid var(--border-color);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(22, 167, 141, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 110%;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1100;
}

.search-results.active {
    display: block;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.result-item:hover {
    background: #f8fafc;
}

.result-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.result-info h6 {
    font-size: 0.85rem;
    margin-bottom: 2px;
    line-height: 1.2;
}

.result-info span {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
}

.btn-whatsapp-nav {
    background-color: var(--whatsapp-green);
    color: var(--text-main) !important;
    border-radius: 50px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--Medium);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    animation-name: pulse;
    animation-duration: 1.5s;
    animation-timing-function: ease-out;
    animation-iteration-count: infinite;

}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }

    80% {
        box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
    }
}

.btn-whatsapp-nav:hover {
    background-color: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    color: white !important;
}

@media (min-width: 1920px) {
    .btn-whatsapp-nav {
        margin-right: 3rem;
    }
}


@media (max-width: 991px) {
    .desktop-sidebar {
        display: none;
    }

    .main-navbar {
        height: auto;
        padding: 0.5rem 0;
    }

    body {
        padding-top: 70px;
    }
}

.offcanvas-body .megamenu-title {
    margin-top: 1.5rem;
}

/* --- Footer Styling --- */

@media (max-width: 991px) {
    .sidebar-wrapper {
        display: none;
    }

    .main-content,
    footer {
        margin-left: 0;
    }

    .search-wrapper {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .search-wrapper {
        display: none !important;
    }

    .btn-whatsapp-nav span {
        display: none;
    }
}

/* Ajustes móviles */
@media (max-width: 768px) {
    .main-navbar {
        top: 0;
    }
}