/* =========================================
   1. ГЛОБАЛЬНЫЕ НАСТРОЙКИ И ПЕРЕМЕННЫЕ
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #F2D5C4; /* Светло бежевый */
    --fg: #4A1224;
    --muted: #4A1224;
    --accent: #3B2A25; /* Благородный кофейный */
    --accent-soft: #f0ece8;
    --border: #eaeaea;
    --radius: 16px;
    --pol_of: #4A1224;
    --ak: #F2D5C4;
}

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--fg); 
    line-height: 1.6; 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main { padding: 40px 20px; min-height: 70vh; }

/* =========================================
   2. ШАПКА САЙТА И ПОИСК
   ========================================= */
.header { background: #4A1224; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; gap: 16px; flex-wrap: nowrap; }

/* --- ЛОГОТИП --- */
.logo { 
    display: flex; 
    flex-direction: column; 
    text-decoration: none; 
    flex-shrink: 0; 
    justify-content: center;
    align-items: center; 
    line-height: 1;
    padding: 5px 0;
}

/* Само название */
.logo-text {
    font-family: 'Poiret One', cursive;
    font-size: 36px; /* Размер подбирай под шапку */
    font-weight: 400; 
    color: #F2D5C4; /* Твой бежевый цвет */
    letter-spacing: 6px; /* Поскольку шрифт геометричный, ему идет разрядка */
    text-transform: uppercase; /* Делаем заглавными, как на витрине */
    margin-bottom: 2px;
    padding-left: 6px; /* Компенсация разрядки для ровного центра */
    line-height: 1;
}

.logo-subtext {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    color: #F2D5C4;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0.8;
    margin-top: 1px; /* <-- ДОБАВИЛИ ОТСТУП СВЕРХУ */
    padding-left: 5px; 
}

/* --- НАВИГАЦИЯ --- */
.nav { display: flex; gap: 20px; flex-shrink: 0; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; transition: color 0.2s; }
.nav a:hover { color: var(--accent); }
.nav-link { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; transition: color 0.2s; flex-shrink: 0; }
.nav-link:hover { color: var(--accent); }

/* --- КОРЗИНА --- */
.cart-btn { background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 100px; text-decoration: none; font-weight: 600; font-size: 14px; transition: opacity 0.2s; flex-shrink: 0; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.cart-btn:hover { opacity: 0.9; }

/* --- ПОИСК --- */
.search-form {
    display: flex; align-items: center; background: #f3f4f6;
    border-radius: 100px; padding: 4px 4px 4px 16px; flex: 1;
    max-width: 350px; border: 1px solid transparent; transition: all 0.3s;
}
.search-form:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 59, 50, 0.1); }
.search-form input { border: none; background: transparent; outline: none; width: 100%; font-family: inherit; font-size: 14px; color: var(--fg); }
.search-form input::placeholder { color: #9ca3af; }
.search-form button { background: var(--accent); color: #fff; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-form button:hover { opacity: 0.85; }

/* Скрываем бейджи, если они случайно попали в шапку */
header .badge, header .badge-new { display: none !important; }

/* =========================================
   3. БАННЕР (HERO)
   ========================================= */
.hero { background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 60px 40px; margin-bottom: 40px; text-align: center; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: 42px; margin-bottom: 12px; color: var(--fg); }
.hero p { color: var(--muted); font-size: 18px; }

/* =========================================
   4. СЕТКА И КАРТОЧКИ ТОВАРОВ
   ========================================= */
.section-title { font-family: 'Playfair Display', serif; font-size: 32px; margin-bottom: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }

.card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    border: 1px solid #e0e0e0; box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative !important;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.card-img { aspect-ratio: 1; background: #f5f2eb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.card-title { font-weight: 600; font-size: 17px; margin-bottom: 6px; color: var(--fg); }
.card-desc { font-size: 14px; color: var(--muted); margin-bottom: 16px; flex-grow: 1; }
.card-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.price { font-size: 20px; font-weight: 700; color: var(--fg); }

/* Бейджи */
.badge, .badge-new {
    position: absolute !important;
    top: 12px !important;
    z-index: 100 !important;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.badge { left: 12px !important; background: #e3f2fd; color: #1565c0; }
.badge-new { right: 12px !important; background: #fef3c7; color: #d97706; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* =========================================
   5. КНОПКИ
   ========================================= */
.btn { background: var(--accent); color: #fff; border: none; padding: 8px 16px; border-radius: 100px; font-weight: 600; font-size: 13px; cursor: pointer; transition: opacity 0.2s; text-decoration: none; display: inline-block; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; padding: 12px 24px; font-size: 15px; }
.btn-ghost { background: transparent; padding: 6px 10px; color: var(--muted); }
.btn-delete { background: #f1f5f9; border: none; color: #64748b; font-size: 16px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.btn-delete:hover { background: #fee2e2; color: #ef4444; }

/* =========================================
   6. КОРЗИНА И ОФОРМЛЕНИЕ
   ========================================= */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.03); margin-bottom: 24px; }
.cart-table th { padding: 16px 20px; text-align: left; background: #f9f9f9; font-size: 13px; color: var(--muted); text-transform: uppercase; font-weight: 600; border-bottom: 1px solid var(--border); }
.cart-table td { padding: 16px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-table tr:last-child td { border-bottom: none; }
.qty-input { width: 64px; padding: 10px; border: 1px solid #cbd5e1; border-radius: 10px; text-align: center; font-family: inherit; font-size: 16px; font-weight: 700; outline: none; background: #f8fafc; transition: all 0.2s; }
.qty-input:focus { border-color: var(--accent); background: #fff; }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 24px 32px; background: #fff; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }

/* Формы */
.checkout-form { max-width: 500px; display: flex; flex-direction: column; gap: 16px; background: #fff; padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-weight: 600; font-size: 14px; color: var(--fg); }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 16px; border: 1px solid #cbd5e1; border-radius: 10px; font-family: inherit; font-size: 15px; outline: none; background: #fff; transition: all 0.2s; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,59,50,0.1); }

/* =========================================
   7. МОДАЛЬНОЕ ОКНО
   ========================================= */
/* =========================================
   7. МОДАЛЬНОЕ ОКНО
   ========================================= */
#productModal { position: fixed !important; top: 0 !important; left: 0 !important; width: 100vw !important; height: 100vh !important; background: rgba(0,0,0,0.6) !important; z-index: 99999 !important; align-items: center !important; justify-content: center !important; backdrop-filter: blur(4px); padding: 20px; }
#productModal .modal-content { background: #F2D5C4 !important; border-radius: 16px !important; max-width: 900px !important; width: 100% !important; max-height: 90vh !important; overflow-y: auto !important; position: relative !important; padding: 30px !important; box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important; }
#productModal .modal-close { position: absolute !important; top: 15px !important; right: 20px !important; background: #F2D5C4 !important; border: none !important; width: 36px !important; height: 36px !important; border-radius: 50% !important; font-size: 18px !important; cursor: pointer !important; color: var(--accent) !important; display: flex !important; align-items: center !important; justify-content: center !important; z-index: 10 !important; }

.modal-product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.modal-product-image { width: 100%; aspect-ratio: 1; background: #F2D5C4; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.modal-product-image img { width: 100%; height: 100%; object-fit: cover; }
.modal-product-info { display: flex; flex-direction: column; height: 100%; }
.modal-product-cat { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; font-weight: 500; }
.modal-product-title { font-family: 'Playfair Display', serif; font-size: 32px; color: #2c2c2c; margin-bottom: 16px; line-height: 1.2; }
.modal-product-price { font-size: 24px; font-weight: 700; color: #2c2c2c; margin-bottom: 24px; }

/* Блок с весом и составом (сделали фон кофейным, текст белым) */
.modal-product-specs { 
    background: var(--accent); /* Кофейный фон */
    padding: 20px; 
    border-radius: 12px; 
    margin-bottom: 24px; 
    font-size: 14px; 
    line-height: 1.6; 
    color: #F2D5C4; /* Бежевый/белый текст */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.modal-product-specs strong { color: #ffffff; font-weight: 600; }

/* Описание (текст белый) */
/* Заголовок "Описание" (темный, чтобы выделялся) */
.modal-product-desc h3 { 
    font-size: 16px; 
    font-weight: 600; 
    color: var(--fg); /* Темно-бордовый */
    margin-bottom: 8px; 
}

/* Сам текст описания (чуть темнее фона, чтобы читалось) */
.modal-product-desc p { 
    font-size: 14px; 
    color: var(--fg); /* Темно-бордовый */
    opacity: 0.85; 
    line-height: 1.6; 
    margin-bottom: 32px; 
}

.modal-product-form { margin-top: auto; }
.modal-product-btn { width: 100%; background: #4a3b32; color: #F2D5C4; border: none; padding: 16px; border-radius: 30px; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.modal-product-btn:hover { opacity: 0.9; }

/* =========================================
   8. СТИЛИ ДЛЯ АДМИНКИ
   ========================================= */
.admin-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-page-title { font-family: 'Playfair Display', serif; font-size: 32px; color: #2c2c2c; margin: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.admin-card { background: #fff; padding: 24px; border-radius: 16px; border: 1px solid #eaeaea; box-shadow: 0 4px 12px rgba(0,0,0,0.03); display: flex; flex-direction: column; align-items: center; text-align: center; }
.admin-card-number { font-family: 'Playfair Display', serif; font-size: 42px; font-weight: 700; color: #4a3b32; line-height: 1; margin-bottom: 8px; }
.admin-card-label { font-size: 14px; color: #888; text-transform: uppercase; margin-bottom: 16px; font-weight: 500; }
.admin-card-link { display: inline-block; color: #4a3b32; text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 16px; background: #f9f9f9; border-radius: 100px; transition: all 0.2s; }
.admin-card-link:hover { background: #4a3b32; color: #fff; }

.table-container { background: #fff; border-radius: 16px; border: 1px solid #eaeaea; box-shadow: 0 4px 12px rgba(0,0,0,0.03); overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: #f9f9f9; padding: 16px 20px; text-align: left; font-size: 13px; color: #888; text-transform: uppercase; font-weight: 600; border-bottom: 1px solid #eaeaea; }
.admin-table td { padding: 16px 20px; border-bottom: 1px solid #eaeaea; vertical-align: middle; color: #4b5563; font-size: 15px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: #fdfdfd; }

/* =========================================
   9. АДАПТИВ (Мобилки и Планшеты)
   ========================================= */
@media (max-width: 991px) {
    /* Шапка в 3 строки */
    .header-inner { 
        display: grid !important; 
        grid-template-columns: auto auto !important; 
        grid-template-areas: "logo cart" "search search" "nav nav" !important; 
        justify-content: space-between !important; 
        gap: 12px !important; 
        padding: 12px 16px !important; 
        align-items: center !important; 
    }
    
    .logo { 
        grid-area: logo !important; 
        align-items: flex-start !important; 
    }
    
    .logo-text { 
        font-size: 26px !important; 
        letter-spacing: 4px !important; 
        padding-left: 4px !important;
    }
    .logo-subtext { 
        font-size: 7px !important; 
        letter-spacing: 2px !important; 
    }

    .cart-btn { 
        grid-area: cart !important; 
        padding: 8px 16px !important; 
        font-size: 14px !important; 
        background: var(--accent) !important; 
        color: #F2D5C4 !important; 
        border-radius: 100px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 38px !important; /* Фиксируем высоту, чтобы было ровно с логотипом */
        margin-left: auto !important; /* Прижимаем вправо */
        box-shadow: none !important;
    }
    .cart-btn span.text-cart {
        display: none !important;
    }
    .cart-btn::before {
        content: '🛒'; /* Если у тебя в HTML есть эмодзи, это можно убрать */
        font-size: 16px;
    }

    .search-form { grid-area: search !important; display: flex !important; max-width: 100% !important; margin: 0 !important; }
    .nav { grid-area: nav !important; justify-content: flex-start !important; overflow-x: auto !important; white-space: nowrap !important; padding-bottom: 8px !important; width: 100% !important; scrollbar-width: none; }
    .nav a { font-size: 14px !important; }

    /* Баннер */
    .hero { padding: 30px 15px !important; margin-bottom: 24px !important; }
    .hero h1 { font-size: 26px !important; line-height: 1.2 !important; margin-bottom: 8px !important; }
    .hero p { font-size: 14px !important; }

    /* Сетка товаров по 2 в ряд */
    .grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .card-body { padding: 12px !important; }
    .card-title { font-size: 14px !important; }
    .card-desc { font-size: 12px !important; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    .price { font-size: 16px !important; }
    .btn { padding: 6px 10px !important; font-size: 12px !important; }
    .section-title { font-size: 22px !important; margin-bottom: 16px !important; }

    /* Модалка */
    .modal-content { padding: 20px !important; width: 95% !important; max-height: 95vh !important; }
    .modal-product-layout { display: flex !important; flex-direction: column !important; gap: 12px !important; }
    .modal-product-image { width: 100% !important; aspect-ratio: 4/3 !important; max-height: 200px !important; }
    .modal-product-title { font-size: 22px !important; line-height: 1.2 !important; margin-bottom: 4px !important; }
    .modal-product-price { font-size: 20px !important; margin-bottom: 12px !important; }
    .modal-product-specs { padding: 12px !important; font-size: 13px !important; margin-bottom: 12px !important; }
    .modal-product-desc { margin-bottom: 16px !important; }
    .modal-product-desc h3 { font-size: 15px !important; margin-bottom: 4px !important; }
    .modal-product-desc p { font-size: 13px !important; line-height: 1.4 !important; }
    .modal-product-btn { margin-top: 10px !important; margin-bottom: 10px !important; padding: 14px !important; }
}

/* Адаптив для корзины на мобилках */
@media (max-width: 768px) {
    .cart-table thead { display: none !important; }
    .cart-table, .cart-table tbody { display: block !important; width: 100% !important; background: transparent !important; border: none !important; box-shadow: none !important; }
    .cart-table tbody tr { display: flex !important; flex-wrap: wrap !important; align-items: center !important; background: #fff !important; border: 1px solid #eaeaea !important; border-radius: 16px !important; box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important; padding: 16px !important; margin-bottom: 16px !important; position: relative !important; }
    .cart-table td { border: none !important; padding: 0 !important; display: block !important; }
    .cart-table td:nth-child(1) { width: calc(100% - 40px) !important; margin-bottom: 16px !important; }
    .cart-table td:nth-child(1) img { width: 60px !important; height: 60px !important; }
    .cart-table td:nth-child(2) { display: none !important; }
    .cart-table td:nth-child(3) { width: 50% !important; text-align: left !important; }
    .cart-table td:nth-child(4) { width: 50% !important; text-align: right !important; font-size: 18px !important; font-weight: 700 !important; color: #2c2c2c !important; }
    .cart-table td:nth-child(5) { position: absolute !important; top: 16px !important; right: 16px !important; width: auto !important; }
    .cart-total { flex-direction: column !important; align-items: stretch !important; gap: 16px !important; padding: 20px !important; text-align: center !important; }
    .cart-total .btn { width: 100% !important; padding: 16px !important; box-sizing: border-box !important; text-align: center; }
}

/* =========================================
   10. ДОПОЛНИТЕЛЬНЫЕ СТИЛИ (Swiper, Swiper и т.д.)
   ========================================= */
.mySwiper { width: 100%; height: 100%; }
.mySwiper .swiper-pagination-bullet-active { background-color: #4a3b32; }
.mySwiper .swiper-button-next::after, .mySwiper .swiper-button-prev::after { font-size: 20px !important; font-weight: 900; }

@media (max-width: 768px) {
    .mySwiper .swiper-slide { max-height: 250px; }
}

.pickup-point { margin-bottom: 12px; }
.pickup-address { margin: 0 0 4px; }
.pickup-time { margin: 0; color: #666; font-size: 14px; }