/* Modern Responsive Header Styles - Sonnet Design System */

/* Reset and Base Styles */
.modern-header * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.modern-header {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

.logo-wrapper {
    flex-shrink: 0;
    margin-right: 30px;
}

.logo-wrapper img {
    height: 50px;
    width: auto;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    gap: 10px;
}

.main-nav {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

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

.main-nav > li > a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (min-width: 993px) {
    .main-nav > li > a:hover {
        background: #f5f5f5;
        color: #000;
    }
}

.main-nav > li.active > a {
    background: #007bff;
    color: white;
}

/* Dropdown Styles */
.dropdown {
    display: none;
    position: absolute;
    top: 60%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 8px 0;
    margin-top: 5px;
    list-style: none;
    z-index: 1000;
}

/* Nested dropdowns (second level and beyond) appear to the RIGHT side */
.dropdown .has-children {
    position: relative;
}

.dropdown .has-children > .dropdown {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 0px;
}

/* When there's not enough space on the right, open to the left */
.dropdown .has-children.open-left > .dropdown {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 0px;
}

@media (min-width: 993px) {
    .has-children:hover > .dropdown {
        display: block;
    }
}

/* Arrow indicator for items with dropdowns - desktop only */
.has-children > a::after {
    content: ' ▼';
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.6;
}

/* Nested dropdown items get a right arrow to indicate they open to the side */
.dropdown .has-children > a::after {
    content: ' ▶';
    float: right;
    margin-left: 15px;
}

@media (min-width: 993px) {
    .has-children > a::after {
        display: inline-block;
    }
}

.dropdown li {
    list-style: none;
}

.dropdown li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

@media (min-width: 993px) {
    .dropdown li a:hover {
        background: #f5f5f5;
    }
}

.dropdown li.active a {
    background: #e3f2fd;
    color: #007bff;
    font-weight: 500;
}

/* Notification Badge */
.notification-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #e00;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}

/* Language Switcher */
.lang-switch {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

@media (min-width: 993px) {
    .lang-switch:hover {
        background: #f5f5f5;
        border-color: #007bff;
        color: #333;
    }
}

/* Shopping Cart Icon */
.cart-wrapper {
    position: relative;
    margin-left: 10px;
}

.cart-wrapper a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

@media (min-width: 993px) {
    .cart-wrapper a:hover {
        background: #f5f5f5;
    }
}

.cart-wrapper img,
.cart-wrapper svg {
    width: 24px;
    height: 24px;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e00;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-left: 10px;
}

.mobile-toggle svg {
    width: 24px;
    height: 24px;
}

/* Tablet Styles */
@media (max-width: 1200px) {
    .main-nav {
        gap: 2px;
    }
    
    .main-nav > li > a {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Mobile Styles */
@media (max-width: 992px) {
    .header-container {
        height: 60px;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 00px;
        right: -100%;
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 0px);
        background: white;
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 70px 20px 80px 20px;
        overflow-y: auto;
        overflow-x: visible;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 999;
        transition: right 0.2s ease-in-out;
        display: flex;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .main-nav > li > a {
        padding: 15px 10px;
        font-size: 15px;
    }
    
    /* Mobile menu close button */
    .main-nav > li.mobile-menu-close-wrapper {
        position: absolute !important;
        top: 0;
        right: 0;
        display: flex !important;
        justify-content: flex-end;
        align-items: center;
        border-bottom: none !important;
        padding: 15px 20px !important;
        margin: 0 !important;
        width: auto !important;
        z-index: 2;
        background: transparent;
    }
    
    .mobile-menu-close {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid #e0e0e0;
        cursor: pointer;
        padding: 10px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: all 0.2s ease;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-close:hover,
    .mobile-menu-close:active {
        background: #f5f5f5;
        border-color: #ccc;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-menu-close svg {
        width: 28px;
        height: 28px;
        color: #333;
        stroke: #333;
        stroke-width: 2.5;
        display: block;
    }
    
    .dropdown {
        position: static;
        display: none;
        box-shadow: none;
        background: #f9f9f9;
        margin-top: 0;
        padding: 0;
    }
    
    .has-children.open > .dropdown {
        display: block !important;
    }
    
    /* Nested dropdowns on mobile stack vertically (no horizontal expansion) */
    .dropdown .dropdown {
        position: static;
        display: none;
        box-shadow: none;
        background: #eeeeee;
        margin-top: 5px;
        margin-left: 20px;
        margin-bottom: 5px;
        padding: 5px 0;
    }
    
    .has-children > a::after {
        content: ' ▼';
        font-size: 10px;
        margin-left: 5px;
        opacity: 1;
    }
    
    .has-children.open > a::after {
        content: ' ▲';
    }
    
    /* Nested dropdown items on mobile also use down/up arrows */
    .dropdown .has-children > a::after {
        content: ' ▼';
        float: none;
        margin-left: 5px;
    }
    
    .dropdown .has-children.open > a::after {
        content: ' ▲';
    }
    
    .cart-wrapper {
        order: -1;
        margin-left: 0;
        margin-bottom: 10px;
    }
}

/* Hide mobile menu close button on desktop */
@media (min-width: 993px) {
    .mobile-menu-close-wrapper {
        display: none;
    }
}


/* Small Mobile Styles */
@media (max-width: 576px) {
    .logo-wrapper img {
        height: 40px;
    }
    
    .header-container {
        padding: 0 15px;
    }
}
