/* ===============================
   MOBILE-FIRST HEADER
================================ */
header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;

    background: #fff;
    color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);

    transition: box-shadow .2s ease;
}

header.menu-open {
    box-shadow: none;
}

/* Header container - ограничивает контент до 1400px */
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px;

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

@media (min-width: 768px) {
    .header-container {
        padding: 20px 40px;
    }
}

/* ===============================
   LOGO
================================ */
.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

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

/* На десктопе логотип возвращается на место */
@media (min-width: 992px) {
    .logo {
        position: static;
        transform: none;
    }
}

/* ===============================
   PHONE ICONS
================================ */
.phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

.phone svg {
    width: 25px;
    height: 25px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.phone-icon-desktop {
    width: 25px;
    height: 25px;
    stroke: currentColor;
    stroke-width: 2;
    fill: currentColor;
}

.desktop-phone {
    display: none;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

@media (min-width: 992px) {
    .phone {
        display: none;
    }

    .desktop-phone {
        display: inline-flex;
        margin-right: 20px;
    }
}

/* ===============================
   BURGER MENU
================================ */
.burger {
    width: 28px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 101;
}

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

.burger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===============================
   CTA BUTTON
================================ */
.cta {
    display: none;
    padding: 10px 18px;
    background: #c00;
    color: #fff;
    border-radius: 20px ;
    font-weight: 700;
    cursor: pointer;
    transition: background .25s, color .25s;
}

.cta:hover {
        filter:brightness(.96);
    }


/* ===============================
   DESKTOP NAVIGATION
================================ */
.desktop-nav {
    display: none;
}

@media (min-width: 992px) {
    .burger {
        display: none;
    }

    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 28px;
        margin-inline: auto;
    }

    .desktop-nav ul {
        list-style: none;
        display: flex;
        gap: 28px;
        align-items: center;
        margin: 0;
        padding: 0;
    }

    .desktop-nav a,
    .dropdown-toggle {
        color: inherit;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.95rem;
        cursor: pointer;
        transition: opacity .2s;
    }

    .desktop-nav a:hover {
        opacity: 0.7;
    }

    .cta {
        display: inline-block;
    }
}

/* ===============================
   DROPDOWN BASIC STYLES
================================ */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.arrow-down {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.dropdown.open .arrow-down {
    transform: rotate(-135deg);
}

/* ===============================
   DROPDOWN MENU
================================ */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 27px);
    left: 50%;
    transform: translateX(-50%);

    min-width: 240px;
    width: max-content;

    background: #fff;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);

    padding: 12px 0;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity .2s ease, visibility .2s ease;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Двухколоночное меню */
.dropdown-menu.two-columns {
    max-width: 500px;
}

.two-columns-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.two-columns-grid a {
    padding: 10px 20px;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: background .2s, color .2s;
}

/* ===============================
   NESTED DROPDOWN (About > Brands)
================================ */
.dropdown-submenu {
    position: relative;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
    padding-top: 8px;
}

/* Мостик для предотвращения закрытия меню */
.dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 32px; /* Равно gap между header и dropdown-menu */
    background: transparent;
    pointer-events: auto;
}

.dropdown-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    transition: background .2s;
}

.dropdown-submenu-toggle:hover {
    background: #f5f5f5;
}

.dropdown-submenu-toggle .arrow-down {
    width: 6px;
    height: 6px;
}

.dropdown-submenu.open .dropdown-submenu-toggle .arrow-down {
    transform: rotate(-135deg);
}

/* ===============================
   BRANDS MEGA MENU
================================ */
.dropdown-submenu-content {
    position: absolute;
    left: 100%;
    top: 0;

    min-width: 800px;
    width: max-content;
    max-width: 90vw;

    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);

    padding: 28px;
    margin-left: 8px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity .2s ease, visibility .2s ease;
}

.dropdown-submenu.open .dropdown-submenu-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mega-grid-brands {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 24px;
}

.brand-column {
    display: flex;
    flex-direction: column;
}

.mega-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #000;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.mega-section {
    margin-top: 20px;
}

.mega-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mega-list a {
    padding: 6px 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: #555;
    transition: color .2s;
}

.mega-list a:hover {
    background: transparent;
    color: #000;
    font-weight: 500;
}

/* ===============================
   MOBILE MENU
================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;

    z-index: 90;

    background: rgba(255,255,255,0.99);
    color: #000;
    padding: 90px 22px 22px;

    transform: translateX(100%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;

    -webkit-overflow-scrolling: touch;
    transition: transform .35s ease, opacity .35s ease, visibility 0s .35s;
}

.mobile-menu.open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: transform .35s ease, opacity .35s ease, visibility 0s;
}

.mobile-menu__list {
    list-style: none;
    max-width: 440px;
    margin: 0 auto;
    padding: 0;
}

.mobile-item {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 4px;
    text-decoration: none;
    color: #000;
    font-size: 1.15rem;
    font-weight: 600;
}

.mobile-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .25s;
}

.mobile-accordion.open > .mobile-link .mobile-arrow {
    transform: rotate(-135deg);
}

.mobile-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.mobile-panel a {
    display: block;
    padding: 12px 0 12px 12px;
    text-decoration: none;
    color: #000;
    font-weight: 500;
    font-size: 1rem;
}

/* ===============================
   MOBILE SUB-ACCORDION (Level 2)
================================ */
.mobile-subaccordion {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.mobile-sublink {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px;
    cursor: pointer;
    font-weight: 500;
    color: #000;
}

.mobile-sublink .mobile-arrow {
    width: 8px;
    height: 8px;
}

.mobile-subaccordion.open > .mobile-sublink .mobile-arrow {
    transform: rotate(-135deg);
}

.mobile-accordion.open .mobile-subaccordion:not(.open) > .mobile-sublink .mobile-arrow {
    transform: rotate(45deg);
}

.mobile-subpanel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    padding-left: 14px;
}

.mobile-subpanel a {
    display: block;
    padding: 10px 0;
    color: #000;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
}

/* ===============================
   MOBILE BRAND ACCORDION (Level 3)
================================ */
.mobile-brand-accordion {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mobile-brand-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    cursor: pointer;
    font-weight: 500;
    color: #000;
    font-size: 0.95rem;
}

.mobile-brand-link .mobile-arrow {
    width: 7px;
    height: 7px;
}

.mobile-brand-accordion.open > .mobile-brand-link .mobile-arrow {
    transform: rotate(-135deg);
}

.mobile-brand-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    padding-left: 12px;
}

.mobile-brand-panel a {
    display: block;
    padding: 8px 0;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
}

/* ===============================
   MOBILE CTA
================================ */
.mobile-cta {
    display: block;
    margin: 18px auto 0;
    padding: 12px 20px;
    border-radius: 22px;
    background:#c00;
    color:#fff;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    max-width: 240px;
    width: 100%;
    text-align: center;
}

/* ===============================
   TAP HIGHLIGHT REMOVAL
================================ */
.mobile-sublink,
.mobile-subpanel a,
.mobile-brand-link,
.mobile-brand-panel a {
    -webkit-tap-highlight-color: transparent;
}

/* ===============================
   DESKTOP MEDIA QUERY
================================ */
@media (min-width: 992px) {
    .mobile-menu {
        display: none;
    }
}
