/* ============================================================================
   HEADER STYLES (Smart Gear Select Pro Header System)
   Version: 23.0.2
   ============================================================================ */
:root {
    --sgs-primary: #4F46E5;
    --sgs-primary-dark: #4338CA;
    --sgs-secondary: #059669;
    --sgs-accent: #F59E0B;
    --sgs-text: #1E293B;
    --sgs-text-light: #64748B;
    --sgs-bg: #FFF;
    --sgs-bg-alt: #F8FAFC;
    --sgs-border: #E2E8F0;
    --sgs-shadow: 0 4px 6px -1px rgba(0,0,0,.1);
    --sgs-shadow-lg: 0 10px 25px rgba(0,0,0,.1);
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--sgs-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}
.skip-link:focus {
    top: 0;
}
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}
.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

.sgs-header {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sgs-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--sgs-shadow);
}
.sgs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: relative;
    min-height: 70px;
}

/* Logo */
.sgs-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--sgs-primary);
    font-weight: 700;
    font-size: 1.2rem;
}
.sgs-logo img {
    max-height: 40px;
    width: auto;
}
.sgs-logo h1,
.sgs-logo span {
    font-size: 1.2rem;
    margin: 0;
}
.sgs-tagline {
    font-size: 0.75rem;
    color: var(--sgs-text-light);
    font-weight: 400;
    margin-left: 5px;
    display: none;
}

/* Actions (search + mobile toggle) */
.sgs-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 3;
}

/* Mobile toggle */
.sgs-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}
.sgs-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--sgs-text);
    margin: 5px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* Search toggle & form */
.sgs-search-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}
.sgs-search-form {
    position: absolute;
    top: 100%;
    right: 24px;
    background: #fff;
    border: 1px solid var(--sgs-border);
    border-radius: 8px;
    padding: 10px;
    display: none;
    box-shadow: var(--sgs-shadow-lg);
    z-index: 1001;
    width: 280px;
}
.sgs-search-form.is-open {
    display: flex;
    gap: 8px;
}
.sgs-search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--sgs-border);
    border-radius: 4px;
    font-size: 0.95rem;
}
.sgs-search-form button {
    background: var(--sgs-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}
.sgs-search-form button:hover {
    background: var(--sgs-primary-dark);
}

/* Navigation */
.sgs-nav {
    order: 2;
}
.sgs-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}
.sgs-menu li {
    margin: 0;
}
.sgs-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--sgs-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.sgs-menu a:hover {
    background: rgba(79,70,229,0.08);
    color: var(--sgs-primary);
}
.sgs-menu li.current-menu-item > a,
.sgs-menu li.current_page_item > a {
    color: var(--sgs-primary);
    background: rgba(79,70,229,0.08);
}
.sgs-menu li.highlight a {
    background: var(--sgs-accent);
    color: #000;
    font-weight: 600;
}
.sgs-menu li.highlight a:hover {
    background: #e08e0b;
}

/* Submenu support */
.sgs-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--sgs-border);
    border-radius: 8px;
    box-shadow: var(--sgs-shadow-lg);
    padding: 8px 0;
    min-width: 200px;
    z-index: 1001;
}
.sgs-menu li {
    position: relative;
}
.sgs-menu li:hover > .sub-menu {
    display: block;
}
.sgs-menu .sub-menu a {
    padding: 10px 20px;
    border-radius: 0;
}

/* Overlay */
.sgs-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 998;
}
.sgs-menu-overlay.active {
    display: block;
}

/* Mobile menu */
@media (max-width: 1024px) {
    .sgs-mobile-toggle {
        display: block;
    }
    .sgs-nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid var(--sgs-border);
        box-shadow: var(--sgs-shadow-lg);
        display: none;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .sgs-nav.is-open {
        display: block;
    }
    .sgs-menu {
        flex-direction: column;
        padding: 10px 0;
    }
    .sgs-menu a {
        padding: 16px 24px;
        border-bottom: 1px solid var(--sgs-border);
        border-radius: 0;
    }
    .sgs-menu li:last-child a {
        border-bottom: none;
    }
    .sgs-tagline {
        display: inline;
    }
    .sgs-menu .sub-menu {
        position: static;
        display: none;
        border: none;
        box-shadow: none;
        padding-left: 20px;
        background: var(--sgs-bg-alt);
    }
    .sgs-menu li.menu-item-has-children > a::after {
        content: ' ▼';
        font-size: 0.7em;
    }
}

/* Desktop adjustments */
@media (min-width: 1025px) {
    .sgs-tagline {
        display: inline;
    }
    .sgs-logo a {
        font-size: 1.4rem;
    }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sgs-logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --sgs-text: #F1F5F9;
        --sgs-text-light: #94A3B8;
        --sgs-bg: #1E293B;
        --sgs-bg-alt: #334155;
        --sgs-border: #475569;
    }
    .sgs-header {
        background: rgba(30,41,59,0.98);
    }
}
