/* =========================
   ESTILOS HEADER PROMOTE
   ========================= */

/* ========== FILAS GENERALES ========== */

.header-mobile-row {
    display: none;
    /* por defecto oculto, se muestra en mobile */
    align-items: center;
    width: 100%;
    gap: 0.4rem;
}

.header-desktop-row {
    width: 100%;
    display: flex;
    align-items: center;
}

/* Marcas para mostrar/ocultar por breakpoint */
.brand-mobile {}

.brand-desktop {}

.desktop-actions {}

/* ========== SEARCH (COMÚN) ========== */

.search-wrap {
    position: relative;
}

.search-input {
    width: 600px;
    padding: 10px;
}

.search-btn {
    position: absolute;
    right: 0px;
    top: 0;
    bottom: 0;
    color: #fff;
    width: fit-content;
    background-color: red;
    margin: 10px;
}

/* Resultados de búsqueda (dropdown) */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    z-index: 2000;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-height: 420px;
    overflow-y: auto;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    text-decoration: none;
    color: #212529;
    transition: background-color 0.12s ease;
}

.search-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.search-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 0.35rem;
    flex-shrink: 0;
}

.search-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.search-item-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.search-results-empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #6c757d;
}



/* ========== MEGA MENÚ FULL WIDTH ========== */
.dropwdown-menu {
    background-color: #212529;
}

.nav-link-header {
    color: #fff;
    font-weight: 200;
    margin: 0 10px 0 0;
    font-size: 13px;
}

.dropdown-mega {
    position: static;
}

/* permite ancho completo */
.dropdown-menu-mega {
    left: 0;
    right: 0;
    width: 100%;
    margin-top: 0;
    border-radius: 0;
    padding: 1.25rem 0;
    z-index: 99999;
}

/* ========== ANIMACIÓN SUAVE DEL MEGA DROPDOWN ========== */

/* Estado cerrado (sin .show) */
.dropdown-menu-mega {
    display: block;
    /* anulamos el display:none de Bootstrap */
    opacity: 0;
    transform: translateY(-10px);
    /* un poco más arriba */
    pointer-events: none;
    /* que no capture clics cuando está oculto */
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* Estado abierto (Bootstrap agrega .show) */
.dropdown.show>.dropdown-menu-mega,
.dropdown-menu-mega.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.icon-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .8rem 1rem;
    border-radius: .6rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
    font-weight: 600;
    transition:
        transform .08s ease,
        background-color .12s ease,
        box-shadow .12s ease;
    font-size: .75rem;
}

.icon-tile i {
    font-size: 1.25rem;
}

.icon-tile:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 .35rem .8rem rgba(0, 0, 0, .06);
}

.mega-footer {
    border-top: 1px solid rgba(0, 0, 0, .075);
    margin-top: 1rem;
    padding-top: 1rem;
}

.menu-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-img {
    z-index: 99;
    height: 60px;
    width: 60px;
    object-fit: contain;
}

.menu-img-circle {
    position: absolute;
    background-color: transparent;
    height: 50px;
    width: 50px;
    border-radius: 100%;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
}

.navbar-toggler-icon {
    background-color: red;
}

.header-button-cart,
.header-button-person {
    transition: .5s ease;
}

.header-button-cart:hover{
    color: green !important;
}

.header-button-person:hover{
    color: var(--primary) !important;
}

/* Desktop: integra mejor el mega menú y buscador */
@media (min-width: 992px) {
    nav.navbar {
        padding-bottom: 0 !important;
    }

    /* ancho máximo razonable para el buscador en desktop */
    .search-desktop-form {
        max-width: 750px;
    }

    /* en desktop ocultamos completamente la fila mobile */
    .header-mobile-row {
        display: none !important;
    }

    .brand-desktop {
        display: block;
    }
}


/* ========== MOBILE: mega menú y header ========== */

@media (max-width: 991.98px) {

    .search-desktop-form {
            width: 100% !important;
        }

    .dropdown-menu-mega {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        transform: none !important;
        border-radius: 0;
        overflow-y: auto;
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
        z-index: 1050;

    }

    .dropdown-menu-mega .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    nav.navbar {
        position: sticky;
        top: 0;
        z-index: 2000;
        background: #0b1630;
        /* tu darkblue */
    }

    /* Fila mobile: logo | barra | toggle | carrito */
    .header-mobile-row {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    .brand-mobile {
        flex-shrink: 0;
    }

    .header-mobile-search .search-wrap:focus-within {
        max-width: 100%;
        /* se expande suave cuando se enfoca */
    }

    .header-cart {
        display: none !important
    }

    .btn-cart-mobile {
        flex-shrink: 0;
        padding-inline: 0.45rem;
    }

    .btn-cart-mobile i {
        font-size: 1.2rem;
    }

    /* buscador general en mobile, que no rompa layout */
    .search-input {
        width: 300px;
        background-color: transparent;
    }
}