/*
/assets/css/header.css
*/

/* ========================================
    TOP BAR CON MOVIMIENTO INFINITO
======================================== */
.top-bar {
    width: 100%;
    background: #17171a;
    color: #fff;
    font-size: 1rem;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    letter-spacing: 0.01em;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.top-bar-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: scroll-left 20s linear infinite;
    padding: 0.3em 0;
}

.top-bar-content span {
    padding-right: 100px; /* Espacio entre repeticiones */
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ========================================
   HEADER PRINCIPAL (Middle Bar)
======================================== */
:root {
    --header-bg: #fff;
    --header-shadow: 0 2px 10px rgba(0,0,0,0.06);
    --primary-color: #242021;
    --highlight: #ffcc80;
    --main-green: #676f56;
    --main-green-light: #A3A576;
    --menu-bg: #fffaf2;
    --menu-bg-light: #ffe7bc;
    --category-active: #fff;
    --category-hover: #ffedc2;
    --mega-border: #eee5d7;
    --font-main: 'Montserrat', Arial, Helvetica, sans-serif;
}

body {
    font-family: var(--font-main);
    background: #fff;
    color: var(--primary-color);
    margin: 0;
    overflow-x: hidden;
}

/* Header full width, but content centered */
.header {
    background-color: var(--header-bg);
    box-shadow: var(--header-shadow);
    width: 100%;
    z-index: 1200;
    padding: 0;
    box-sizing: border-box;
}

.header-middle {
    width: 100%;
    background: #fff;
    border-bottom: 1.5px solid #f4eeea;
    box-sizing: border-box;
}

.header-middle-content {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 0 2rem;
    height: 80px;
    gap: 2rem;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    font-size: 2rem;
    font-weight: bold;
    color: var(--main-green);
    min-width: 100px;
    height: 100%;
}

.logo-image {
    height: 100%;
    width: auto;
    margin: 0;
    display: block;
    object-fit: contain;
    object-position: center;
    background: transparent;
    padding: 0;
    border: 0;
}

.logo-icon {
    width: 80px;
    height: 100%;
    margin-right: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%23676f56" stroke-width="3"/><g fill="none" stroke="%23676f56" stroke-width="2"><circle cx="50" cy="50" r="20"/><circle cx="50" cy="30" r="8"/><circle cx="35" cy="42" r="8"/><circle cx="65" cy="42" r="8"/><circle cx="35" cy="58" r="8"/><circle cx="65" cy="58" r="8"/><circle cx="50" cy="70" r="8"/></g></svg>') center/contain no-repeat;
}

/* Search Bar */
.header-search {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 700px;
    margin: 0 2.5rem;
}
.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    background: #fff;
    border: 1.5px solid #bbb3ae;
    border-radius: 6px;
    overflow: hidden;
    height: 42px;
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.03rem;
    padding: 0 1.1em;
    height: 100%;
    background: #fff;
    color: #333;
    font-family: inherit;
}
.search-btn {
    background: none;
    border: none;
    width: 45px;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-btn .search-icon {
    font-size: 1.25rem;
    color: #494b3a;
}

/* Mobile Search Button */
.mobile-search-btn {
    display: none;
    background: none;
    border: none;
    color: #494b3a;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 45px;
    height: 42px;
    align-items: center;
    justify-content: center;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.9);
    z-index: 2000;
    padding: 2rem;
}

.mobile-search-overlay.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mobile-search-content {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.mobile-search-form {
    display: flex;
    background-color: #fff;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1.5px solid #bbb3ae;
}

.mobile-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 0.5rem;
    font-family: var(--font-main);
    color: #333;
}

.mobile-search-submit {
    background: none;
    border: none;
    color: #494b3a;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-search-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

/* Header Actions (icons cuenta/carrito) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
    min-width: 200px;
    justify-content: flex-end;
    height: 100%;
}

.header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    min-width: 60px;
    color: #242021;
    font-size: 0.96rem;
    cursor: pointer;
    justify-content: center;
    height: 100%;
}

.header-action-icon {
    width: 32px;
    height: 32px;
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ede9e3;
    border-radius: 50%;
    margin-bottom: 0.1em;
}

.header-action-label {
    font-size: 0.98rem;
    color: #313130;
    letter-spacing: 0.01em;
}

/* ========================================
   NAVIGATION + MEGA MENU (Bottom Bar)
======================================== */
.header-content {
    width: 100%;
    background: #15111b;
    min-height: 50px;
    display: flex;
    align-items: center;
    position: relative;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: visible !important;
}

.header-content > .nav-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    box-sizing: border-box;
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--main-green);
    margin-right: 1.5rem;
    cursor: pointer;
    padding: 20px 10px;
}

