/* ==========================================
   TK BLINDS CUSTOM HEADER DESIGN SYSTEM
   ========================================== */

/* Fonts & Base overrides */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* Shield header styling from theme overrides */
header.tk-custom-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(3, 33, 73, 0.03) !important;
    font-family: 'Montserrat', sans-serif !important;
    position: relative !important;
    z-index: 99999 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

header.tk-custom-header * {
    box-sizing: border-box !important;
}

.tk-header-container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 12px 24px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
}

/* 1. LOGO STYLING */
header.tk-custom-header .tk-logo-area {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    height: auto !important;
}

header.tk-custom-header .tk-logo-link {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    gap: 12px !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Custom uploaded image logo constraints */
header.tk-custom-header .tk-custom-logo-img {
    max-height: 54px !important;
    width: auto !important;
    display: block !important;
    object-fit: contain !important;
    transition: transform 0.25s ease !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

header.tk-custom-header .tk-logo-image-link:hover .tk-custom-logo-img {
    transform: scale(1.02) !important;
}

header.tk-custom-header .tk-logo-badge {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, #555c64 0%, #1a222a 100%) !important;
    border: 2px solid #8c96a0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: inset 0 0 6px rgba(255,255,255,0.4), 0 3px 6px rgba(0,0,0,0.15) !important;
}

header.tk-custom-header .tk-logo-badge span {
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 20px !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
}

header.tk-custom-header .tk-logo-text-group {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

header.tk-custom-header .tk-logo-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #0b57a3 !important; /* Brand Metallic Blue */
    line-height: 1.1 !important;
    letter-spacing: -0.2px !important;
    display: inline-block !important;
}

header.tk-custom-header .tk-logo-tagline {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #7c8e9f !important; /* Brand Metallic Silver-Gray */
    letter-spacing: 0.8px !important;
    margin-top: 2px !important;
    text-transform: uppercase !important;
    display: inline-block !important;
}

/* 2. DESKTOP NAVIGATION STYLING */
header.tk-custom-header .tk-nav-container {
    display: block !important;
    width: auto !important;
    height: auto !important;
}

header.tk-custom-header .tk-primary-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 28px !important;
    width: auto !important;
    height: auto !important;
}

/* Top-level menu items */
header.tk-custom-header .tk-primary-menu > li {
    position: relative !important;
    padding: 10px 0 !important;
    display: inline-block !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    width: auto !important;
    height: auto !important;
}

header.tk-custom-header .tk-primary-menu > li > a {
    color: #032149 !important; /* Dark Metallic Navy */
    font-weight: 700 !important;
    font-size: 15px !important;
    text-decoration: none !important;
    padding: 6px 0 !important;
    position: relative !important;
    transition: color 0.25s ease !important;
    display: inline-block !important;
    white-space: nowrap !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Underline hover effect for top-level menu */
header.tk-custom-header .tk-primary-menu > li > a::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 0 !important;
    height: 2px !important;
    background-color: #0b57a3 !important; /* Brand Blue */
    transition: width 0.25s ease !important;
}

header.tk-custom-header .tk-primary-menu > li:hover > a {
    color: #0b57a3 !important;
}

header.tk-custom-header .tk-primary-menu > li:hover > a::after,
header.tk-custom-header .tk-primary-menu > li.current-menu-item > a::after,
header.tk-custom-header .tk-primary-menu > li.current-page-ancestor > a::after {
    width: 100% !important;
}

header.tk-custom-header .tk-primary-menu > li.current-menu-item > a {
    color: #0b57a3 !important;
}

/* Dynamic sub-menu arrows/indicators (desktop) */
header.tk-custom-header .tk-primary-menu li.menu-item-has-children > a {
    padding-right: 14px !important;
}

header.tk-custom-header .tk-primary-menu li.menu-item-has-children > a::before {
    content: '' !important;
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border: 4px solid transparent !important;
    border-top-color: currentColor !important;
    margin-top: 1px !important;
    transition: transform 0.25s ease !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
}

header.tk-custom-header .tk-primary-menu li.menu-item-has-children:hover > a::before {
    transform: translateY(-50%) rotate(180deg) !important;
}

/* Dropdown sub-menu levels */
header.tk-custom-header .tk-primary-menu ul.sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background-color: #ffffff !important;
    box-shadow: 0 10px 30px rgba(3, 33, 73, 0.08) !important;
    border-radius: 8px !important;
    min-width: 220px !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(15px) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    z-index: 999999 !important;
    display: block !important;
}

