@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600&display=swap');

:root {
    --bg-color: #efece5;
    --accent-color: #A64430; 
    --accent-hover: #8A3827;
    --text-main: #332E2C;
    --text-light: #6B635E;
    --card-bg: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* ================= ЕДИНАЯ ЧИСТАЯ ШАПКА ================= */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Ключевое свойство: разрешает меню падать на новую строку */
    padding: 15px 30px;
    background-color: #F4F1EC;
    
    /* Магия прилипания (без конфликтов!) */
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); 
    transition: transform 0.3s ease-in-out;
}

.main-header.hidden {
    transform: translateY(-100%);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #332E2C;
}

.logo-container h1 {
    font-size: 1.2rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 50%;
}

.main-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.nav-links {
    display: flex;
    gap: 15px;
    list-style: none;
}

.nav-links li a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    color: #332E2C;
    font-weight: 600;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-links li a:hover {
    color: #A64430;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-socials {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-socials a {
    display: flex;
    color: #332E2C;
    transition: color 0.3s ease, transform 0.3s ease; 
}

.header-socials a:hover {
    color: #A64430;
    transform: translateY(-4px); 
}

.header-socials svg {
    width: 22px;
    height: 22px;
}

.cart-btn {
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--accent-color);
    padding: 8px 15px;
    border-radius: 20px;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.cart-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Кнопка гамбургера (скрыта на ПК) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: #332E2C;
    transition: all 0.3s ease;
}


/* ================= ГЛАВНЫЙ ЭКРАН ================= */
.hero {
    height: 30vh;
    background-image: linear-gradient(rgba(243, 239, 234, 0.3), rgba(243, 239, 234, 1)), url('/img/hero-nature.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
}


/* ================= КАТАЛОГ И КАРТОЧКИ ================= */
.catalog {
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    font-weight: 400;
}

.tea-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.tea-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.tea-card:hover {
    transform: translateY(-5px);
}

.tea-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.tea-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tea-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.tea-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

.badge-year {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #24C373;
    color: white;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weight-selector {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.weight-btn {
    background-color: #F4F4F4;
    border: none;
    padding: 6px 8px;
    font-size: 0.75rem;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.weight-btn.active {
    background-color: #3A3A3A;
    color: #FFF;
}

.tea-bottom {
    display: flex;
    border-top: 1px solid #F0F0F0;
    height: 60px;
}

.tea-price {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #000;
    border-right: 1px solid #F0F0F0;
}

.add-to-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #000;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s ease;
}

.add-to-cart:hover {
    color: var(--accent-color);
}


/* ================= СТРАНИЦА КАТЕГОРИИ ================= */
.category-header {
    max-width: 1200px;
    margin: 40px auto 50px auto;
    padding: 0 5%;
}

.category-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.category-description {
    font-size: 1.05rem;
    color: #555;
    max-width: 800px;
}


/* ================= КОРЗИНА ================= */
.cart-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 350px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 10000;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.cart-overlay.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}

.remove-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 1.2rem;
    cursor: pointer;
}

.remove-btn:hover {
    color: #E25C5C;
}

.cart-total, .checkout-btn {
    flex-shrink: 0;
}

.cart-total {
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.2rem;
}

.checkout-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 30px;
    margin-top: 20px;
    font-size: 1rem;
    cursor: pointer;
}


/* ================= ФУТЕР ================= */
footer {
    margin-top: 60px;
}

.social-subscribe {
    background: linear-gradient(rgba(35, 32, 31, 0.85), rgba(35, 32, 31, 0.85)), 
                url('https://images.unsplash.com/photo-1576092768241-dec231879fc3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80') center/cover;
    color: #FFFFFF;
    text-align: center;
    padding: 60px 20px;
}

.social-subscribe h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.social-subscribe p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #EFECE5;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #FFFFFF;
    border-radius: 50%;
    color: #332E2C;
    transition: all 0.3s ease;
}

.social-btn svg {
    width: 22px;
    height: 22px;
    margin-right: 2px;
}

.social-btn:hover {
    background-color: var(--accent-color);
    color: #FFFFFF;
    transform: translateY(-3px);
}

.footer-info {
    background-color: var(--card-bg);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 35px 10%;
}


/* ================= СТРАНИЦА ОФОРМЛЕНИЯ ЗАКАЗА ================= */
.checkout-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.checkout-form-column {
    flex: 1.3;
}

.checkout-summary-column {
    flex: 0.7;
    position: sticky;
    top: 100px; /* Отступ от липкой шапки */
}

.box-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 25px;
}

.box-card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.delivery-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.radio-card {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
}

.radio-card.active {
    border-color: var(--accent-color);
    background: #fdfaf8;
}

.submit-order-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 30px;
    margin-top: 20px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}


/* ================= ГАЛЕРЕЯ / ЛАЙТБОКС ================= */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.main-photo {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
}

.thumbnails {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnails img:hover {
    border-color: #8C7B6B;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }


/* ========================================================
   АДАПТИВ (ДЛЯ ЭКРАНОВ 1400px и 768px)
======================================================== */

/* 1. Прячем меню в гамбургер на планшетах (до 1400px) */
@media (max-width: 1400px) {
    .hamburger {
        display: flex;
        order: 3;
        margin-left: 20px;
    }
    
    .header-actions {
        order: 2;
        margin-left: auto; /* Прижимает всё вправо */
    }

    .main-menu {
        display: none; 
        width: 100%; 
        order: 4; /* Отправляем меню вниз шапки */
        padding-top: 20px;
        border-top: 1px solid #dcdcdc;
        margin-top: 15px;
    }

    .main-menu.active {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .nav-links li[style*="pointer-events: none"] {
        display: none; /* Прячем точки */
    }
}

/* 2. Делаем в одну линию и убираем лишнее на ТЕЛЕФОНАХ (до 768px) */
@media (max-width: 768px) {
    
    /* Шапка: компактные отступы */
    .main-header {
        padding: 10px 15px;
    }

    /* Логотип: сближаем картинку и текст, чуть уменьшаем */
    .logo-container {
        gap: 8px;
    }
    .logo-img {
        height: 30px;
    }
    .logo-container h1 {
        font-size: 1.05rem; 
    }

    /* Скрываем соцсети в шапке */
    .header-socials {
        display: none; 
    }

    /* Корзина отодвигается от гамбургера */
    .header-actions {
        margin-left: auto;
        margin-right: 25px; /* Увеличили расстояние между корзиной и меню */
    }
    .cart-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .hamburger {
        margin-left: 0;
    }

    /* ИСПРАВЛЕНИЕ НАЕЗДА НА ТЕКСТ */
    .hero {
        height: auto; /* Отключаем жесткую высоту, из-за которой текст лез вверх */
        padding-top: 60px; /* Принудительно опускаем текст под шапку */
        padding-bottom: 40px;
    }
    .category-header {
        padding-top: 30px; /* Отступ для страниц категорий */
    }

    /* Адаптив каталога и подвала */
    .tea-grid {
        grid-template-columns: 1fr;
    }
    .footer-info {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
    
    /* Адаптив страницы заказа */
    .checkout-container {
        flex-direction: column;
    }
    .checkout-summary-column {
        position: static;
    }
}

/* --- СТИЛИ ДЛЯ ПЛАШКИ УСПЕШНОГО ЗАКАЗА --- */
.custom-modal {
    display: none; /* Скрыта по умолчанию */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.custom-modal.active {
    display: flex;
    opacity: 1;
}
.custom-modal .modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.custom-modal.active .modal-content {
    transform: translateY(0);
}