.nav-container {
    flex: 1 1 auto;
    position: relative;
}

.main-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2.6rem;
}

.menu-item > a {
    font-size: 1.11rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    padding: 1.13rem 0.5rem;
    position: relative;
    letter-spacing: 0.01em;
}
.menu-item > a .emoji {
    margin-left: 0.23em;
}

.menu-item > a:hover, .menu-item.current-menu-item > a {
    color: #ffdfa8;
}

.menu-item .icon-chevron {
    font-size: 1.1rem;
    margin-left: 7px;
    margin-top: 2px;
}

.menu-item.has-mega-menu {
    position: relative;
}

/* Mega Menu - SIEMPRE alineado y ancho completo */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    width: 1320px;
    max-width: 98vw;
    min-width: 1100px;
    background: var(--menu-bg);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 14px 48px 0 rgba(80,54,27,0.09);
    padding: 0;
    border-top: 1.5px solid var(--mega-border);
    z-index: 200;
    min-height: 420px;
    transition: box-shadow 0.3s;
    box-sizing: border-box;
    margin: 0 auto;
    overflow-x: auto !important;
    overflow-y: visible !important;
    opacity: 1 !important;
}

.has-mega-menu.show-mega .mega-menu {
    display: flex;
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(12px);}
    to { opacity: 1; transform: translateY(0);}
}

.mega-menu-categories {
    width: 215px;
    background: var(--menu-bg-light);
    border-right: 1.5px solid var(--mega-border);
    padding: 30px 0 30px 10px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-sizing: border-box;
}

