/**
 * Header Styles — Shekinah Theme
 * Extraído de header.php para carga limpia en <head>
 */

.site-header {
    position: sticky;
    top: 0;
    z-index: 9000;
    background: #fff;
    border-bottom: 1px solid rgba(192, 159, 128, 0.15);
}

/* Barra superior */
.header-top {
    background: #F5E6E8;
    padding: 8px 0;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
}
.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-contact {
    display: flex;
    gap: 20px;
    color: #5D4C4A;
}
.header-contact a { color: #5D4C4A; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.header-contact a:hover { color: #C09F80; }
.header-contact i { color: #C09F80; }
.header-social { display: flex; gap: 12px; }
.header-social a {
    color: #5D4C4A; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: all 0.3s;
}
.header-social a:hover { color: #C09F80; background: rgba(192,159,128,0.1); }

/* Header principal */
.header-main {
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 20px;
}

/* Logo */
.site-branding { flex-shrink: 0; }
.site-name-text {
    font-family: 'Playfair Display', serif;
    font-size: 22px; font-weight: 700;
    color: #3D2C2A; letter-spacing: 1px;
    text-decoration: none; display: block;
}
.custom-logo { display: block; max-width: 140px; height: auto; }

/* Nav desktop */
.main-navigation {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.main-navigation #primary-menu,
.main-navigation > ul {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0; padding: 0;
}
.main-navigation a {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: #3D2C2A; padding: 6px 0;
    text-decoration: none; position: relative;
    display: block; transition: color 0.3s;
}
.main-navigation a::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 0; height: 2px; background: #C09F80; transition: width 0.3s;
}
.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after { width: 100%; }
.main-navigation a:hover, .main-navigation .current-menu-item > a { color: #C09F80; }

/* Sub-menu */
.main-navigation .sub-menu {
    position: absolute; top: 100%; left: 0;
    background: #fff; min-width: 220px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-top: 3px solid #C09F80;
    border-radius: 0 0 10px 10px;
    opacity: 0; visibility: hidden;
    transform: translateY(8px); transition: all 0.25s;
    z-index: 100; list-style: none; margin: 0; padding: 8px 0;
}
.main-navigation li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.main-navigation .sub-menu a {
    display: block; padding: 10px 20px;
    font-size: 13px; text-transform: none; letter-spacing: 0;
    font-weight: 500; color: #3D2C2A;
}
.main-navigation .sub-menu a::after { display: none; }
.main-navigation .sub-menu a:hover { color: #C09F80; background: #F5E6E8; }

/* Botón cerrar dentro del nav (solo móvil) */
.nav-close-btn {
    display: none;
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: #3D2C2A; padding: 8px;
    position: absolute; top: 16px; right: 16px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.header-actions button,
.header-actions a {
    background: none;
    border: none;
    color: #3D2C2A !important;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    border-radius: 50%;
}
.header-actions svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke-width: 2px;
}
.header-actions button:hover, 
.header-actions a:hover { 
    color: #C09F80 !important;
    background: rgba(192, 159, 128, 0.1);
    transform: translateY(-2px);
}

/* POS badge */
.account-badge {
    position: absolute; bottom: -4px; right: -6px;
    background: #C09F80; color: #fff; font-size: 9px;
    padding: 2px 5px; border-radius: 4px; font-weight: 700; line-height: 1;
}
.pos-link { color: #C09F80; }

/* Carrito */
.cart-link { position: relative; }
.cart-count {
    position: absolute; top: -5px; right: -8px;
    background: #C09F80; color: #fff;
    font-size: 10px; font-weight: 700;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 2px solid #fff;
    transition: transform 0.3s;
}
.cart-count.updated { transform: scale(1.3); }

/* Búsqueda */
.search-overlay {
    position: fixed; inset: 0;
    background: rgba(30,20,20,0.85);
    z-index: 9100; display: none;
    align-items: center; justify-content: center;
}
.search-overlay.active { display: flex; }
.search-container {
    position: relative;
    width: min(600px, calc(100% - 40px));
}
.search-form {
    display: flex; align-items: center;
    background: transparent;
    border-bottom: 2px solid rgba(255,255,255,0.4);
    padding-bottom: 10px;
}
.search-field {
    width: 100%; background: none; border: none;
    color: #fff; font-size: 18px; padding: 10px 0; outline: none;
    font-family: 'Montserrat', sans-serif;
}
.search-field::placeholder { color: rgba(255,255,255,0.5); }
.search-submit {
    background: none; border: none; color: #C09F80; cursor: pointer; padding: 8px;
}
.search-close {
    position: absolute; top: -60px; right: 0;
    background: none; border: none; color: rgba(255,255,255,0.7);
    cursor: pointer; padding: 8px; transition: color 0.3s;
}
.search-close:hover { color: #C09F80; }

/* Overlay móvil */
.mobile-menu-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); z-index: 8999;
    opacity: 0; transition: opacity 0.3s;
}
.mobile-menu-overlay.active { display: block; opacity: 1; }

/* Hamburguesa */
.menu-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: 8px; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 5px; z-index: 1001; order: -1;
}
.hamburger {
    display: block; width: 24px; height: 2px;
    background: #3D2C2A; position: relative;
    transition: all 0.3s; border-radius: 2px;
}
.hamburger::before, .hamburger::after {
    content: ''; position: absolute;
    width: 24px; height: 2px;
    background: #3D2C2A; left: 0;
    transition: all 0.3s; border-radius: 2px;
}
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }
.menu-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.menu-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg); top: 0; }
.menu-toggle[aria-expanded="true"] .hamburger::after { transform: rotate(-45deg); top: 0; }

/* Estilos especiales para el rótulo POS de administrador */
.account-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pos-label-small {
    background: #C09F80;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    position: absolute;
    bottom: -5px;
    right: -8px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-family: 'Montserrat', sans-serif;
}
.account-link:hover .pos-label-small {
    background: #3D2C2A;
    transform: scale(1.1);
}

/* ============================================================
   RESPONSIVE — MÓVIL
   ============================================================ */
@media (max-width: 960px) {
    .header-top { display: none; }
    .menu-toggle { display: flex; }
    .nav-close-btn { display: flex; }

    .main-navigation {
        position: fixed;
        top: 0; right: -100%;
        width: min(85vw, 340px);
        height: 100dvh;
        background: #fff;
        z-index: 9500;
        padding: 70px 24px 24px;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 30px rgba(0,0,0,0.15);
        overflow-y: auto;
        overflow-x: hidden;
    }
    .main-navigation.active { right: 0; }

    .main-navigation #primary-menu,
    .main-navigation > ul {
        flex-direction: column;
        gap: 0; width: 100%;
    }
    .main-navigation li {
        border-bottom: 1px solid rgba(192, 159, 128, 0.15);
        width: 100%;
    }
    .main-navigation a {
        display: block; padding: 14px 0;
        font-size: 14px; letter-spacing: 0.5px;
    }
    .main-navigation a::after { display: none; }
    .main-navigation .sub-menu {
        position: static; opacity: 1; visibility: visible;
        transform: none; box-shadow: none; border-top: none; border-radius: 0;
        background: #F5E6E8; padding: 4px 0 4px 16px;
        display: none; min-width: auto;
    }
    .main-navigation li.submenu-open > .sub-menu { display: block; }
    .main-navigation .sub-menu a { padding: 10px 0; color: #5D4C4A; font-size: 13px; }
    .main-navigation li.menu-item-has-children > a {
        display: flex; justify-content: space-between; align-items: center;
    }
    .main-navigation li.menu-item-has-children > a::after {
        content: '+'; display: block; font-size: 18px;
        color: #C09F80; font-weight: 300; line-height: 1;
        transition: transform 0.3s;
    }
    .main-navigation li.menu-item-has-children.submenu-open > a::after {
        transform: rotate(45deg);
    }
}

@media (max-width: 480px) {
    .header-inner { padding: 10px 0; gap: 10px; }
    .header-actions { gap: 6px; }
    .site-branding img { max-width: 140px !important; }
    .header-actions a, .header-actions button { padding: 5px; }
    .header-actions svg { width: 18px; height: 18px; }
    .pos-label-small { bottom: -2px; right: -2px; font-size: 8px; padding: 1px 3px; }
}