/* ===== VARIABLES ===== */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #666666;
    --accent-color: #d4af37;
    --white: #ffffff;
    --gray-light: #f8f8f8;
    --gray-border: #e5e5e5;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 90px;
    --mobile-header-height: 60px;
    --preheader-height: 38px;
    --total-header-height: calc(var(--header-height) + var(--preheader-height));
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--primary-color);
    line-height: 1.6;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

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

/* ===== SPACER FOR FIXED HEADER ===== */
.header-spacer {
    height: var(--total-header-height);
    width: 100%;
}

/* ===== HEADER WRAPPER - FIXED ===== */
.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    transition: transform 0.3s ease;
}

.header-wrapper.scrolled {
    transform: translateY(calc(var(--preheader-height) * -1));
}

/* ===== PRE-HEADER ===== */
.pre-header {
    background: var(--gray-light);
    border-bottom: 1px solid var(--gray-border);
    padding: 8px 0;
    font-size: 13px;
    height: var(--preheader-height);
    transition: all 0.3s ease;
}

.header-wrapper.scrolled .pre-header {
    opacity: 0;
    pointer-events: none;
}

.pre-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.phones {
    display: flex;
    gap: 20px;
}

.phone-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.phone-link:hover {
    color: var(--accent-color);
}

.phone-icon {
    width: 12px;
    height: 12px;
}

.pre-header-info {
    color: var(--secondary-color);
    font-size: 13px;
}

/* ===== MAIN HEADER ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    height: var(--header-height);
    transition: var(--transition);
}

.header-wrapper.scrolled .header {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.navbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 40px;
    height: var(--header-height);
    position: relative;
}

/* ===== LOGO ===== */
.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 101;
}

.logo img {
    height: 55px;
    width: auto;
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.02);
}

/* ===== NAVIGATION MENU ===== */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
    justify-content: center;
    position: relative;
    z-index: 101;
}

.nav-item {
    position: static;
}

.nav-item.has-dropdown {
    position: relative;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 35px 0;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 33px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent-color);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    width: 10px;
    height: 10px;
}

.nav-item.has-dropdown:hover .dropdown-arrow,
.nav-item.mega-menu-active .dropdown-arrow {
    transform: rotate(180deg);
}

/* ===== MEGA MENU - FIXED POSITION ===== */
.mega-menu {
    position: fixed;
    top: var(--total-header-height);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    border-top: 2px solid var(--accent-color);
    z-index: 999;
    pointer-events: none;
    display: none;
}

.nav-item.mega-menu-active .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    display: block;
}

.header-wrapper.scrolled .mega-menu {
    top: var(--header-height);
}

.mega-menu-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 35px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.mega-menu-column h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-border);
}

.mega-menu-column ul {
    list-style: none;
}

.mega-menu-column ul li {
    margin-bottom: 10px;
}

.mega-menu-column ul li a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    display: inline-block;
    padding: 3px 0;
}

.mega-menu-column ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

/* ===== ONLINE SHOP ===== */
.online-shop .nav-link {
    color: var(--accent-color);
    font-weight: 700;
}

.external-icon {
    opacity: 0.7;
    width: 12px;
    height: 12px;
}

/* ===== LANGUAGE SWITCHER ===== */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 101;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 5px;
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--accent-color);
    color: var(--white);
}

.lang-btn:not(.active):hover {
    background: var(--gray-light);
    color: var(--primary-color);
}

.lang-divider {
    color: var(--gray-border);
    font-size: 13px;
}

/* ===== MOBILE CONTROLS ===== */
.burger-menu,
.mobile-phone {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* ===== OVERLAY - FIXED Z-INDEX ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    pointer-events: none;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ===== MOBILE MENU - UPDATED VERSION ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--gray-light);
    min-height: 80px;
    flex-shrink: 0;
    position: relative;
}

.mobile-menu-logo {
    height: 55px;
    width: 155px;
    margin-bottom: 10px;
}

.close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.close-menu svg {
    width: 24px;
    height: 24px;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.mobile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-nav li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    display: block;
    padding: 14px 20px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.mobile-nav a:active {
    background: var(--gray-light);
}

.mobile-nav a:active::after {
    width: 100%;
}

.mobile-online-shop a {
    color: var(--accent-color) !important;
    font-weight: 600;
}

.mobile-menu-bottom {
    flex-shrink: 0;
    background: var(--gray-light);
}

.mobile-menu-phones {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--gray-light);
}