header.tk-custom-header .tk-primary-menu ul.sub-menu ul.sub-menu {
    top: 0 !important;
    left: 100% !important;
    margin-top: -10px !important;
}

header.tk-custom-header .tk-primary-menu li:hover > ul.sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

header.tk-custom-header .tk-primary-menu ul.sub-menu li {
    position: relative !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
}

header.tk-custom-header .tk-primary-menu ul.sub-menu li a {
    display: block !important;
    color: #2c3539 !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.25s ease !important;
    white-space: nowrap !important;
    width: 100% !important;
    height: auto !important;
    line-height: 1.2 !important;
    border: none !important;
    background: transparent !important;
}

header.tk-custom-header .tk-primary-menu ul.sub-menu li:hover > a {
    background-color: #f4f7fa !important;
    color: #0b57a3 !important;
    padding-left: 24px !important;
}

/* Dropdown arrows for sub-menu children */
header.tk-custom-header .tk-primary-menu ul.sub-menu li.menu-item-has-children > a::before {
    border-top-color: transparent !important;
    border-left-color: currentColor !important;
    margin-top: 0 !important;
    right: 15px !important;
}

header.tk-custom-header .tk-primary-menu ul.sub-menu li.menu-item-has-children:hover > a::before {
    transform: translateY(-50%) rotate(90deg) !important;
}

/* 3. RIGHT SIDE CTA ELEMENTS */
header.tk-custom-header .tk-header-cta-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
    width: auto !important;
    height: auto !important;
}

/* Phone capsule pill container - Override Astra styles to avoid circle distortion */
header.tk-custom-header .tk-phone-capsule,
.tk-mobile-nav-drawer .tk-phone-capsule {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    background-color: #f4f6f9 !important;
    border: 1px solid #e1e8ed !important;
    border-radius: 50px !important;
    padding: 10px 20px !important;
    color: #032149 !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
    transition: all 0.25s ease !important;
    white-space: nowrap !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

header.tk-custom-header .tk-phone-capsule:hover,
.tk-mobile-nav-drawer .tk-phone-capsule:hover {
    background-color: #eef2f6 !important;
    border-color: #d1dbe3 !important;
    color: #0b57a3 !important;
}

header.tk-custom-header .tk-phone-icon,
.tk-mobile-nav-drawer .tk-phone-icon {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    stroke: currentColor !important;
    color: #0b57a3 !important;
    transition: color 0.25s ease !important;
    display: inline-block !important;
}

header.tk-custom-header .tk-phone-text,
.tk-mobile-nav-drawer .tk-phone-text {
    display: inline-block !important;
    white-space: nowrap !important;
}

/* Free Quote Button styling - Override Astra styles to avoid circle distortion */
header.tk-custom-header .tk-quote-button,
.tk-mobile-nav-drawer .tk-quote-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #0b57a3 0%, #032149 100%) !important;
    border-radius: 50px !important;
    padding: 11px 24px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
    box-shadow: 0 4px 12px rgba(11, 87, 163, 0.25) !important;
    transition: all 0.25s ease !important;
    border: none !important;
    white-space: nowrap !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    line-height: 1.2 !important;
}

header.tk-custom-header .tk-quote-button:hover,
.tk-mobile-nav-drawer .tk-quote-button:hover {
    background: linear-gradient(135deg, #106fcc 0%, #052f66 100%) !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 16px rgba(11, 87, 163, 0.35) !important;
    color: #ffffff !important;
}

header.tk-custom-header .tk-quote-button:active,
.tk-mobile-nav-drawer .tk-quote-button:active {
    transform: translateY(0) !important;
}


/* 4. HAMBURGER TOGGLE BUTTON */
header.tk-custom-header .tk-menu-toggle {
    display: none !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: 24px !important;
    height: 18px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    z-index: 10001 !important;
}

header.tk-custom-header .tk-hamburger-bar {
    width: 100% !important;
    height: 3px !important;
    background-color: #032149 !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
}

/* 5. RESPONSIVE MOBILE DRAWER STYLING */
.tk-mobile-nav-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    visibility: hidden !important;
    transition: visibility 0.3s !important;
}

.tk-mobile-nav-drawer[aria-hidden="false"] {
    visibility: visible !important;
}

