/* =========================================================
   HEADER
========================================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 59, 102, 0.22);
}

.navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    min-height: 85px;
    padding: 0 4%;
}

/* =========================================================
   LOGO
========================================================= */

.logo {
    display: flex;
    align-items: center;
    min-width: auto;
    text-decoration: none;
}

.logo img {
    display: block;
    width: auto;
    max-height: 70px;
}

/* =========================================================
   MENÚ PRINCIPAL
========================================================= */

.nav-links {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links > li {
    display: flex;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 22px;
    text-decoration: none;
    text-transform: uppercase;
    color: #003B66;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    transition: .3s;
}

.nav-links a:hover,
.dropdown:hover > a {
    background: #AC8F39;
    color: #003B66;
}

.nav-links i {
    font-size: 12px;
    margin-left: 5px;
}

/* =========================================================
   BOTÓN HAMBURGUESA
========================================================= */

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    font-size: 28px;
    color: #003B66;
    cursor: pointer;
    border: none;
    background: transparent;
}

/* =========================================================
   DROPDOWN - COMPUTADORA
========================================================= */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    background: #003B66;
    border-radius: 0 0 12px 12px;
    opacity: 0;
    visibility: hidden;
    transition: .3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    z-index: 9999;
    max-width: calc(100vw - 36px);
}

/* =========================================================
   MEGA MENÚ
========================================================= */

.mega-menu {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    width: min(520px, calc(100vw - 36px));
    min-width: 0;
    margin: 0;
    padding: 0;
}

.mega-menu li {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    box-sizing: border-box;
    background: #003B66;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

/* Separación entre columnas */
.mega-menu li:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, .12);
}

/* Enlaces de cada opción */
.mega-menu a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 70px;
    padding: 15px;
    box-sizing: border-box;
    text-align: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
    border: none;
    background: transparent;
    transition: .3s;
    position: relative;
}

/* CORRECCIÓN: DORADO EN TODA LA CELDA */
.mega-menu li:hover {
    background: #AC8F39;
}

.mega-menu li:hover > a,
.mega-menu a:hover {
    background: #AC8F39;
    color: #003B66;
}

/* Abrir con mouse en computadora */
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* =========================================================
   SUBMENÚ LATERAL
========================================================= */

.submenu {
    position: relative;
}

.submenu > a {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 54px 0 18px;
    text-align: center;
}

.submenu > a i {
    position: absolute;
    right: 18px;
    font-size: 18px;
    color: white;
}

.submenu-menu {
    position: absolute;
    top: 0;
    left: 100%;
    width: 300px;
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #003B66;
    opacity: 0;
    visibility: hidden;
    transition: .3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    z-index: 9999;
}

.submenu:hover .submenu-menu {
    opacity: 1;
    visibility: visible;
}

.submenu-menu li {
    display: flex;
}

.submenu-menu a {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    text-align: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, .08);
    transition: .3s;
}

.submenu-menu a:hover {
    background: #AC8F39;
    color: #003B66;
}

/* =========================================================
   BARRA DE ENTREGA
========================================================= */

.delivery-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 42px;
    min-height: 76px;
    padding: 14px 6%;
    background: #005b99;
    color: white;
}

.delivery-bar p {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 31px;
}

.delivery-bar strong {
    font-weight: 700;
}

/* =========================================================
   BUSCADOR
========================================================= */

.search-box {
    display: flex;
    width: min(420px, 38vw);
    height: 44px;
    background: white;
    box-shadow: inset 0 0 10px rgba(120, 0, 35, .18);
}

.search-box input {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    padding: 0 16px;
    color: #555;
    font-size: 16px;
}

.search-box button {
    width: 54px;
    border: none;
    background: white;
    color: #003B66;
    cursor: pointer;
    font-size: 17px;
}

.search-box button:hover {
    background: #005b99;
    color: white;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .navbar {
        min-height: 75px;
    }

    .logo {
        min-width: 220px;
    }

    .logo img {
        width: 180px;
        max-height: 65px;
    }

    .nav-links a {
        padding: 0 12px;
        font-size: 15px;
    }

    .mega-menu {
        min-width: 480px;
    }

    .delivery-bar {
        gap: 24px;
    }

    .delivery-bar p {
        font-size: 25px;
    }
}

