/* ============================================================================ */
/* КОМПОНЕНТ: HEADER (ОСНОВНОЙ КОНТЕЙНЕР НАВИГАЦИИ) */
/* ============================================================================ */
.header {
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.nav {
    height: 4.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* ============================================================================ */
/* КОМПОНЕНТ: LOGO (ЛОГОТИП) */
/* ============================================================================ */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-logo img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.nav-logo:hover img {
    transform: scale(1.05);
}

/* ============================================================================ */
/* КОМПОНЕНТ: NAVIGATION MENU (ГЛАВНОЕ МЕНЮ) */
/* ============================================================================ */
.nav-menu {
    display: flex;
    align-items: center;
    z-index: 1000;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-item {
    position: relative;
    animation: slideIn 0.5s ease forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }

.nav-link {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4A90E2 0%, #2F5F8F 100%);
    border-radius: 50px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: -1;
}

/* ============================================================================ */
/* КОМПОНЕНТ: ICON LEFT (ПРАВАЯ ПАНЕЛЬ ИКОНОК) */
/* ============================================================================ */
.icon-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ============================================================================ */
/* КОМПОНЕНТ: CTA BUTTON (КНОПКА КОНСУЛЬТАЦИИ) */
/* ============================================================================ */
.nav-cta {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%) !important;
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    color: white !important;
    background: linear-gradient(135deg, #357ABD 0%, #2F5F8F 100%) !important;
}

.nav-cta svg {
    width: 20px;
    height: 20px;
    color: white !important;
}

/* ============================================================================ */
/* КОМПОНЕНТ: MOBILE TOGGLE (МОБИЛЬНАЯ КНОПКА МЕНЮ) */
/* ============================================================================ */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4A90E2;
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
}

.nav-close {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: #374151;
    cursor: pointer;
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 1001;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #ef4444;
}

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

/* ============================================================================ */
/* КОМПОНЕНТ: SEARCH BAR (СТРОКА ПОИСКА) */
/* ============================================================================ */
.search {
    --easing: cubic-bezier(0.4, 0, 0.2, 1);
    --font-size: 0.95rem;
    --color: #6b7280;
    --color-highlight: #374151;
    --transition-time-icon: 0.2s;
    --transition-time-input: 0.3s 0.25s;
    border-radius: 50px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.search:focus-within {
    border-color: #4A90E2;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search__input {
    background: transparent;
    border: none;
    color: #374151;
    font-family: var(--font-primary);
    font-size: var(--font-size);
    opacity: 0;
    outline: none;
    padding: 0;
    transition: all var(--transition-time-input) var(--easing);
    width: 0;
}

.search__input::placeholder {
    color: var(--color);
    opacity: 0.75;
}

.search__icon-container {
    height: 2.5rem;
    width: 2.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search__label {
    color: var(--color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    transition: all var(--transition-time-icon) var(--easing);
    font-size: 1.1rem;
}

.search__label svg {
    width: 30px;
    height: 30px;
    stroke-width: 2;
    color: currentColor;
}

.search__label:hover {
    color: var(--color-highlight);
}

.search__submit {
    background: none;
    border: none;
    color: var(--color-highlight);
    cursor: pointer;
    height: 100%;
    width: 100%;
    display: none;
    outline: none;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.search:focus-within .search__input {
    opacity: 1;
    padding: 0 1rem 0 1rem;
    width: 250px;
}

.search:focus-within .search__label {
    transform: scale(0.8);
}

.search:focus-within .search__submit {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================ */
/* КОМПОНЕНТ: CART (КОРЗИНА) */
/* ============================================================================ */
.cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cart:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.cart .bi-cart2 {
    font-size: 1.2rem;
    color: #374151;
    transition: color 0.3s ease;
}

.cart:hover .bi-cart2 {
    color: #4A90E2;
}

.cart .count {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-primary);
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ============================================================================ */
/* КОМПОНЕНТ: MOBILE BOTTOM NAV (НИЖНЯЯ МОБИЛЬНАЯ ПАНЕЛЬ) */
/* ============================================================================ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 70px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6b7280;
    position: relative;
    padding: 0.25rem;
    min-width: 60px;
    background: none;
    border: none;
    cursor: pointer;
}

.bottom-nav-item:hover {
    color: #4f46e5;
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 0.25rem;
}

.bottom-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: 10px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ============================================================================ */
/* ОБЩИЕ УТИЛИТЫ И КОНТЕЙНЕРЫ */
/* ============================================================================ */
.container {
    padding-left: var(--bs-gutter-x, 1rem) !important;
    padding-right: var(--bs-gutter-x, 1rem) !important;
}

.container-medium {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ============================================================================ */
/* АНИМАЦИИ И ЭФФЕКТЫ */
/* ============================================================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================ */
/* АДАПТИВНОСТЬ */
/* ============================================================================ */
@media screen and (max-width: 1024px) {
    .nav {
        padding: 0 1.5rem;
    }

    .nav-list {
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .nav-cta {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 768px) {
    .nav {
        height: 4rem;
        padding: 0 1rem;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        padding: 6rem 2rem 2rem;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .nav-menu.show-menu {
        left: 0;
    }

    .nav-close {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 3rem;
        text-align: center !important;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
        width: 100%;
        text-align: center !important;
        justify-content: center !important;
        border-radius: 12px;
        border-left: none !important;
    }

    .nav-cta {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        margin-top: 1rem;
    }

    .icon-left {
        gap: 0.75rem;
    }

    .nav-logo img {
        height: 50px !important;
        width: 50px !important;
    }

    .header,
    .nav,
    .nav-logo,
    .nav-menu {
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
        -moz-box-shadow: none !important;
    }

    body {
        padding-bottom: 70px;
    }

    .search {
        display: flex !important; /* Принудительно показываем */
    }

    /* Адаптируем размеры для мобильных */
    .search__icon-container {
        height: 2rem;
        width: 2rem;
    }

    .search__label {
        font-size: 1rem;
    }

    .search__label svg {
        width: 25px;
        height: 25px;
    }

    .search:focus-within .search__input {
        width: calc(100vw - 80px); /* На всю ширину экрана минус отступы */
        max-width: 300px; /* Ограничиваем максимальную ширину */
    }
}

@media screen and (max-width: 480px) {
    .nav {
        padding: 0 1rem;
    }

    .nav-logo img {
        width: 40px;
        height: 40px;
    }

    .search:focus-within .search__input {
        width: auto;
    }

    .cart {
        width: 2.25rem;
        height: 2.25rem;
    }

    .cart .bi-cart2 {
        font-size: 1.1rem;
    }

    .search:focus-within .search__input {
        width: calc(100vw - 60px);
        max-width: 250px;
    }

    .search__icon-container {
        height: 1.8rem;
        width: 1.8rem;
    }

    .search__label svg {
        width: 20px;
        height: 20px;
    }
}