.mobile-menu-phone {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    background: var(--white);
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
}

.mobile-menu-phone:active {
    background: var(--accent-color);
    color: var(--white);
}

.mobile-lang {
    padding: 12px;
    background: var(--white);
    display: flex;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid var(--gray-border);
}

.mobile-lang .lang-btn {
    padding: 6px 18px;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 100px;
}

.mobile-lang .lang-btn.active {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}

/* ===== MOBILE CONTACT POPUP ===== */
.mobile-phone-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 50px 25px 30px;
    display: none;
    flex-direction: column;
    gap: 15px;
    z-index: 2001;
    width: 90%;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.mobile-phone-dropdown.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.phone-popup-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
}

.mobile-phone-dropdown .close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gray-light);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--secondary-color);
}

.mobile-phone-dropdown .close-popup svg {
    width: 16px;
    height: 16px;
}

.mobile-phone-dropdown a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 16px 20px;
    background: var(--gray-light);
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-phone-dropdown a svg {
    width: 20px;
    height: 20px;
    color: var(--accent-color);
}

.mobile-phone-dropdown a:active {
    background: var(--accent-color);
    color: var(--white);
    transform: scale(0.98);
}

.mobile-phone-dropdown a:active svg {
    color: var(--white);
}

.mobile-phone-dropdown a[href^="mailto"] {
    background: var(--accent-color);
    color: var(--white);
}

.mobile-phone-dropdown a[href^="mailto"] svg {
    color: var(--white);
}

/* ===== RESPONSIVE NAVIGATION OPTIMIZATION ===== */
@media (min-width: 1025px) and (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .navbar {
        gap: 20px;
    }
    
    .nav-menu {
        gap: 12px;
    }
    
    .nav-link {
        font-size: 11px;
        letter-spacing: 0.3px;
        padding: 35px 0;
    }
    
    .logo img {
        height: 55px;
    }
    
    .online-shop .nav-link {
        font-size: 10px;
    }
    
    .language-switcher {
        gap: 5px;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    .nav-menu {
        gap: 8px;
    }
    
    .nav-link {
        font-size: 10px;
        letter-spacing: 0.2px;
    }
    
    .mega-menu-container {
        padding: 25px 15px;
        gap: 25px;
    }
}

@media (min-width: 1025px) and (max-width: 1150px) {
    .navbar {
        gap: 15px;
    }
    
    .nav-menu {
        gap: 5px;
    }
    
    .nav-link {
        font-size: 9px;
        padding: 35px 0;
    }
    
    .logo img {
        height: 55px;
    }
    
    .dropdown-arrow {
        width: 8px;
        height: 8px;
    }
    
    .language-switcher {
        transform: scale(0.9);
    }
}

@media (min-width: 1025px) and (max-width: 1100px) {
    .navbar {
        grid-template-columns: 200px 1fr 100px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0;
    }
    
    .nav-item {
        flex: 0 0 auto;
    }
    
    .nav-link {
        padding: 20px 8px;
    }
    
    .nav-link::after {
        bottom: 18px;
    }
}

@media (min-width: 1025px) and (max-width: 1050px) {
    .nav-item:nth-child(6),
    .nav-item:nth-child(7) {
        display: none;
    }
    
    .nav-menu {
        gap: 10px;
    }
    
    .nav-link {
        font-size: 10px;
    }
}

@media (min-width: 1025px) and (max-width: 1200px) {
    .mega-menu-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
        margin: 0 auto;
    }
    
    .mega-menu-column {
        padding: 10px;
    }
    
    .mega-menu-column h3 {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .mega-menu-column ul li a {
        font-size: 13px;
        padding: 2px 0;
    }
}

@media (min-width: 1280px) and (max-width: 1400px) {
    .nav-menu {
        gap: 18px;
    }
    
    .nav-link {
        font-size: 12px;
    }
}

@media (min-width: 1400px) {
    .nav-menu {
        gap: 22px;
    }
    
    .nav-link {
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .nav-menu {
        gap: 15px;
    }
    
    .nav-link {
        font-size: 12px;
    }
    
    .mega-menu-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== MOBILE HEADER LAYOUT ===== */
@media (max-width: 1024px) {
    .header-spacer {
        height: var(--mobile-header-height);
    }
    
    .header-wrapper.scrolled {
        transform: none;
    }
    
    .pre-header {
        display: none;
    }
    
    .nav-menu {
        display: none;
    }
    
    .language-switcher {
        display: none;
    }
    
    .header {
        height: var(--mobile-header-height);
    }
    
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: var(--mobile-header-height);
        padding: 0 15px;
        gap: 0;
        position: relative;
    }
    
    .burger-menu {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        gap: 4px;
        position: relative;
        z-index: 10;
    }
    
    .burger-menu span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--primary-color);
        transition: all 0.3s ease;
        border-radius: 2px;
        pointer-events: none;
    }
    
    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translateY(6px);
    }
    
    .burger-menu.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }
    
    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-6px);
    }
    
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 5;
    }
    
    .logo img {
        height: 55px;
    }
    
    .mobile-phone {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        color: var(--primary-color);
        position: relative;
        z-index: 10;
    }
    
    .mobile-phone svg {
        width: 22px;
        height: 22px;
        pointer-events: none;
    }
    
    .mega-menu {
        display: none !important;
    }
    
    .mobile-menu {
        display: flex;
    }
    
    .mobile-nav li {
        display: block !important;
    }
}

