/* ============================================================
   Header — Sacred Luxury Theme (Maroon / Gold / Cream)
   Topbar, Header Main, Search, Icons, Nav, Mobile
   ============================================================ */

/* --- Top bar --- */
.topbar {
    background: linear-gradient(90deg, #3E0C16, var(--spv-sacred-deep, #4A121E), #3E0C16);
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.topbar a {
    color: var(--spv-sacred-gold, #D4AF37);
    font-weight: 600;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(253, 251, 247, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 22px rgba(74, 18, 30, 0.08);
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.18);
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 24px;
}

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo .mark {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, var(--spv-sacred-gold-light, #FBF4DE) 60%, var(--spv-sacred-gold, #D4AF37));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--spv-sacred-gold, #D4AF37);
    flex: none;
    overflow: hidden;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.logo .mark img,
.logo .spv-brand-img {
    height: 48px !important;
    max-height: 48px !important;
    width: auto !important;
    max-width: 190px !important;
    object-fit: contain !important;
    border-radius: 8px;
    transition: transform 0.25s ease;
}

.logo:hover .spv-brand-img {
    transform: scale(1.03);
}

.logo-text {
    font-family: var(--spv-ff-head);
    line-height: 1.05;
}

.logo-text b {
    display: block;
    font-size: 1.18rem;
    color: var(--spv-sacred-deep, #4A121E);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.logo-text span {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    color: var(--spv-sacred-gold-hover, #B8860B);
    font-weight: 600;
}

/* --- Search bar --- */
.search-bar {
    flex: 1;
    max-width: 440px;
    display: flex;
    align-items: center;
    border: 1.5px solid rgba(212, 175, 55, 0.2);
    border-radius: 30px;
    padding: 9px 8px 9px 18px;
    background: rgba(253, 251, 247, 0.8);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar:focus-within {
    border-color: var(--spv-sacred-gold, #D4AF37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.search-bar input[type="search"] {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--spv-ink, #2B1B10);
    -webkit-appearance: none;
}

.search-bar input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search-bar button {
    background: linear-gradient(135deg, var(--spv-sacred-maroon, #6B1D2F), var(--spv-sacred-deep, #4A121E));
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.search-bar button:hover {
    background: linear-gradient(135deg, var(--spv-sacred-gold, #D4AF37), var(--spv-sacred-gold-hover, #B8860B));
    transform: scale(1.05);
}

/* --- Header icons --- */
.header-icons {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 0.8rem;
    color: var(--spv-ink-soft, #6E5C50);
    font-weight: 500;
}

.header-icons .icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    text-decoration: none;
    color: var(--spv-ink, #2B1B10);
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-icons .icon-item:hover {
    color: var(--spv-sacred-maroon, #6B1D2F);
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}

.header-icons svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.header-icons .icon-item:hover svg {
    transform: scale(1.08);
}

.cart-count {
    position: absolute;
    top: -3px;
    right: 2px;
    background: linear-gradient(135deg, var(--spv-sacred-maroon, #6B1D2F), var(--spv-sacred-deep, #4A121E));
    color: #fff;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1.5px solid #fff;
    box-shadow: 0 2px 6px rgba(107, 29, 47, 0.35);
}

/* --- Burger --- */
.burger {
    display: none;
    background: none;
    border: none;
    padding: 4px;
}

.burger svg {
    width: 26px;
    height: 26px;
    color: var(--spv-sacred-maroon, #6B1D2F);
}

/* --- Main Nav --- */
nav.mainnav {
    background: var(--spv-cream-bg, #FDFBF7);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-list {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: wrap;
}

.nav-list > li {
    position: relative;
}

.nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 13px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--spv-ink, #2B1B10);
    letter-spacing: 0.02em;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.nav-list > li > a:hover,
.nav-list > li.active > a,
.nav-list > li.current-menu-item > a,
.nav-list > li.current-menu-parent > a {
    background: linear-gradient(135deg, var(--spv-sacred-maroon, #6B1D2F), var(--spv-sacred-deep, #4A121E));
    color: #fff;
}

.nav-list > li > a svg {
    width: 12px;
    height: 12px;
    transition: transform 0.15s;
}

.nav-list > li:hover > a svg {
    transform: rotate(180deg);
}

/* --- Dropdown --- */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 8px 24px rgba(107, 29, 47, 0.08);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 50;
    list-style: none;
    margin: 0;
}

.nav-list > li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    font-size: 0.82rem;
    color: var(--spv-ink-soft, #6E5C50);
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
}

.dropdown li a:hover {
    background: var(--spv-sacred-gold-light, #FBF4DE);
    color: var(--spv-sacred-maroon, #6B1D2F);
    padding-left: 22px;
}

/* --- Nav Scrim --- */
.nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(74, 18, 30, 0.4);
    z-index: 80;
}

.nav-scrim.show {
    display: block;
}

/* --- Back to top --- */
.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--spv-sacred-maroon, #6B1D2F), var(--spv-sacred-deep, #4A121E));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(107, 29, 47, 0.2);
    border: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 70;
}

.back-top.show {
    opacity: 1;
    pointer-events: auto;
}

.back-top:hover {
    background: linear-gradient(135deg, var(--spv-sacred-gold, #D4AF37), var(--spv-sacred-gold-hover, #B8860B));
}

.back-top svg {
    width: 18px;
    height: 18px;
}

/* ============================================================
   Responsive — Header
   ============================================================ */

/* Mobile drawer elements default hidden on desktop */
.spv-mobile-drawer-header,
.spv-mobile-search-wrap,
.spv-mobile-drawer-footer {
    display: none;
}

@media (max-width: 860px) {
    .search-bar {
        display: none;
    }

    .burger {
        display: block;
    }

    nav.mainnav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 84%;
        max-width: 340px;
        background: #FFFBF5;
        transform: translateX(105%);
        transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
        z-index: 100200;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: -10px 0 36px rgba(74, 18, 30, 0.25);
        border: none;
        display: flex;
        flex-direction: column;
    }

    nav.mainnav.open {
        transform: translateX(0);
    }

    /* Mobile Drawer Header */
    .spv-mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        background: linear-gradient(135deg, var(--spv-sacred-maroon, #6B1D2F) 0%, var(--spv-sacred-deep, #4A121E) 100%);
        border-bottom: 2px solid var(--spv-sacred-gold, #D4AF37);
        flex-shrink: 0;
    }

    .spv-md-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .spv-md-logo-img {
        height: 38px;
        width: auto;
        max-width: 110px;
        object-fit: contain;
        background: #fff;
        padding: 2px 4px;
        border-radius: 6px;
    }

    .spv-md-title-wrap {
        display: flex;
        flex-direction: column;
        line-height: 1.15;
    }

    .spv-md-title {
        font-family: var(--spv-ff-head);
        font-size: 0.86rem;
        font-weight: 700;
        color: #fff;
        letter-spacing: 0.04em;
    }

    .spv-md-tagline {
        font-size: 0.65rem;
        color: var(--spv-sacred-gold, #D4AF37);
        font-weight: 600;
        letter-spacing: 0.08em;
    }

    .spv-mobile-drawer-close {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        border: 1px solid rgba(212, 175, 55, 0.35);
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 0;
    }

    .spv-mobile-drawer-close:hover {
        background: rgba(212, 175, 55, 0.2);
        transform: rotate(90deg);
    }

    /* Mobile Search Wrap */
    .spv-mobile-search-wrap {
        display: block;
        padding: 14px 20px 8px;
        background: #F8F3EA;
        border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    }

    .spv-mobile-search-wrap .search-bar {
        display: flex;
        max-width: 100%;
    }

    .spv-mobile-search-wrap .search-bar input {
        border-radius: 8px 0 0 8px;
        border: 1px solid rgba(212, 175, 55, 0.3);
        padding: 9px 12px;
        font-size: 0.82rem;
        background: #fff;
    }

    .spv-mobile-search-wrap .search-bar button {
        border-radius: 0 8px 8px 0;
        padding: 9px 14px;
        background: var(--spv-sacred-maroon, #6B1D2F);
        color: #fff;
        border: 1px solid var(--spv-sacred-maroon, #6B1D2F);
    }

    /* Mobile Navigation List */
    .spv-mobile-nav-inner {
        flex: 1;
        overflow-y: auto;
        padding: 6px 0;
    }

    .nav-list {
        flex-direction: column;
        padding: 0;
    }

    .nav-list > li {
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    }

    .nav-list > li > a {
        padding: 13px 22px;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--spv-ink, #2B1B10);
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: background 0.2s, color 0.2s;
    }

    .nav-list > li.active > a,
    .nav-list > li > a:hover {
        background: rgba(212, 175, 55, 0.1);
        color: var(--spv-sacred-maroon, #6B1D2F);
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--spv-sacred-gold-light, #FBF4DE);
    }

    .nav-list > li.open .dropdown {
        display: block;
    }

    /* Mobile Footer */
    .spv-mobile-drawer-footer {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px 22px;
        background: #F8F3EA;
        border-top: 1.5px solid rgba(212, 175, 55, 0.2);
        flex-shrink: 0;
    }

    .spv-md-btn--wa {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 11px 16px;
        background: #25D366;
        color: #ffffff !important;
        font-weight: 700;
        font-size: 0.85rem;
        border-radius: 8px;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
        transition: transform 0.2s ease;
    }

    .spv-md-btn--wa:hover {
        transform: translateY(-1px);
        filter: brightness(1.05);
    }

    .spv-md-contact-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.72rem;
        color: var(--spv-ink-soft, #6E5C50);
    }

    .spv-md-contact-info a {
        color: var(--spv-sacred-maroon, #6B1D2F);
        font-weight: 700;
        text-decoration: none;
    }
}

@media (max-width: 620px) {
    .header-main {
        padding: 12px 16px;
    }

    .logo-text b {
        font-size: 1rem;
    }

    .logo .mark img,
    .logo .spv-brand-img {
        height: 38px;
        max-width: 140px;
    }

    .header-icons {
        gap: 14px;
    }

    .header-icons .icon-item span:not(.cart-count) {
        display: none;
    }
}

/* --- Custom Navbar Block compatibility: automatically hide theme header & topbar --- */
body.cnb-global-active #masthead,
body.cnb-global-active .site-header,
body.cnb-global-active .topbar {
    display: none !important;
}
