/* ================================================
   HEADER STYLES
   ================================================ */

/* Топ-бар */
.header-topbar {
    background: #0f3460;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    padding: 7px 0;
}
.header-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar-left { display: flex; align-items: center; gap: 6px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
    font-size: 13px;
}
.topbar-right a:hover { color: #f7c948; }

/* Основной хедер */
.header {
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.header-main {
    display: flex;
    align-items: center;
    height: 68px;
    gap: 20px;
}

/* Логотип */
.header-logo { flex-shrink: 0; }
.header-logo img { height: 38px; width: auto; display: block; }
.header-logo span {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #0f3460, #e94560);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Desktop навигация */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.nav-item { position: relative; }
.nav-link-main {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
.nav-link-main:hover,
.nav-item:hover > .nav-link-main {
    background: #f1f5f9;
    color: #0f3460;
}
.nav-link-main .arrow {
    font-size: 10px;
    opacity: 0.5;
    transition: transform 0.2s;
}
.nav-item:hover > .nav-link-main .arrow { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.14);
    min-width: 200px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s;
    z-index: 200;
    border: 1px solid #f1f5f9;
}
.nav-item:hover > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown элементы */
.drop-item { position: relative; }
.drop-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}
.drop-link:hover { background: #f1f5f9; color: #0f3460; }
.drop-link .sub-arrow { font-size: 10px; opacity: 0.4; }

/* Submenu */
.sub-dropdown {
    position: absolute;
    top: 0;
    left: calc(100% + 6px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.14);
    min-width: 170px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition: all 0.2s;
    z-index: 201;
    border: 1px solid #f1f5f9;
}
.drop-item:hover > .sub-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}
.sub-link {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}
.sub-link:hover { background: #f1f5f9; color: #0f3460; padding-left: 18px; }
.drop-divider { height: 1px; background: #f1f5f9; margin: 4px 0; }

/* Поиск */
.header-search { flex: 1; max-width: 260px; }
.header-search .search-input {
    padding: 9px 36px 9px 36px !important;
    font-size: 13.5px !important;
    border-radius: 20px !important;
}

/* Правая часть хедера */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.header-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 20px;
    text-decoration: none;
    transition: background 0.2s;
    color: #374151;
}
.header-cart:hover { background: #f1f5f9; }
.cart-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}
.cart-badge.active { display: flex; }

/* Бургер */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: #0f3460;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    padding: 10px;
    flex-shrink: 0;
}
.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}
.burger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ================================================
   МОБИЛЬНОЕ МЕНЮ
   ================================================ */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    backdrop-filter: blur(3px);
}
.mobile-overlay.active { display: block; }

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 1200;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,0.2);
}
.mobile-menu.active { right: 0; }

/* Шапка мобильного меню */
.mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #0f3460;
    flex-shrink: 0;
}
.mobile-menu-head span {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}
.mobile-close {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.mobile-close:hover { background: rgba(255,255,255,0.25); }

/* Мобильные ссылки */
.mobile-links {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}
.mob-link {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    transition: background 0.2s;
    gap: 10px;
}
.mob-link:hover { background: #f8fafc; }
.mob-link .mob-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }

/* Аккордеон в мобильном */
.mob-accordion { border-bottom: 1px solid #f1f5f9; }
.mob-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 20px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    gap: 10px;
}
.mob-accordion-btn:hover { background: #f8fafc; }
.mob-accordion-btn .mob-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.mob-accordion-btn .mob-arrow {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.25s;
    margin-left: auto;
}
.mob-accordion-btn.open .mob-arrow { transform: rotate(180deg); }

.mob-accordion-body {
    display: none;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.mob-accordion-body.open { display: block; }

/* Подменю брендов */
.mob-brand {
    border-bottom: 1px solid #f1f5f9;
}
.mob-brand-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 20px 11px 36px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.mob-brand-btn:hover { background: #f1f5f9; color: #0f3460; }
.mob-brand-btn .arrow { font-size: 10px; color: #9ca3af; transition: transform 0.2s; }
.mob-brand-btn.open .arrow { transform: rotate(180deg); }

.mob-brand-links {
    display: none;
    background: #fff;
}
.mob-brand-links.open { display: block; }
.mob-brand-link {
    display: block;
    padding: 10px 20px 10px 52px;
    font-size: 13.5px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid #f9fafb;
}
.mob-brand-link:hover { color: #0f3460; background: #eff6ff; padding-left: 58px; }

/* Все бренды ссылка */
.mob-all-link {
    display: block;
    padding: 11px 20px 11px 36px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 1px solid #f1f5f9;
}
.mob-all-link:hover { background: #f1f5f9; color: #0f3460; }

/* Низ мобильного меню */
.mobile-menu-foot {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    flex-shrink: 0;
}
.mob-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #0f3460;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: background 0.2s;
}
.mob-phone:hover { background: #1e4d8c; }
.mob-cart-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: #fff;
    border: 2px solid #0f3460;
    color: #0f3460;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.mob-cart-link:hover { background: #0f3460; color: #fff; }

/* ================================================
   АДАПТИВНОСТЬ
   ================================================ */
@media (max-width: 1024px) {
    .header-nav .nav-link-main { padding: 7px 9px; font-size: 13.5px; }
    .header-search { max-width: 200px; }
}

@media (max-width: 860px) {
    .header-nav    { display: none; }
    .header-topbar { display: none; }
    .burger-btn    { display: flex !important; }
    .header-main   { height: 60px; }
    /* Поиск остаётся виден — сжимается между лого и кнопками */
    .header-search { max-width: none !important; flex: 1; min-width: 0; }
    .header-search .search-input { font-size: 14px !important; padding: 8px 34px !important; }
}

@media (max-width: 480px) {
    .header-logo img { height: 32px; }
}