/*=========================================================
CONTAINER
=========================================================*/

.container{
    max-width:1400px;
    margin:auto;
    padding:0 20px;
}

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

.header{
    width:100%;
    background:#fff;
    position:relative;
    z-index:100;
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
}

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

.header-top{
    width: 85%;
    padding:12px 0;
}

.header-top .container{
    display:flex;
    align-items:center;
    gap:18px;
}

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

.logo img{
    width:145px;
    display:block;
}

/*=========================================================
BOTON CATEGORIAS
=========================================================*/

.categories{
    position:relative;
}

.categories-btn{
    border: 1px solid #ddd !important;
    display:flex;
    align-items:center;
    gap:10px;
    padding:14px 22px;
    background:#f7f7f7;
    border-radius:14px;
    font-size:17px;
    font-weight:600;
    color:#b1812d;
    transition:.25s;
    cursor:pointer;
    font-family: 'BR Light', sans-serif;
}

.categories-btn:hover{
    background:#efefef;
}

.btn-icon{
    width:18px;
    height:18px;
    object-fit:contain;
}

/*=========================================================
MENU CATEGORIAS
=========================================================*/

.categories:hover .categories-menu{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}

.categories-menu{
    position:absolute;
    top:calc(100% + 12px);
    left:0;
    width:300px;
    background:#fff;
    border-radius:8px;
    box-shadow:0 12px 35px rgba(0,0,0,.12);
    overflow-y:auto;
    max-height:620px;
    opacity:0;
    visibility:hidden;
    transform:translateY(8px);
    transition:.25s;
    z-index:999;
}

.category-item{
    display:flex;
    align-items:center;
    gap:14px;
    height:50px;
    padding:0 18px;
    font-size:15px;
    color:#555;
    transition:.2s;
    text-decoration:none;
    font-family: 'BR Light', sans-serif;
}

.category-item:hover{
    background:#f7f7f7;
    color:#ff7a00;
}

.category-item span{
    flex:1;
}

.category-icon{
    width:20px;
    height:20px;
    object-fit:contain;
    flex-shrink:0;
}

.categories-menu::-webkit-scrollbar{
    width:7px;
}

.categories-menu::-webkit-scrollbar-thumb{
    background:#d5d5d5;
    border-radius:20px;
}

/*=========================================================
SEARCH
=========================================================*/

.search{
    flex:1;
    display:flex;
}

.search input{
    width:100%;
    height:50px;
    border:none;
    outline:none;
    background:#f5f5f5;
    border-radius:14px 0 0 14px;
    padding:0 20px;
    font-size:15px;
}

.search input::placeholder{
    color:#9d9d9d;
}

.search button{
    width:60px;
    background:#b1812d;
    border:none;
    border-radius:0 14px 14px 0;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

.search-icon{
    width:20px;
    height:20px;
    object-fit:contain;
}

/*=========================================================
ACCIONES
=========================================================*/

.header-actions{
    display:flex;
    align-items:center;
    gap:30px;
}

.header-actions a{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
}

.action-icon{
    width:28px;
    height:28px;
    object-fit:contain;
}

.cart-icon{
    width:34px;
    height:34px;
    object-fit:contain;
}

.header-actions small{
    display:block;
    font-size:12px;
    color:#666;
    line-height:1.1;
}

.header-actions span{
    display:block;
    font-size:15px;
    font-weight:700;
    line-height:1.1;
    color: #b1812d !important;
}

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

.header-bottom{
    width: 85%;
    border-top:1px solid #efefef;
    border-bottom:1px solid #efefef;
}

.header-bottom .container{
    height:56px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

/*=========================================================
DELIVERY
=========================================================*/

.delivery{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:15px;
    color:#444;
    text-decoration:none;
}

.delivery-icon{
    width:18px;
    height:18px;
}

/*=========================================================
NAV - ESTILOS PRINCIPALES
=========================================================*/

.header-bottom nav{
    display:flex;
    align-items:center;
}

.header-bottom nav > ul{
    display:flex;
    align-items:center;
    gap:26px;
    margin:0;
    padding:0;
    list-style:none;
}

.header-bottom nav > ul > li{
    position:relative;
    list-style:none;
}

.header-bottom nav a{
    display:flex;
    align-items:center;
    gap:5px;
    font-size:15px;
    font-weight:500;
    transition:.25s;
    text-decoration:none;
    color:#333;
    font-family: 'BR Light', sans-serif;
}

.header-bottom nav a:hover{
    color:#ff7a00;
}

.nav-arrow{
    width:10px;
    height:10px;
    object-fit:contain;
}

/*=========================================================
SUBMENU - ESTILOS PARA SUBMENUS
=========================================================*/

/* Submenu oculto por defecto */
.header-bottom nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    min-width: 220px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
    z-index: 1000;
}

/* Mostrar submenu al hacer hover */
.header-bottom nav > ul > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Items del submenu */
.header-bottom nav .sub-menu li {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.header-bottom nav .sub-menu li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 10px 16px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
    white-space: nowrap;
    font-family: 'BR Light', sans-serif;
}

.header-bottom nav .sub-menu li > a:hover {
    background: #f7f7f7;
    color: #ff7a00;
}

/* Submenus de segundo nivel */
.header-bottom nav .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    transform: translateX(5px) translateY(0);
}