/* Mobile menu height adaptations */
@media (max-height: 700px) {
    .mobile-menu-header {
        padding: 20px;
        min-height: 70px;
    }
    
    .mobile-menu-logo {
        height: 55px;
    }
    
    .mobile-nav a {
        padding: 12px 20px;
        font-size: 12px;
    }
    
    .mobile-menu-phones {
        padding: 10px;
    }
    
    .mobile-menu-phone {
        padding: 8px;
        font-size: 12px;
    }
    
    .mobile-lang {
        padding: 10px;
    }
    
    .mobile-lang .lang-btn {
        padding: 5px 15px;
        font-size: 10px;
    }
}

@media (max-height: 600px) {
    .mobile-menu-header {
        padding: 15px;
        min-height: 60px;
    }
    
    .mobile-menu-logo {
        height: 55px;
        margin-bottom: 5px;
    }
    
    .mobile-nav a {
        padding: 10px 20px;
        font-size: 11px;
    }
    
    .mobile-nav li:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-phones {
        flex-direction: row;
        gap: 5px;
        padding: 8px;
    }
    
    .mobile-menu-phone {
        padding: 8px 10px;
        font-size: 11px;
        flex: 1;
    }
}

@media (max-height: 500px) {
    .mobile-nav a {
        padding: 8px 20px;
        font-size: 10px;
    }
    
    .mobile-menu-header {
        min-height: 50px;
        padding: 10px;
    }
    
    .mobile-menu-logo {
        height: 55px;
    }
    
    .mobile-nav li:nth-child(6),
    .mobile-nav li:nth-child(7) {
        display: none;
    }
}

@media (min-height: 800px) {
    .mobile-menu-header {
        padding: 30px 20px;
        min-height: 100px;
    }
    
    .mobile-menu-logo {
        height: 55px;
    }
    
    .mobile-nav a {
        padding: 18px 25px;
        font-size: 14px;
    }
    
    .mobile-menu-phones {
        padding: 20px;
    }
    
    .mobile-menu-phone {
        padding: 14px;
        font-size: 14px;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .mobile-menu {
        height: -webkit-fill-available;
    }
}

/* Fix width on very small screens */
@media (max-width: 320px) {
    .mobile-menu {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .navbar {
        height: 55px;
        padding: 0 10px;
    }
    
    .logo img {
        height: 55px;
    }
    
    .burger-menu,
    .mobile-phone {
        width: 40px;
        height: 40px;
    }
    
    .burger-menu span {
        width: 20px;
    }
    
    .mobile-phone svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-menu {
        width: 85%;
        max-width: 300px;
    }
}

/* Smooth transitions */
.nav-menu,
.nav-link,
.logo img {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sticky header adjustments */
.header-wrapper.scrolled .header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}