/* ==========================================
   HERO SECTION & HEADER - MEGA MENU VERSION
   Theme: Connecthair
   ========================================== */

:root {
    --header-initial-bg: transparent;
    --header-scroll-bg: #FFFFFF;
    --header-text-color: #FFFFFF;
    --header-text-scroll-color: #000000;
    --header-icon-color: #FFFFFF;
    --header-icon-scroll-color: #000000;
    --header-icon-size: 18px;
    --header-logo-width: 50px;
    --header-logo-mobile-width: 45px;
    --header-menu-font-size: 11px;
    --header-menu-letter-spacing: 2px;
    --top-bar-bg-color: #81D8D0;
    --top-bar-bg-scroll-color: #FFFFFF;
    --top-bar-text-color: #FFFFFF;
    --top-bar-text-scroll-color: #000000;
    --top-bar-font-size: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* TOP BAR */
.top-bar {
    background-color: var(--top-bar-bg-color, #81D8D0) !important;
    color: var(--top-bar-text-color, #fff);
    padding: 8px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.top-bar.scrolled {
    background-color: var(--top-bar-bg-scroll-color, #fff) !important;
    color: var(--top-bar-text-scroll-color, #000);
}

.top-bar-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    color: inherit;
    font-size: var(--top-bar-font-size, 12px);
    line-height: 1.4;
}

.top-bar-text {
    text-align: center;
    color: inherit;
}

.top-bar-text a {
    color: inherit;
    text-decoration: underline;
    margin-left: 5px;
    transition: opacity 0.3s ease;
}

.top-bar.scrolled .top-bar-content,
.top-bar.scrolled .top-bar-text,
.top-bar.scrolled .top-bar-text a {
    color: var(--top-bar-text-scroll-color, #000);
}

.top-bar.scrolled .top-bar-close {
    color: var(--top-bar-text-scroll-color, #000);
}

.top-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.top-bar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.top-bar-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    color: var(--top-bar-text-color, #fff);
    font-size: var(--top-bar-font-size, 12px);
    line-height: 1.4;
}

.top-bar-text {
    text-align: center;
}

.top-bar-text a {
    color: var(--top-bar-text-color, #fff);
    text-decoration: underline;
    margin-left: 5px;
    transition: opacity 0.3s ease;
}

.top-bar-text a:hover {
    opacity: 0.8;
}

.top-bar-close {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: var(--top-bar-text-color, #fff);
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    padding: 0 10px;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.top-bar-close:hover {
    opacity: 1;
}

/* HEADER */
#master_head {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: #fff;
    transition: all 0.3s ease;
}

body.has-top-bar #master_head {
    top: 32px;
}

body.has-top-bar .top-bar.hidden ~ #page #master_head {
    top: 0;
}

.header-wrapper {
    width: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* TRANSPARENT HEADER */
#master_head.transparent {
    background-color: var(--header-initial-bg, transparent);
    color: var(--header-text-color, #fff);
}

#master_head.transparent.scrolled {
    background-color: var(--header-scroll-bg, #fff);
    color: var(--header-text-scroll-color, #000);
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* LOGO */
.logo {
    display: inline-block;
    line-height: 0;
}

.logo img {
    height: auto;
    width: var(--header-logo-width, 50px) !important;
    max-width: 100%;
    transition: all 0.3s ease;
    display: block;
}

.logo-white {
    display: none !important;
}

.logo-dark {
    display: block !important;
}

/* TEXT & ICON COLORS */
#master_head.transparent a {
    color: var(--header-text-color, #fff);
    transition: color 0.3s ease, opacity 0.3s ease;
}

#master_head.transparent.scrolled a {
    color: var(--header-text-scroll-color, #000);
}

#master_head.transparent .header-actions svg path {
    fill: var(--header-icon-color, #fff);
    transition: fill 0.3s ease;
}

#master_head.transparent.scrolled .header-actions svg path {
    fill: var(--header-icon-scroll-color, #000);
}

/* DESKTOP HEADER */
.desktop-header {
    display: none;
}

.desktop-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    gap: 30px;
}

/* NAVIGATION */
.main-nav {
    flex: 1;
    text-align: center;
}

.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 30px;
    align-items: center;
}

.main-menu > li {
    position: static;
}

.main-menu > li > a {
    text-decoration: none;
    font-weight: 400;
    font-size: var(--header-menu-font-size, 11px);
    text-transform: uppercase;
    letter-spacing: var(--header-menu-letter-spacing, 2px);
    transition: opacity 0.3s ease;
    display: block;
    padding: 5px 0;
}

.main-menu > li > a:hover {
    opacity: 0.7;
}

.main-menu .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 3px solid currentColor;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.main-menu .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* MEGA MENU - ФИНАЛЬНАЯ ВЕРСИЯ */
.main-menu > li > .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    display: none;
    z-index: 999;
    list-style: none;
    border-top: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    min-width: 800px;
    max-width: 1200px;
}

#master_head.transparent .main-menu > li > .sub-menu {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
}

#master_head.transparent.scrolled .main-menu > li > .sub-menu {
    background: #fff;
}

.main-menu > li:hover > .sub-menu {
    display: block !important;
}

.mega-menu-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 60px;
    padding: 40px 50px;
}

.mega-menu-left {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    align-items: flex-start;
    max-width: 600px;
}

.mega-menu-wrapper:not(:has(.mega-menu-right)) .mega-menu-left {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 100%;
}

.mega-menu-left > li {
    min-width: 0;
    max-width: 100%;
}

.mega-menu-left > li > a {
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #000;
    display: block;
    padding: 8px 0;
}

.mega-menu-left .sub-menu {
    position: static;
    display: block !important;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    list-style: none;
}

.mega-menu-left .sub-menu li {
    margin-bottom: 10px;
}

.mega-menu-left .sub-menu a {
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #000;
    white-space: nowrap;
    padding: 8px 0;
    display: block;
    text-transform: none;
    font-weight: 400;
}

.mega-menu-left .sub-menu a:hover {
    text-decoration: underline;
    opacity: 1;
}

.mega-menu-right {
    flex: 0 0 380px;
    max-width: 380px;
    min-height: 400px;
}

.mega-menu-right a {
    display: block;
    line-height: 0;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.mega-menu-right a:hover {
    transform: scale(1.02);
    opacity: 1;
}

.mega-menu-right img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* HEADER ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions svg {
    width: var(--header-icon-size, 18px);
    height: var(--header-icon-size, 18px);
    transition: all 0.3s ease;
}

.header-actions button,
.header-actions a {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.header-actions button:hover,
.header-actions a:hover {
    opacity: 0.7;
}

.account-text {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cart-link {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff0000;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.cart-total {
    font-size: 12px;
    font-weight: 400;
    margin-left: 5px;
}

/* MOBILE HEADER */
.mobile-header {
    display: block;
}

.mobile-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.mobile-header .logo img {
    width: var(--header-logo-mobile-width, 45px) !important;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 80px 20px 20px;
    overflow-y: auto;
    z-index: 9999;
}

body.has-top-bar .mobile-nav {
    top: 32px;
}

.mobile-nav.active {
    display: block;
}

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

.mobile-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-menu a {
    display: block;
    padding: 15px 0;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mobile-menu a:hover {
    opacity: 0.7;
}

.burger-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.burger-menu span {
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* SEARCH OVERLAY */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.search-container h2 {
    color: #fff;
    margin: 0 0 30px;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 1px;
}

.search-container form {
    display: flex;
    gap: 10px;
}

.search-container input[type="search"] {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    background: #fff;
    color: #000;
}

.search-container input[type="search"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.search-container button[type="submit"] {
    padding: 12px 25px;
    background: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container button[type="submit"]:hover {
    background: #f0f0f0;
}

.search-container button[type="submit"] svg {
    width: 20px;
    height: 20px;
}

.search-container button[type="submit"] svg path {
    fill: #000;
}

.search-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.search-close:hover {
    opacity: 1;
}

/* HERO SECTION */
.hero-section {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 100vh;
    padding-top: 80px;
}

body.has-top-bar .hero-section {
    padding-top: 112px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg-color {
    width: 100%;
    height: 100%;
}

.hero-bg-image,
.hero-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-logo {
    margin-bottom: 50px;
}

.hero-logo img,
.hero-logo video {
    max-width: 500px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5em;
    font-weight: 300;
    margin: 0 0 20px;
    line-height: 1.2;
    letter-spacing: 0.05em;
    font-family: serif;
}

.hero-subtitle {
    font-size: 1.5em;
    font-weight: 300;
    margin: 0 0 50px;
    font-style: italic;
    opacity: 0.95;
}

.hero-button-wrap {
    margin-top: 50px;
}

.hero-button {
    display: inline-block;
    padding: 12px 40px;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 2px solid #fff;
    transition: all 0.3s ease;
    font-size: 12px;
}

.hero-button:hover {
    background: transparent;
    color: #fff;
}

/* PAGE CONTENT */
.page-content {
    padding: 60px 0;
}

/* RESPONSIVE */
@media (min-width: 1000px) {
    .mobile-header {
        display: none;
    }
    
    .desktop-header {
        display: block;
    }
}

@media (max-width: 1200px) {
    .main-menu > li > .sub-menu {
        min-width: 700px;
        max-width: 1000px;
    }
    
    .mega-menu-wrapper {
        padding: 35px 40px;
        gap: 50px;
    }
    
    .mega-menu-left {
        gap: 30px;
        max-width: 500px;
    }
    
    .mega-menu-right {
        flex: 0 0 320px;
        max-width: 320px;
        min-height: 350px;
    }
}

@media (max-width: 999px) {
    .hero-title {
        font-size: 2.2em;
    }
    
    .hero-subtitle {
        font-size: 1.1em;
    }
    
    .hero-logo img,
    .hero-logo video {
        max-width: 350px;
    }
    
    .main-menu > li > .sub-menu {
        left: 0;
        right: 0;
        transform: none;
        min-width: auto;
        max-width: none;
    }
    
    .mega-menu-wrapper {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .mega-menu-left {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 100%;
    }
    
    .mega-menu-right {
        width: 100%;
        flex: 0 0 auto;
        max-width: 100%;
        min-height: auto;
    }
}

@media (max-width: 767px) {
    .top-bar {
        padding: 6px 0;
    }
    
    .top-bar-content {
        font-size: 11px;
    }
    
    body.has-top-bar #master_head {
        top: 28px;
    }
    
    .hero-title {
        font-size: 1.8em;
    }
    
    .hero-subtitle {
        font-size: 0.95em;
    }
    
    .hero-logo img,
    .hero-logo video {
        max-width: 280px;
    }
    
    .hero-button {
        padding: 10px 30px;
        font-size: 11px;
    }
    
    .hero-content {
        padding: 60px 20px;
    }
}

/* UTILITY CLASSES */
body.search-active,
body.menu-active {
    overflow: hidden;
}

html {
    scroll-behavior: smooth;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}