/* ==========================================================================
   FOUNDATION — Design Tokens, Resets & Shared Utilities
   (Moved from home.css so header.css is fully self-contained)
   ========================================================================== */

:root {
    --color-primary: #001a3a;
    --color-primary-2: #06264f;
    --color-primary-3: #0a356f;
    --color-accent: #0b4edb;
    --color-accent-hover: #083ca8;
    --color-text-dark: #071833;
    --color-text-main: #17243a;
    --color-text-muted: #64748b;
    --color-bg-light: #f3f6fa;
    --color-bg-panel: #f7f9fc;
    --color-bg-dark: #001126;
    --color-border: #dbe3ef;
    --color-border-strong: #c7d2e3;
    --font-family: 'Inter', sans-serif;
    --container: 100%;
    --shadow-sm: 0 6px 18px rgba(0, 26, 58, 0.06);
    --shadow-md: 0 14px 34px rgba(0, 26, 58, 0.10);
    --shadow-lg: 0 24px 56px rgba(0, 26, 58, 0.16);
    --transition-smooth: all 0.28s cubic-bezier(0.23, 1, 0.32, 1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--color-text-dark);
    background: #ffffff;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-left: clamp(20px, 4vw, 80px);
    padding-right: clamp(20px, 4vw, 80px);
}

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

.w-full {
    width: 100%;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 32px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.btn i {
    font-size: 13px;
    transition: transform 0.25s ease;
}

.btn:hover i {
    transform: translateX(4px);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #ffffff;
    background: var(--color-primary);
    box-shadow: 0 10px 24px rgba(147, 183, 227, 0.16);
}

.btn-primary:hover {
    background: var(--color-primary-2);
    box-shadow: 0 14px 32px rgba(63, 132, 216, 0.22);
}

.btn-accent {
    color: #ffffff;
    background: var(--color-accent);
    box-shadow: 0 12px 28px rgba(11, 78, 219, 0.22);
}

.btn-accent:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 16px 36px rgba(11, 78, 219, 0.28);
}

.btn-outline {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.44);
    background: rgba(0, 20, 44, 0.22);
    backdrop-filter: blur(3px);
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.74);
    background: rgba(255, 255, 255, 0.10);
}

/* ==========================================================================
   TOP BAR AND NAVIGATION
   ========================================================================== */

.top-bar {
    min-height: 34px;
    color: rgba(255, 255, 255, 0.84);
    background: #000d20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.top-bar .container {
    min-height: 34px;
}

.location-selector,
.top-contacts,
.contact-item {
    display: flex;
    align-items: center;
}

.location-selector {
    gap: 8px;
    font-weight: 600;
}

.location-selector i,
.contact-item i {
    color: #9dbaf2;
}

.top-contacts {
    gap: 34px;
}

.contact-item {
    gap: 9px;
    transition: color 0.22s ease;
}

.contact-item:hover {
    color: #ffffff;
}

.main-header {
    position: relative;
    z-index: 100;
    height: clamp(72px, 5.2vw, 100px);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 18, 43, 0.06);
    transition: box-shadow 0.3s ease;
}

/* Sticky state: triggered by JS scroll listener adding .is-sticky */
.main-header.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 4px 20px rgba(0, 18, 43, 0.12);
}

/* Compensate body offset when header is sticky so content doesn't jump */
body.header-is-sticky {
    padding-top: clamp(72px, 5.2vw, 100px);
}

.main-header > .container {
    height: 100%;
    max-width: 2560px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    flex-shrink: 0;
}

.logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--color-primary);
    box-shadow: 0 12px 24px rgba(0, 26, 58, 0.16);
}

.logo-shape {
    position: relative;
    width: 24px;
    height: 24px;
    border: 3px solid #ffffff;
    transform: rotate(45deg);
}