.mega-menu-categories ul {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mega-menu-categories ul li {
    font-size: 1.08rem;
    font-weight: 600;
    color: #49392f;
    background: none;
    border: none;
    padding: 0.6rem 1.3rem 0.6rem 1.1rem;
    text-align: left;
    border-radius: 7px 0 0 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.16s, color 0.13s;
    gap: 0.8rem;
}

.mega-menu-categories ul li.active,
.mega-menu-categories ul li:hover {
    background: var(--category-hover);
    color: var(--main-green);
}

.mega-menu-content {
    display: flex;
    flex: 1 1 auto;
    padding: 30px 30px 30px 45px;
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
    background: var(--menu-bg); /* Opaco */
}

.mega-tab-content {
    display: none;
    width: 100%;
    gap: 2.5rem;
    flex-wrap: wrap;
    min-width: 0;
    animation: fadeTab .23s;
}

.mega-tab-content.active {
    display: flex;
}

@keyframes fadeTab {
    from { opacity: 0;}
    to { opacity: 1;}
}

.mega-column {
    min-width: 165px;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-right: 1vw;
    font-size: 1rem;
    padding-bottom: 8px;
    box-sizing: border-box;
    background: none;
}

.mega-column strong {
    font-size: 1.03rem;
    font-weight: 700;
    color: #42301d;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 7px;
}

.mega-column a {
    color: #4d3e2d;
    font-size: 0.98rem;
    text-decoration: none;
    padding: 4px 0 4px 0.8rem;
    border-radius: 4px;
    transition: background 0.12s, color 0.12s;
    display: block;
    margin-left: 2px;
    position: relative;
}

.mega-column a:hover {
    color: var(--main-green);
    background: #fff5df;
}

.mega-menu-content::-webkit-scrollbar {
    height: 6px;
    background: #ffe7bc;
    border-radius: 7px;
}
.mega-menu-content::-webkit-scrollbar-thumb {
    background: #ffe7bc;
    border-radius: 7px;
}

.mega-menu-content {
    scrollbar-color: #ffe7bc #fff7e1;
    scrollbar-width: thin;
}

/* ========================================
   RESPONSIVE STYLES
======================================== */
@media (max-width: 1500px) {
    .mega-menu {
        width: 98vw;
        max-width: 98vw;
        min-width: 0;
    }
}

@media (max-width: 1350px) {
    .header-middle-content,
    .header-content > .nav-container {
        max-width: 98vw;
        min-width: 0;
    }
    .mega-menu {
        width: 98vw;
        max-width: 98vw;
        min-width: 0;
    }
}

@media (max-width: 1050px) {
    .mega-menu {
        padding: 0;
        min-width: 0;
        width: 100vw;
        max-width: 100vw;
        left: 0;
        transform: none;
    }
    .mega-menu-categories {
        min-width: 145px;
        padding-left: 3px;
        font-size: 0.98rem;
    }
    .mega-menu-content {
        padding: 16px 8px 16px 8px;
    }
    .mega-column {
        min-width: 130px;
    }
    .header-middle-content,
    .header-content > .nav-container {
        padding: 0 1rem;
    }
}

@media (max-width: 900px) {
    .header-middle-content,
    .header-content > .nav-container {
        padding: 0 0.2rem;
    }
    .mega-menu {
        min-width: 0;
        width: 100vw;
        max-width: 100vw;
    }
    .main-menu {
        gap: 1.1rem;
    }
    .mega-menu-content {
        padding: 8px 1vw;
    }
    .mega-column {
        font-size: 0.96rem;
        min-width: 120px;
    }
    .header-actions {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-middle-content {
        flex-wrap: wrap;
        padding: 0 0.5rem;
        height: auto;
        gap: 0.8rem;
    }
    .header-middle {
        min-height: 70px;
    }
    .header {
        height: auto;
        min-height: 64px;
    }
    .mobile-menu-toggle {
        display: block;
        order: 2;
        margin-right: 0.3rem;
        font-size: 2rem;
    }
    .header-search {
        margin: 0 0.2rem;
        max-width: 400px;
    }
    
    /* Hide desktop search, show mobile search button */
    .search-form {
        display: none;
    }
    
    .mobile-search-btn {
        display: flex;
    }
    
    .header-actions {
        gap: 0.5rem;
        min-width: 120px;
    }
    .header-content {
        flex-wrap: wrap;
        min-height: 54px;
    }
    .header-content > .nav-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100vw;
        background-color: var(--menu-bg);
        box-shadow: 0 5px 15px rgba(0,0,0,0.09);
        z-index: 1100;
        margin: 0;
        border-radius: 0 0 12px 12px;
        animation: fadeInMenu 0.23s;
    }
    .header-content > .nav-container.active {
        display: block;
    }
    .main-menu {
        flex-direction: column;
        gap: 0.2rem;
        align-items: stretch;
        width: 100%;
        margin: 0;
    }
    .menu-item {
        width: 100%;
    }
    .menu-item > a {
        font-size: 1.1rem;
        padding: 1.13rem 1.3rem;
        justify-content: flex-start;
    }
    .has-mega-menu .icon-chevron {
        float: right;
        margin-left: auto;
    }
    .has-mega-menu .mega-menu {
        position: static;
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        border-radius: 0 0 14px 14px;
        box-shadow: none;
        padding: 0;
        animation: fadeInMenu 0.14s;
        left: 0;
        transform: none;
    }
    .mega-menu-categories {
        min-width: 110px;
        width: 100vw;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--mega-border);
        overflow-x: auto;
        gap: 0.1rem;
        padding: 0.3rem 0.2rem 0.3rem 0.1rem;
    }
    .mega-menu-categories ul {
        flex-direction: row;
        gap: 0.1rem;
    }
    .mega-menu-categories ul li {
        border-radius: 8px 8px 0 0;
        padding: 0.56rem 1.2rem 0.56rem 0.9rem;
        font-size: 1.02rem;
        min-width: 98px;
    }
    .mega-menu-content {
        flex-direction: column;
        padding: 0.5rem 0.5rem 1.3rem 0.5rem;
    }
    .mega-tab-content {
        flex-direction: column;
        gap: 0.8rem;
    }
    .mega-column {
        min-width: 0;
        font-size: 0.97rem;
        margin-bottom: 0.8rem;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .header-middle-content,
    .header-content > .nav-container {
        padding: 0 0.03rem;
    }
    .mega-menu {
        padding: 0 1vw;
    }
    .logo-image, .logo-icon {
        height: 70px !important;
        width: auto !important;
        margin-right: 7px;
    }
    .main-menu {
        gap: 0;
    }
    .menu-item > a {
        font-size: 0.97rem;
        padding: 0.95rem 1.2rem;
    }
    .mega-menu-categories ul li {
        font-size: 0.96rem;
        padding: 0.38rem 0.7rem 0.38rem 0.8rem;
        min-width: 76px;
    }
    .mega-column strong {
        font-size: 0.95rem;
    }
    .mega-column a {
        font-size: 0.95rem;
        padding: 4px 0 4px 0.5rem;
    }
    .header-action-label {
        font-size: 0.91rem;
    }
}