/**
 * WBIO Header V3 - Modern & Robust
 * 3-Tier Structure: Promo Bar, USP Bar, Main Navigation
 */

:root {
    --wb-hdr-height-desktop: 72px; 
    --wb-hdr-height-stuck: 64px;
    --wb-hdr-height-mobile: 64px;
    --wb-hdr-bg: #ffffff;
    --wb-hdr-text: #0F172A;
    --wb-hdr-primary: #1DA1F2;
    --wb-hdr-accent: #7B2FF7;
    --wb-hdr-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --wb-promo-height: 48px;
    --wb-usp-height: 40px;

    /* Total calculated heights for components */
    --header-total-desktop: calc(var(--wb-hdr-height-desktop) + var(--wb-promo-height) + var(--wb-usp-height));
    --header-total-mobile: var(--wb-hdr-height-mobile);
}

/* Master Shell */
.wb-hdr {
    position: fixed; /* Stick to top */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: var(--wb-hdr-bg);
    transition: var(--wb-hdr-transition);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

/* Tier 1: Promo Bar */
.bar-promo {
    height: var(--wb-promo-height);
    background: #0F172A;
    color: #fff;
    overflow: hidden;
    transition: margin-top 0.4s ease, opacity 0.3s ease;
}

.div-promo {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.promo-content {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.promo-content .label {
    background: var(--wb-hdr-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.promo-timer {
    font-size: 14px;
    color: #94A3B8;
}

.promo-btn {
    background: #fff;
    color: #0F172A;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.promo-btn:hover {
    background: var(--wb-hdr-primary);
    color: #fff;
}

/* Tier 2: USP Bar */
.bar-usps {
    height: var(--wb-usp-height);
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    transition: margin-top 0.4s ease, opacity 0.3s ease;
}

.div-usps {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.usps-list {
    display: flex;
    gap: 24px;
}

.usp-item {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
}

.secondary-links {
    display: flex;
    gap: 20px;
}

.secondary-links a {
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
    text-decoration: none;
}

.secondary-links a:hover {
    color: var(--wb-hdr-primary);
}

.secondary-links .login-link {
    display: flex;
    align-items: center;
    color: #0F172A;
    font-weight: 600;
}

/* Tier 3: Main Navigation Bar */
.bar-main-links {
    height: var(--wb-hdr-height-desktop);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    transition: var(--wb-hdr-transition);
}

.gutter-padding {
    padding-left: 5%;
    padding-right: 5%;
}

@media (max-width: 1200px) {
    .gutter-padding {
        padding-left: 4%;
        padding-right: 4%;
    }
}

@media (max-width: 768px) {
    .gutter-padding {
        padding-left: 4%;
        padding-right: 4%;
    }
}

@media (max-width: 480px) {
    .gutter-padding {
        padding-left: 20px;
        padding-right: 20px;
    }
}

.logo-area {
    display: flex;
    align-items: center;
}

/* Main Navigation Items (Tier 3) */
.global-navigation {
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-links {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
}

.menu-li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.menu-item {
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    color: #1E293B;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.menu-item:hover {
    color: var(--wb-hdr-primary);
}

/* Megamenu Standard Styles */
.div-sm-outer {
    position: fixed;
    top: calc(var(--wb-promo-height) + var(--wb-usp-height) + var(--wb-hdr-height-desktop));
    left: 0;
    width: 100vw;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    display: flex;
    justify-content: center;
    padding: 40px 0;
    border-bottom: 1px solid #e2e8f0;
}

.div-sm-outer > .div-sm-inner {
    width: 100%;
    max-width: 1600px;
    padding-left: 5%;
    padding-right: 5%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

/* Click-based megamenu activation */
.menu-li.is-active .div-sm-outer {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-li.is-active .menu-chevron {
    transform: rotate(180deg);
}

.div-sm-inner {
    display: flex;
    width: 100%;
    gap: 80px;
    align-items: flex-start;
}

.div-sm-col {
    flex: 1;
    position: relative;
}

.div-sm-col:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -40px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #1DA1F2 0%, #1DA1F2 100%);
    opacity: 0.6;
}

.grid-col-border {
    border-right: none;
    padding-right: 0;
}

.sm-h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 20px;
}

.a-sm-card {
    display: flex;
    gap: 15px;
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.a-sm-card:hover {
    background: #f8fafc;
}

.sm-card-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sm-card-icon-wrapper.b-1 { background: rgba(29, 161, 242, 0.1); }
.sm-card-icon-wrapper.b-2 { background: rgba(123, 47, 247, 0.1); }

.sm-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.sm-card-desc {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.sm-links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.a-sm-link {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 12px 0;
    display: block;
    border-bottom: 1px solid transparent;
}

.a-sm-link:hover {
    color: var(--wb-hdr-primary);
    border-bottom-color: var(--wb-hdr-primary);
    padding-left: 8px;
}

.is--sidebar {
    background: #f8fafc;
    margin: -30px;
    padding: 30px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    max-width: 250px;
}

.sm-badge {
    display: inline-block;
    background: #22c55e;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
}

.sm-h4 {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}

.sm-p {
    font-size: 14px;
    color: #64748b;
}

.btn-sm-primary {
    display: inline-block;
    background: var(--wb-hdr-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    width: 100%;
}

.mt-sm-10 { margin-top: 10px; }
.mt-sm-20 { margin-top: 20px; }

/* Action Buttons (Tier 3) */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.basket-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1E293B;
    transition: color 0.2s ease;
}

.basket-btn:hover {
    color: var(--wb-hdr-primary);
}

.basket-btn .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--wb-hdr-primary);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Sticky States */
.wb-hdr--stuck .bar-promo {
    margin-top: calc(var(--wb-promo-height) * -1);
    opacity: 0;
    pointer-events: none;
}

.wb-hdr--stuck .bar-usps {
    margin-top: calc(var(--wb-usp-height) * -1);
    opacity: 0;
    pointer-events: none;
}

.wb-hdr--stuck .bar-main-links {
    height: var(--wb-hdr-height-stuck);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Responsive Utilities */
.mobile-toggle {
    display: none !important;
}

@media (max-width: 991px) {
    .hide-on-mobile {
        display: none !important;
    }
    .global-navigation {
        display: none !important;
    }
    .mobile-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }
    .mobile-toggle span {
        width: 24px;
        height: 2px;
        background: var(--wb-hdr-text);
        border-radius: 2px;
        transition: var(--wb-hdr-transition);
    }
    .bar-main-links {
        height: var(--wb-hdr-height-mobile);
    }
    .logo-area img {
        height: 32px !important;
    }
    
    /* Hide megamenus on mobile/tablet */
    .div-sm-outer {
        display: none !important;
    }
}

/* Megamenu responsive tweaks */
@media (max-width: 1200px) {
    .div-sm-outer {
        padding: 30px 0;
    }
    
    .div-sm-outer > .div-sm-inner {
        padding-left: 4%;
        padding-right: 4%;
    }
}

@media (max-width: 768px) {
    .div-sm-outer > .div-sm-inner {
        padding-left: 4%;
        padding-right: 4%;
    }
}

@media (max-width: 480px) {
    .div-sm-outer > .div-sm-inner {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Mobile Menu Styles */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -110%; /* Extra margin for shadow */
    width: 85%;
    max-width: 350px;
    height: 100vh;
    height: 100dvh; /* Dynamic height for mobile browsers */
    background: #fff;
    z-index: 10001;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.mobile-menu-overlay.is-active {
    right: 0;
    visibility: visible;
}

.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.mobile-menu-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 4%;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

@media (max-width: 480px) {
    .mobile-menu-header {
        padding: 20px;
    }
}

.mobile-footer {
    padding: 4%;
    padding-bottom: calc(4% + env(safe-area-inset-bottom));
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

@media (max-width: 480px) {
    .mobile-footer {
        padding: 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

.mobile-login-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--wb-hdr-primary) !important;
    color: #fff !important;
    border-radius: 10px;
    padding: 14px !important;
    font-weight: 800 !important;
    border: none !important;
}

.no-scroll {
    overflow: hidden !important;
}

@media (max-width: 1024px) {
    .hide-on-tablet {
        display: none !important;
    }
}

/* Hero Adjustments */
#hero, .hero, .hero-section {
    padding-top: var(--header-total-desktop) !important;
}

@media (max-width: 991px) {
    #hero, .hero, .hero-section {
        padding-top: var(--header-total-mobile) !important;
    }
}