.logo-shape::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--color-accent);
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    color: var(--color-primary);
    font-size: 28px;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.brand-sub {
    color: var(--color-primary-2);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

/* Header logo: aligned with factory.html image + two-line text structure */
.main-header .logo {
    display: flex;
    align-items: center;
    gap: clamp(10px, 0.8vw, 20px);
    flex: 0 0 auto;
    flex-shrink: 0;
}

.main-header .logo-icon {
    width: clamp(72px, 5.5vw, 120px);
    height: clamp(72px, 5.5vw, 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--color-accent);
    overflow: visible;
}

.main-header .logo-icon svg,
.main-header .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.main-header .logo-text {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.2;
}

.main-header .logo-name {
    color: var(--color-primary);
    font-size: clamp(1.2rem, 1.3vw, 2rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.5px;
}

.main-header .logo-tagline {
    color: var(--color-text-muted);
    font-size: clamp(0.72rem, 0.65vw, 1rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 1.6vw, 48px);
    margin-left: auto;
    margin-right: clamp(16px, 1.4vw, 40px);
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 82px;
    color: var(--color-text-main);
    font-size: clamp(14px, 0.85vw, 18px);
    font-weight: 600;
    transition: color 0.24s ease;
    gap: 6px;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(18px, 1.6vw, 30px);
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Navigation dropdown */
.nav-item-dropdown {
    position: relative;
}

.nav-arrow {
    font-size: 10px;
    transition: transform 0.24s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-item-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    z-index: 110;
    min-width: 240px;
    padding: 12px 0;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.25s ease, visibility 0.25s ease;
}

.nav-item-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(10px);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--color-text-main);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.dropdown-item:hover {
    color: var(--color-accent);
    background: var(--color-bg-light);
    padding-left: 24px;
}

.dropdown-item.active {
    color: var(--color-accent);
    background: rgba(11, 78, 219, 0.05);
    font-weight: 600;
}

/* Language selector */
.lang-selector {
    position: relative;
    margin-right: clamp(16px, 1.2vw, 32px);
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: clamp(36px, 2.4vw, 48px);
    padding: 0 clamp(12px, 0.9vw, 20px);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-main);
    font-size: clamp(13px, 0.8vw, 16px);
    font-weight: 600;
    background: #ffffff;
    transition: var(--transition-smooth);
}

.lang-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-bg-light);
}

.lang-chevron {
    font-size: 10px;
    transition: transform 0.24s ease;
}

.lang-selector.is-open .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    transform: translateY(10px);
    z-index: 110;
    min-width: 160px;
    padding: 8px 0;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.24s ease, visibility 0.24s ease;
}

.lang-selector.is-open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(4px);
}

.lang-option {
    display: block;
    padding: 8px 16px;
    color: var(--color-text-main);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: var(--transition-smooth);
}

.lang-option:hover {
    color: var(--color-accent);
    background: var(--color-bg-light);
}

.lang-option.active {
    color: var(--color-accent);
    background: rgba(11, 78, 219, 0.05);
}

.header-cta .btn {
    min-height: clamp(46px, 3vw, 62px);
    padding: 0 clamp(22px, 1.8vw, 44px);
    border-radius: 3px;
    font-size: clamp(14px, 0.85vw, 18px);
}

.mobile-menu-toggle {
    display: none;
    color: var(--color-primary);
    font-size: 24px;
}

.mobile-nav {
    position: absolute;
    top: clamp(72px, 5.2vw, 100px);
    left: 0;
    right: 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 clamp(20px, 4vw, 80px);
    background: #ffffff;
    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    /* 丝滑滑入动画 */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition:
        max-height 0.44s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.32s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.38s cubic-bezier(0.23, 1, 0.32, 1),
        padding 0.44s cubic-bezier(0.23, 1, 0.32, 1);
    /* 支持菜单内部独立滚动 */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* When header is sticky (fixed), mobile-nav must also be fixed */
.main-header.is-sticky .mobile-nav {
    position: fixed;
    top: clamp(72px, 5.2vw, 100px);
    left: 0;
    right: 0;
}

.mobile-nav.is-open {
    max-height: calc(100dvh - clamp(72px, 5.2vw, 100px));
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    padding-top: 14px;
    padding-bottom: 26px;
}

.mobile-nav-link {
    padding: 16px 0;
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--color-border);
}

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

.mobile-nav-cta {
    padding-top: 18px;
}

/* ==========================================================================
   MOBILE ACCORDION — О компании sub-menu
   ========================================================================== */

.mobile-nav-accordion {
    border-bottom: 1px solid var(--color-border);
}

.mobile-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
    background: none;
    text-align: left;
    cursor: pointer;
    padding: 16px 0;
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
}

.mobile-accordion-arrow {
    font-size: 12px;
    transition: transform 0.24s cubic-bezier(0.23, 1, 0.32, 1);
    flex-shrink: 0;
}

.mobile-accordion-toggle[aria-expanded="true"] .mobile-accordion-arrow {
    transform: rotate(180deg);
}