/* =========================================================
   CELULAR / TABLET PEQUEÑA
========================================================= */

@media (max-width: 850px) {

    .navbar {
        min-height: 75px;
        padding: 10px 5%;
        align-items: center;
    }

    /* LOGO */
    .logo {
        min-width: auto;
    }

    .logo img {
        width: auto;
        max-width: 180px;
        max-height: 60px;
    }

    /* HAMBURGUESA */
    .menu-toggle {
        display: flex;
        width: 45px;
        height: 45px;
        color: #003B66;
    }

    /* MENÚ PRINCIPAL */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        margin: 0;
        padding: 0;
        background: white;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height .35s ease, opacity .25s ease;
        box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
    }

    /* MENÚ ABIERTO */
    .nav-links.menu-abierto {
        max-height: 80vh;
        opacity: 1;
        pointer-events: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* ELEMENTOS PRINCIPALES */
    .nav-links > li {
        width: 100%;
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
    }

    .nav-links > li > a {
        width: 100%;
        min-height: 55px;
        padding: 0 25px;
        box-sizing: border-box;
        justify-content: space-between;
        border-bottom: 1px solid #ddd;
        color: #003B66;
        font-size: 20px;
    }

    /* DROPDOWNS CELULAR */
    .dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        transform: none;
        display: none;
        opacity: 1;
        visibility: visible;
        background: #003B66;
        border-radius: 0;
        box-shadow: none;
    }

    .dropdown-menu.dropdown-abierto {
        display: flex;
        flex-direction: column;
    }

    /* PRODUCTOS DEL DROPDOWN */
    .mega-menu {
        width: 100%;
        min-width: 0;
        display: none;
        flex-direction: column;
        margin: 0;
        padding: 0;
    }

    .mega-menu li {
        width: 100%;
        border-right: none;
    }

    .mega-menu a {
        width: 100%;
        min-height: 55px;
        padding: 0 30px;
        justify-content: flex-start;
        text-align: left;
        box-sizing: border-box;
        font-size: 17px;
    }

    /* SUBMENÚ MOMENTOS ESPECIALES */
    .submenu {
        width: 100%;
    }

    .submenu-menu {
        position: static;
        width: 100%;
        display: none;
        background: #003B66;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
    }

    .submenu-menu.submenu-abierto {
        display: flex;
        flex-direction: column;
    }

    .submenu-menu a {
        width: 100%;
        height: 55px;
        padding: 0 45px;
        justify-content: flex-start;
        text-align: left;
        box-sizing: border-box;
        font-size: 16px;
    }

    /* BARRA DE ENTREGA */
    .delivery-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px 5%;
    }

    .delivery-bar p {
        font-size: 23px;
    }

    .search-box {
        width: min(100%, 430px);
    }
}

/* =========================================================
   CELULARES
========================================================= */

@media (max-width: 600px) {

    .navbar {
        min-height: 70px;
        padding: 8px 5%;
    }

    .logo img {
        max-width: 145px;
        max-height: 55px;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
        font-size: 25px;
    }

    .nav-links.menu-abierto {
        max-height: calc(100vh - 70px);
    }

    .nav-links > li > a {
        min-height: 54px;
        padding: 0 22px;
        font-size: 18px;
    }

    .mega-menu a {
        min-height: 52px;
        font-size: 16px;
    }

    .submenu-menu a {
        height: 52px;
        font-size: 15px;
    }

    .delivery-bar {
        min-height: auto;
        padding: 15px;
    }

    .delivery-bar p {
        font-size: 18px;
        line-height: 1.4;
    }

    .search-box {
        width: 100%;
        height: 42px;
    }

    .search-box input {
        font-size: 14px;
    }
}

/* =========================================================
   CELULARES MUY PEQUEÑOS
========================================================= */

@media (max-width: 400px) {

    .logo img {
        max-width: 125px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 23px;
    }

    .nav-links > li > a {
        font-size: 17px;
    }

    .delivery-bar p {
        font-size: 16px;
    }
}