/* Dark Backdrop Overlay */
.tk-drawer-backdrop {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(3, 33, 73, 0.45) !important;
    backdrop-filter: blur(4px) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.tk-mobile-nav-drawer[aria-hidden="false"] .tk-drawer-backdrop {
    opacity: 1 !important;
}

/* Drawer Side Content block */
.tk-drawer-content {
    position: absolute !important;
    top: 0 !important;
    right: -320px !important;
    width: 85% !important;
    max-width: 320px !important;
    height: 100% !important;
    background-color: #ffffff !important;
    box-shadow: -8px 0 30px rgba(3, 33, 73, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 24px !important;
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-sizing: border-box !important;
}

.tk-mobile-nav-drawer[aria-hidden="false"] .tk-drawer-content {
    right: 0 !important;
}

/* Drawer Header and Close */
.tk-drawer-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 30px !important;
    width: 100% !important;
}

.tk-drawer-header .tk-custom-logo-img {
    max-height: 42px !important;
    width: auto !important;
    display: block !important;
}

.tk-drawer-close {
    font-size: 32px !important;
    font-weight: 300 !important;
    background: transparent !important;
    border: none !important;
    color: #7c8e9f !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 10px !important;
}

.tk-drawer-close:hover {
    color: #0b57a3 !important;
}

/* Drawer Menu Links */
.tk-drawer-nav {
    flex-grow: 1 !important;
    overflow-y: auto !important;
    margin-bottom: 24px !important;
}

.tk-mobile-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.tk-mobile-menu li {
    position: relative !important;
    border-bottom: 1px solid #f0f4f8 !important;
    display: block !important;
    width: 100% !important;
}

.tk-mobile-menu li a {
    display: block !important;
    padding: 12px 0 !important;
    color: #032149 !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 15.5px !important;
    transition: color 0.25s ease !important;
    line-height: 1.2 !important;
}

.tk-mobile-menu li:hover > a,
.tk-mobile-menu li.current-menu-item > a {
    color: #0b57a3 !important;
}

/* Accordion mobile submenu toggling */
.tk-mobile-menu ul.sub-menu {
    list-style: none !important;
    padding: 0 0 0 15px !important;
    margin: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.35s ease-out !important;
    display: block !important;
}

/* Open submenu animation */
.tk-mobile-menu li.sub-menu-active > ul.sub-menu {
    max-height: 500px !important;
}

.tk-mobile-menu ul.sub-menu li {
    border-bottom: none !important;
}

.tk-mobile-menu ul.sub-menu li a {
    padding: 8px 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #5a6b82 !important;
}

/* Dropdown Submenu Toggler Buttons for Mobile */
.tk-mobile-submenu-toggle {
    position: absolute !important;
    right: 0 !important;
    top: 8px !important;
    width: 32px !important;
    height: 32px !important;
    background: #f4f6f9 !important;
    border: 1px solid #e1e8ed !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s ease !important;
    z-index: 10 !important;
}

.tk-mobile-submenu-toggle::after {
    content: '' !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    border: 4px solid transparent !important;
    border-top-color: #032149 !important;
    margin-top: 2px !important;
    transition: transform 0.25s ease !important;
}

.tk-mobile-menu li.sub-menu-active > .tk-mobile-submenu-toggle {
    background-color: #0b57a3 !important;
    border-color: #0b57a3 !important;
}

.tk-mobile-menu li.sub-menu-active > .tk-mobile-submenu-toggle::after {
    border-top-color: #ffffff !important;
    transform: rotate(180deg) !important;
    margin-top: -2px !important;
}

/* Drawer CTA Area styling */
.tk-drawer-cta-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding-top: 15px !important;
    border-top: 1px solid #f0f4f8 !important;
}

.tk-drawer-cta-group .tk-phone-capsule,
.tk-drawer-cta-group .tk-quote-button {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ==========================================
   6. RESPONSIVENESS AND BREAKPOINTS
   ========================================== */

@media (max-width: 991px) {
    /* Hide desktop-only components */
    header.tk-custom-header .tk-nav-container,
    header.tk-custom-header .tk-header-cta-group {
        display: none !important;
    }

    /* Show hamburger */
    header.tk-custom-header .tk-menu-toggle {
        display: flex !important;
    }
    
    /* Slightly adjust mobile logo height */
    header.tk-custom-header .tk-custom-logo-img {
        max-height: 44px !important;
    }
}