.mobile-accordion-panel {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    /* 丝滑展开动画 */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.36s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.26s cubic-bezier(0.23, 1, 0.32, 1),
        padding-bottom 0.36s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-accordion-panel.is-open {
    max-height: 600px;
    opacity: 1;
    padding-bottom: 8px;
}

.mobile-nav-sub-link {
    display: block;
    padding: 10px 0 10px 16px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 600;
    border-left: 2px solid var(--color-border);
    transition: color 0.22s ease, border-color 0.22s ease;
}

.mobile-nav-sub-link:hover,
.mobile-nav-sub-link.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

/* ========================================================================== 
   LARGE SCREEN ENHANCEMENTS — HEADER
   ========================================================================== */

@media (min-width: 1440px) {
    body.header-is-sticky {
        padding-top: 90px;
    }

    .main-header {
        height: 90px;
    }

    .nav-link {
        height: 90px;
        font-size: 15.5px;
    }

    .nav-link::after {
        bottom: 24px;
    }

    .desktop-nav {
        gap: 28px;
        margin-right: 28px;
    }

    .lang-selector {
        margin-right: 28px;
    }

    .lang-btn {
        height: 40px;
        padding: 0 16px;
        font-size: 14.5px;
    }

    .header-cta .btn {
        min-height: 52px;
        padding: 0 34px;
        font-size: 15px;
    }

    .main-header .logo-icon {
        width: 96px;
        height: 96px;
    }

    .main-header .logo-name {
        font-size: 1.55rem;
    }

    .main-header .logo-tagline {
        font-size: 0.9rem;
    }
}

@media (min-width: 1920px) {
    body.header-is-sticky {
        padding-top: 96px;
    }

    .main-header {
        height: 96px;
    }

    .nav-link {
        height: 96px;
        font-size: 17px;
    }

    .nav-link::after {
        bottom: 26px;
    }

    .desktop-nav {
        gap: 36px;
        margin-right: 36px;
    }

    .lang-selector {
        margin-right: 32px;
    }

    .lang-btn {
        height: 44px;
        padding: 0 18px;
        font-size: 15.5px;
    }

    .header-cta .btn {
        min-height: 56px;
        padding: 0 40px;
        font-size: 16.5px;
    }

    .main-header .logo-icon {
        width: 108px;
        height: 108px;
    }

    .main-header .logo-name {
        font-size: 1.75rem;
    }

    .main-header .logo-tagline {
        font-size: 0.95rem;
    }
}

@media (min-width: 2560px) {
    body.header-is-sticky {
        padding-top: 110px;
    }

    .main-header {
        height: 110px;
    }

    .nav-link {
        height: 110px;
        font-size: 20px;
        gap: 8px;
    }

    .nav-link::after {
        bottom: 30px;
        height: 3px;
    }

    .desktop-nav {
        gap: 48px;
        margin-right: 48px;
    }

    .lang-selector {
        margin-right: 40px;
    }

    .lang-btn {
        height: 52px;
        padding: 0 24px;
        font-size: 18px;
        border-radius: 26px;
    }

    .lang-chevron {
        font-size: 12px;
    }

    .header-cta .btn {
        min-height: 64px;
        padding: 0 52px;
        font-size: 19px;
    }

    .main-header .logo-icon {
        width: 120px;
        height: 120px;
    }

    .main-header .logo {
        gap: 18px;
    }

    .main-header .logo-name {
        font-size: 2rem;
    }

    .main-header .logo-tagline {
        font-size: 1.05rem;
        letter-spacing: 0.8px;
    }

    .nav-dropdown-menu {
        min-width: 300px;
        padding: 16px 0;
    }

    .dropdown-item {
        padding: 13px 26px;
        font-size: 17px;
    }

    .lang-dropdown {
        min-width: 160px;
    }

    .lang-option {
        padding: 11px 22px;
        font-size: 16px;
    }

    .top-bar {
        min-height: 42px;
        font-size: 15px;
    }

    .top-bar .container {
        min-height: 42px;
    }
}

/* ========================================================================== 
   RESPONSIVE — HEADER
   ========================================================================== */

@media (max-width: 1360px) {
    .desktop-nav {
        gap: 14px;
        margin-right: 14px;
    }

    .nav-link {
        font-size: 14px;
    }

    .lang-selector {
        margin-right: 14px;
    }

    .header-cta .btn {
        padding: 0 18px;
        font-size: 14px;
    }
}

@media (max-width: 1100px) {
    body.header-is-sticky {
        padding-top: 74px;
    }

    .main-header {
        height: 74px;
    }

    .desktop-nav,
    .header-cta {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-nav {
        top: 74px;
    }

    .mobile-nav.is-open {
        max-height: calc(100dvh - 74px);
    }

    .main-header.is-sticky + .mobile-nav,
    .main-header.is-sticky ~ * .mobile-nav {
        top: 74px;
    }

    .main-header.is-sticky .mobile-nav.is-open {
        max-height: calc(100dvh - 74px);
    }

    .lang-selector {
        margin-left: auto;
        margin-right: 16px;
    }

    .brand-name,
    .main-header .logo-name {
        font-size: 25px;
    }

    .logo-icon {
        width: 44px;
        height: 44px;
    }

    .main-header .logo-icon {
        width: 74px;
        height: 74px;
    }
}

@media (max-width: 640px) {
    .main-header .logo {
        gap: 8px;
    }

    .main-header .logo-icon {
        width: 58px;
        height: 58px;
    }

    .main-header .logo-name {
        font-size: 1.12rem;
    }

    .main-header .logo-tagline {
        font-size: 0.68rem;
        letter-spacing: 0.35px;
    }

    .top-contacts span {
        display: none;
    }

    .top-contacts {
        gap: 18px;
    }

    .mobile-nav {
        padding-left: 20px;
        padding-right: 20px;
    }
}