.header-bottom nav .sub-menu li:hover > .sub-menu {
    transform: translateX(0) translateY(0);
}

/* Flecha para items con submenu (nivel 1) */
.header-bottom nav > ul > li.menu-item-has-children > a::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.header-bottom nav > ul > li.menu-item-has-children:hover > a::after {
    transform: rotate(225deg);
}

/* Flecha para submenus secundarios */
.header-bottom nav .sub-menu li.menu-item-has-children > a::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
}

/*=========================================================
RESPONSIVE
=========================================================*/

@media (max-width:1200px){

    .header-top .container{
        flex-wrap:wrap;
    }

    .search{
        width:100%;
        order:3;
    }

    .header-actions{
        margin-left:auto;
    }

    .header-bottom .container{
        flex-direction:column;
        justify-content:center;
        gap:18px;
        height:auto;
        padding:18px 0;
    }

    .header-bottom nav{
        width:100%;
        justify-content:center;
    }

    .header-bottom nav > ul{
        flex-wrap:wrap;
        justify-content:center;
        gap:18px;
    }

    .header-bottom nav .sub-menu {
        min-width: 200px;
    }
}

@media (max-width:768px){

    .categories-btn{
        display:none;
    }

    .header-actions{
        gap:16px;
    }

    .header-actions small,
    .header-actions span{
        display:none;
    }

    .logo img{
        width:120px;
    }

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

    .search button{
        width:50px;
    }

    .search-icon{
        width:18px;
        height:18px;
    }

    /* Responsive para submenus en móvil */
    .header-bottom nav {
        width: 100%;
    }

    .header-bottom nav > ul {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .header-bottom nav > ul > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }

    .header-bottom nav > ul > li:last-child {
        border-bottom: none;
    }

    .header-bottom nav > ul > li > a {
        justify-content: center;
        padding: 14px 10px;
        font-size: 15px;
        font-weight: 600;
        font-family: 'BR Light', sans-serif;
    }

    /* Submenu en móvil - estilo vertical */
    .header-bottom nav .sub-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        background: #f9f9f9;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        border-top: 1px solid #e8e8e8;
    }

    .header-bottom nav > ul > li:hover > .sub-menu {
        transform: none;
    }

    /* Mostrar submenu en móvil con clase active (necesita JS) */
    .header-bottom nav > ul > li.active > .sub-menu {
        display: block;
    }

    .header-bottom nav .sub-menu li {
        border-bottom: 1px solid #e8e8e8;
    }

    .header-bottom nav .sub-menu li:last-child {
        border-bottom: none;
    }

    .header-bottom nav .sub-menu li > a {
        justify-content: center;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
        white-space: normal;
        font-family: 'BR Light', sans-serif;
    }

    /* Submenus secundarios en móvil */
    .header-bottom nav .sub-menu .sub-menu {
        position: static;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        background: #f5f5f5;
        border-radius: 0;
    }

    .header-bottom nav .sub-menu .sub-menu li > a {
        padding-left: 30px;
        font-size: 13px;
        font-family: 'BR Light', sans-serif;
    }

    /* Quitar flechas en móvil */
    .header-bottom nav > ul > li.menu-item-has-children > a::after {
        display: none;
    }

    .header-bottom nav .sub-menu li.menu-item-has-children > a::after {
        display: none;
    }

    /* Indicador visual para items con submenu en móvil */
    .header-bottom nav > ul > li.menu-item-has-children > a {
        position: relative;
    }

    .header-bottom nav > ul > li.menu-item-has-children > a::before {
        content: "▼";
        position: absolute;
        right: 20px;
        font-size: 12px;
        color: #999;
        transition: transform .3s ease;
    }

    .header-bottom nav > ul > li.menu-item-has-children.active > a::before {
        transform: rotate(180deg);
    }

    /* Esconder delivery en móvil */
    .delivery {
        display: none;
    }
}

@media (max-width:480px){
    .logo img {
        width: 90px;
    }

    .search input {
        height: 38px;
        font-size: 13px;
        padding: 0 14px;
    }

    .search button {
        width: 44px;
    }

    .header-actions {
        gap: 12px;
    }

    .action-icon {
        width: 22px;
        height: 22px;
    }

    .cart-icon {
        width: 28px;
        height: 28px;
    }

    .header-bottom nav > ul > li > a {
        font-size: 14px;
        padding: 12px 8px;
        font-family: 'BR Light', sans-serif;
    }

    .header-bottom nav .sub-menu li > a {
        font-size: 13px;
        padding: 8px 12px;
        min-height: 38px;
        font-family: 'BR Light', sans-serif;
    }
}