/* ozerny-header.css – Премиальные стили для хедера Озёрного края */
:root {
    --lake-blue: #014779;
    --teal: #01796F;
    --forest-green: #017933;
    --berry-purple: #790147;
    --raspberry: #c41e3a;
    --strawberry: #fc4a6c;
    --header-top-height: 95px;
    --header-bottom-height: 50px;
    --header-total-height: 145px;
    --border-radius: 8px;
    /* Премиальная кривая ускорения для всех анимаций (как у Apple) */
    --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Плавное появление хедера при загрузке */
@keyframes slideDownFade {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--lake-blue);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    animation: slideDownFade 0.6s var(--ease-premium) forwards;
}

.header-top {
    height: var(--header-top-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ИСПРАВЛЕНО: space-between вместо flex-start, ширина 1280px как на всём сайте */
.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- ЛОГОТИП --- */
.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.4s var(--ease-bounce);
}

.brand:hover {
    transform: scale(1.02);
}

.logo {
    line-height: 0;
}

.logo i {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: all 0.4s var(--ease-bounce);
}

.brand:hover .logo i {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 4px 8px rgba(252, 74, 108, 0.4));
}

.brand-text {
    display: flex;
    flex-direction: column;
    color: white;
}

.brand-name {
    font-family: 'Cormorant Unicase', 'PT Serif', serif;
    font-size: clamp(20px, 4vw, 31px);
    font-weight: 700;
    line-height: 1.2;
}

.brand-sub {
    font-size: clamp(10px, 2vw, 16px);
    font-weight: 300;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.brand:hover .brand-sub {
    opacity: 1;
}

/* --- ПРАВАЯ ЧАСТЬ --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    margin-left: 30px;
}

/* --- КНОПКА КАТАЛОГА --- */
.catalog-wrapper {
    position: relative;
    flex-shrink: 0;
}

.catalog-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 18px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s var(--ease-premium);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Эффект блика при наведении */
.catalog-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.catalog-btn:hover::before {
    left: 100%;
}

.catalog-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.catalog-btn svg {
    transition: transform 0.4s var(--ease-bounce);
}

.catalog-btn:hover svg {
    transform: rotate(90deg);
}

/* --- ВЫПАДАЮЩИЕ СПИСКИ (Каскадная анимация) --- */
.catalog-dropdown, .more-dropdown-content, .burger-dropdown {
    position: absolute;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transition: all 0.3s var(--ease-premium);
    z-index: 1001;
    padding: 8px 0;
    border: 1px solid rgba(0,0,0,0.05);
}

.catalog-dropdown {
    top: calc(100% + 10px);
    left: 0;
    min-width: 260px;
}

.catalog-dropdown.show, .more-dropdown-content.show, .burger-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.catalog-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #1e293b;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    /* Для каскадного появления */
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s var(--ease-premium);
}

/* Каскадная задержка для пунктов меню */
.catalog-dropdown.show a { opacity: 1; transform: translateX(0); }
.catalog-dropdown.show a:nth-child(1) { transition-delay: 0.05s; }
.catalog-dropdown.show a:nth-child(2) { transition-delay: 0.1s; }
.catalog-dropdown.show a:nth-child(3) { transition-delay: 0.15s; }
.catalog-dropdown.show a:nth-child(4) { transition-delay: 0.2s; }
.catalog-dropdown.show a:nth-child(5) { transition-delay: 0.25s; }
.catalog-dropdown.show a:nth-child(6) { transition-delay: 0.3s; }
.catalog-dropdown.show a:nth-child(7) { transition-delay: 0.35s; }
.catalog-dropdown.show a:nth-child(8) { transition-delay: 0.4s; }

.catalog-dropdown a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--strawberry);
    border-radius: 0 4px 4px 0;
    transition: height 0.2s var(--ease-premium);
}

.catalog-dropdown a:hover {
    background: #f8fafc;
    color: var(--raspberry);
    padding-left: 24px;
}

.catalog-dropdown a:hover::before {
    height: 60%;
}

.catalog-dropdown i {
    width: 20px;
    color: var(--teal);
    transition: transform 0.3s var(--ease-bounce);
}

.catalog-dropdown a:hover i {
    transform: scale(1.2);
}

