/* ===== ОБНОВЛЕННЫЙ HEADER.CSS ===== */

header {
    background: linear-gradient(to bottom, #f8f2e6, #f0e6d4);
    padding: 0;
    width: 100%;
    box-shadow: 0 2px 10px rgba(92, 61, 9, 0.1);
    border-bottom: 2px solid #e6d6b5;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.headerBlock {
    text-align: center;
    padding: 0.5rem 0;
    background: rgba(176, 136, 65, 0.1);
}

    .headerBlock a {
        text-decoration: none;
        color: #5c3d09;
        font-size: 1rem;
        font-weight: 500;
        transition: all 0.3s ease;
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }

        .headerBlock a:hover {
            background-color: rgba(176, 136, 65, 0.2);
            transform: translateY(-2px);
            text-decoration: none;
            color: #3a2606;
        }

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo img {
    max-width: 180px;
    height: auto;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Основная навигация для десктопа */
.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    text-decoration: none;
    color: #5c3d09;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    position: relative;
}

    .main-nav a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: #e6b236;
        transition: width 0.3s ease;
    }

    .main-nav a:hover {
        color: #e6b236;
    }

        .main-nav a:hover::after {
            width: 100%;
        }

    /* Стили для активной ссылки */
    .main-nav a.active {
        color: #e6b236;
        font-weight: 600;
    }

        .main-nav a.active::after {
            width: 100%;
        }

/* Иконка корзины */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 2rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d9534f;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Гамбургер меню - скрыто по умолчанию */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1002;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: #5c3d09;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Сайд-панель */
.side-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: linear-gradient(to bottom, #f8f2e6, #f0e6d4);
    box-shadow: -5px 0 15px rgba(92, 61, 9, 0.3);
    transition: right 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
    padding: 2rem 0;
}

    .side-panel.active {
        right: 0;
    }

/* Затемнение фона */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

    .overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Заголовок сайд-панели */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid #e6d6b5;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #5c3d09;
    margin: 0;
}

.close-panel {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #5c3d09;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

    .close-panel:hover {
        background-color: rgba(176, 136, 65, 0.2);
    }

/* Навигация в сайд-панели */
.side-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-nav li {
    margin: 0;
}

.side-nav a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #5c3d09;
    font-weight: 500;
    border-bottom: 1px solid rgba(176, 136, 65, 0.2);
    transition: all 0.3s ease;
    gap: 0.5rem;
}

    .side-nav a:hover {
        background-color: rgba(176, 136, 65, 0.2);
        color: #3a2606;
        padding-left: 2rem;
    }

.side-nav .cart-icon {
    margin-left: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(176, 136, 65, 0.2);
}

.side-nav .cart-count {
    top: 8px;
    right: auto;
    left: 2.5rem;
}

/* Анимация гамбургера при активации */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    opacity: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .site-header {
        padding: 0.5rem 1rem;
    }

    /* Показываем гамбургер и скрываем основную навигацию */
    .hamburger-menu {
        display: flex;
    }

    .main-nav {
        display: none;
    }

    .logo img {
        max-width: 150px;
    }

    .headerBlock a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 500px) {
    .site-header {
        padding: 0.5rem;
    }

    .logo img {
        max-width: 130px;
    }

    .side-panel {
        width: 280px;
    }

    .headerBlock a {
        font-size: 0.85rem;
        padding: 0.4rem;
    }

    .side-nav a {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .side-nav .cart-icon {
        padding: 0.8rem 1rem;
    }

    .panel-header {
        padding: 0 1rem 1rem;
    }
}

@media (max-width: 350px) {
    .side-panel {
        width: 100%;
    }
}
