/* ========================================
   Header Styles - Top1to5.com
   Design: 2-part header (Static + Smart Menu)
   Theme: Purple (#8b5cf6)
   ======================================== */

/* ========================================
   PART 1: Static Header (Always Visible)
   ======================================== */

.site-header {
    position: relative;
}

/* Header Top Container - Always Visible (Not Smart Menu) */
.header-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: rgba(30, 27, 75, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Logo (Left) */
.header-logo {
    flex-shrink: 0;
}

.header-logo a {
    display: block;
    line-height: 0;
}

.header-logo-img {
    height: 50px;
    width: auto;
    display: block;
}

/* Global Navigation (Center) */
.header-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.header-menu li {
    margin: 0;
}

.header-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
    display: block;
}

.header-menu a:hover {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.2);
    text-decoration: underline;
}

/* Account Button (Right) */
.header-account {
    flex-shrink: 0;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.account-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    color: #ffffff;
}

.account-btn i {
    font-size: 16px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
}

/* ========================================
   PART 2: Smart Menu (Dynamic - Hides/Shows on Scroll)
   ======================================== */

.smart-menu {
    position: fixed;
    top: 81px; /* Height of header-top */
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(30, 27, 75, 0.95);
    transition: transform 0.3s ease, top 0.3s ease;
}

.smart-menu.hide {
    transform: translateY(-100%);
}

/* Content spacing to account for fixed headers */
/* Using margin on container instead of body padding to avoid conflicts */
.site-header ~ .container,
.site-header ~ div:not(.mobile-menu-panel) {
    margin-top: 135px !important; /* Height of header-top (81px) + smart-menu (~54px) */
}

/* Menu container and items - using existing styles from credit-card-style.css */
/* These styles are already defined in the main stylesheet */

/* ========================================
   Mobile Menu Panel
   ======================================== */

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.mobile-menu-panel.open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #1f2937;
    cursor: pointer;
    padding: 4px;
}

/* Mobile Login Button */
.mobile-login {
    padding: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mobile-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.mobile-login-btn i {
    font-size: 18px;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.mobile-menu-list li {
    margin: 0;
}

.mobile-menu-list a {
    display: block;
    padding: 15px 20px;
    color: #1f2937;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-menu-list a:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding-left: 30px;
}

/* Mobile Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.mobile-menu-overlay.show {
    display: block;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .header-menu {
        gap: 20px;
    }

    .header-menu a {
        font-size: 15px;
        padding: 6px 12px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .header-container {
        padding: 15px;
        gap: 15px;
        height: 70px; /* Fixed height for Part 1 */
        box-sizing: border-box;
    }

    .header-logo-img {
        height: 40px;
    }

    /* Hide desktop navigation */
    .header-nav {
        display: none;
    }

    .header-account {
        display: none;
    }

    /* Show mobile toggle */
    .mobile-menu-toggle {
        display: block;
    }

    /* Part 2: Smart menu - no longer fixed, flows with content */
    .smart-menu {
        position: relative;
        top: auto;
        margin-top: 70px; /* Push below fixed header (70px tall) */
        margin-bottom: 0; /* No gap below smart menu */
        font-size: 14px;
        z-index: auto;
    }

    /* Adjust content spacing for mobile */
    .site-header ~ .container,
    .site-header ~ div:not(.mobile-menu-panel) {
        margin-top: 0 !important; /* No extra margin - smart menu provides the spacing */
        padding-top: 0 !important; /* No gap between smart menu and content */
    }
}

/* Extra Small Mobile (< 480px) */
@media (max-width: 480px) {
    .header-logo-img {
        height: 35px;
    }

    .mobile-menu-panel {
        width: 100%;
        right: -100%;
    }

    .smart-menu {
        position: relative;
        top: auto;
        margin-top: 70px; /* Push below fixed header */
    }

    .site-header ~ .container,
    .site-header ~ div:not(.mobile-menu-panel) {
        margin-top: 0 !important; /* No margin - smart menu flows naturally */
    }
}