/* --- ПОИСК --- */
.search-form {
    flex: 1;
    max-width: 500px;
}

.search-wrapper {
    display: flex;
    background: rgba(255,255,255,0.95);
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.3s var(--ease-premium);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid transparent;
}

.search-wrapper:focus-within {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(1, 121, 111, 0.15);
    border-color: var(--teal);
    background: white;
}

.search-wrapper input {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
}

.search-wrapper button {
    background: transparent;
    border: none;
    padding: 0 20px;
    color: var(--lake-blue);
    font-weight: 600;
    cursor: pointer;
    border-left: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.search-wrapper button:hover {
    background: rgba(1, 121, 111, 0.05);
    color: var(--teal);
}

/* --- ИКОНКИ ПОЛЬЗОВАТЕЛЯ --- */
.user-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 12px;
    position: relative;
    border-radius: 8px;
    transition: all 0.3s var(--ease-premium);
}

.icon-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.icon-btn i {
    font-size: 20px;
    transition: transform 0.3s var(--ease-bounce);
}

.icon-btn:hover i {
    transform: scale(1.15);
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--strawberry);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes subtleBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

.cart-badge.bounce {
    animation: subtleBounce 0.4s var(--ease-bounce);
}

/* --- БУРГЕР --- */
.burger-menu {
    display: none;
    position: relative;
}

.burger-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.burger-btn:hover {
    background: rgba(255,255,255,0.1);
}

.burger-dropdown {
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
}

.burger-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #1e293b;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.burger-dropdown a:hover {
    background: #f8fafc;
    color: var(--raspberry);
    padding-left: 24px;
}

/* --- НИЖНЕЕ МЕНЮ (РАВНОМЕРНОЕ И ЕДИНЫЙ СТИЛЬ) --- */
.header-bottom {
    height: var(--header-bottom-height);
    background: rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.header-bottom .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.bottom-nav ul {
    display: flex;
    list-style: none;
    gap: 0;
    width: 100%;
    justify-content: center; /* Строго по центру, равномерно */
    align-items: center;
    margin: 0;
    padding: 0;
}

.bottom-nav li {
    position: relative;
}

/* ЕДИНЫЙ СТИЛЬ ДЛЯ ВСЕХ ПУНКТОВ, ВКЛЮЧАЯ "ЕЩЁ" */
.bottom-nav a,
.bottom-nav .more-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s var(--ease-premium);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

/* Анимация подчёркивания из центра */
.bottom-nav a::before,
.bottom-nav .more-btn::before {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--strawberry);
    transition: all 0.3s var(--ease-premium);
    transform: translateX(-50%);
}

.bottom-nav a:hover,
.bottom-nav .more-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.bottom-nav a:hover::before,
.bottom-nav .more-btn:hover::before {
    width: 60%;
}

.more-btn i {
    font-size: 12px;
    transition: transform 0.4s var(--ease-bounce);
}

.more-btn:hover i {
    transform: rotate(180deg);
}

.more-dropdown-content {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.98);
    min-width: 200px;
}

.more-dropdown-content.show {
    transform: translateX(-50%) translateY(0) scale(1);
}

.more-dropdown-content a {
    display: block;
    padding: 12px 20px;
    color: #1e293b;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.more-dropdown-content a:hover {
    background: #f8fafc;
    color: var(--raspberry);
    padding-left: 24px;
}

body {
    padding-top: var(--header-total-height);
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 992px) {
    .search-form {
        display: none;
    }
    .header-right {
        margin-left: 15px;
    }
    .bottom-nav a,
    .bottom-nav .more-btn {
        font-size: 15px;
        padding: 10px 14px;
    }
}

@media (max-width: 768px) {
    .brand-text {
        display: none;
    }
    .catalog-btn span {
        display: none;
    }
    .catalog-btn svg {
        width: 24px;
        height: 24px;
    }
    .catalog-btn {
        padding: 10px;
    }
    .user-icons .icon-btn span {
        display: none;
    }
    .user-icons .icon-btn {
        padding: 8px;
    }
    .user-icons .icon-btn i {
        font-size: 22px;
    }
    .header-bottom {
        display: none;
    }
    .burger-menu {
        display: block;
        margin-left: auto;
    }
    body {
        padding-top: 95px;
    }
}