/* style.css - ПОЛНАЯ ВЕРСИЯ */
/* Font loaded via <link> in base.html for reliability on all devices */

:root {
    --primary-color: #ffb7b2;
    --secondary-color: #ffdac1;
    --accent-color: #ff9aa2;
    --text-color: #5d4037;
    --bg-color: #fff9f9;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Source Serif 4', Georgia, serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Source Serif 4', Georgia, serif;
}

/* Навигация */
nav, .nav-links a, .logo {
    font-family: 'Source Serif 4', Georgia, serif;
}

/* Кнопки */
.btn {
   font-family: 'Source Serif 4', Georgia, serif;
}

/* Текст в карточках */
.product-title, .product-desc, .feature-item h3, .feature-item p {
    font-family: 'Source Serif 4', Georgia, serif;
}

/* Футер */
footer, .footer a, .social-links a, .phone-block a {
    font-family: 'Source Serif 4', Georgia, serif;
}

/* 🔝 Верхняя панель с городом */
.top-bar {
    background: #fff;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: bold;
    border-bottom: 1px solid #ffe4e1;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1001;
    color: var(--text-color);
}

.city-select {
    margin-left: 8px;
    padding: 4px 12px;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Source Serif 4', Georgia, serif;
    cursor: pointer;
}

.city-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Шапка */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 44px; /* top-bar height: 10px*2 padding + ~24px line = 44px */
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    flex-wrap: nowrap;  /* ← Запрещаем перенос */
}

.logo {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.5rem;
    color: var(--accent-color);
    text-decoration: none;
    white-space: nowrap;  /* ← Запрещаем перенос */
    display: inline-block;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 20px;
    font-weight: bold;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Главный экран */
.hero {
    min-height: calc(100vh - 112px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
    padding: 30px 20px;
    margin-top: 112px; /* top-bar 44px + nav 68px */
}

.hero h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 3rem;
    margin-bottom: 6px;
    color: var(--accent-color);
}

.hero-order-hint {
    font-size: 1rem;
    color: #c97e7e;
    margin: 0 0 18px;
    font-style: italic;
    opacity: 0.85;
}

.hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.hero .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 154, 162, 0.4);
    border: 3px solid white;
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.hero .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 154, 162, 0.6);
    outline-offset: 5px;
}

.hero-image {
    margin: 20px 0;
}

.hero-flower {
    width: 250px;
    height: auto;
}

/* Преимущества с картинкой */
.feature-icon-img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    object-fit: contain;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.price {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: bold;
    display: block;
    margin: 10px 0;
}

/* ✅ Единые стили для всех секций */
section {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Специфика для "Важно знать" */
.info-section {
    background-color: #fff0f5;
    border-radius: 20px;
    text-align: center;
}

.info-section p {
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Заголовки секций — по центру */
section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--accent-color);
    margin: 0 auto 40px;
    font-family: 'Source Serif 4', Georgia, serif;
    max-width: 800px;
}

/* Блок преимуществ — центрирование */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;  /* ← Карточки по центру */
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;           /* ← Весь блок по центру */
    padding: 0 20px;
}

.feature-item {
    flex: 1 1 280px;          /* ← Адаптивная ширина */
    max-width: 320px;
    text-align: center;       /* ← Текст внутри по центру */
    padding: 25px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* Картинка в преимуществах — по центру */
.feature-icon-img {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;      /* ← Центрируем */
    display: block;           /* ← Чтобы margin auto сработал */
    object-fit: contain;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* Футер */
footer {
    background-color: #fff;
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
    border-top: 1px solid #eee;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.social-links a {
    padding: 10px 20px;
    background: var(--bg-color);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    transition: all 0.3s;
    border: 2px solid var(--accent-color);
}

.social-links a:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.phone-block {
    margin-top: 15px;
}

.phone-block a {
    font-size: 1.3rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    transition: all 0.3s;
}

.phone-block a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* ✅ Стиль для "max" в футере */
.max-note {
    display: inline-block;
    margin: 0 10px;
    padding: 4px 10px;
    background: var(--secondary-color);
    color: var(--text-color);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* Адаптивность */
@media (max-width: 768px) {
    /* Центрирование на мобильных */
    section h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .features {
        gap: 20px;
        padding: 0 15px;
    }
    
    .feature-item {
        flex: 1 1 100%;  /* ← В одну колонку */
        max-width: 100%;
    }
    
    .feature-icon-img {
        width: 70px;
        height: 70px;
    }
    
    .info-section {
        margin: 0 15px;  /* ← Отступы по бокам */
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.3rem;
    }
    
    nav {
        padding: 10px 15px;
    }
    
    .nav-links a {
        font-size: 1rem;
        margin-left: 15px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .logo {
        font-size: 1.1rem;
    }
    
    nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-links a {
        margin: 0 10px;
    }
}

/* ==================== КАТАЛОГ ==================== */

/* Заголовок каталога (не используется в текущей вёрстке, оставлен как запасной) */
.catalog-header {
    text-align: center;
    padding: 130px 20px 40px;
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
    display: none; /* скрыт — nav находится прямо под шапкой */
}
.catalog-header h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}
.catalog-subtitle { font-size: 1.1rem; color: var(--text-color); }

/* ⏳ Блок о сроках заказа */
.order-timing {
    background: linear-gradient(135deg, #fff5f7 0%, #ffeef2 100%);
    padding: 30px 20px;
    margin: 20px auto;
    max-width: 800px;
    border-radius: 20px;
    border: 2px dashed var(--accent-color);
}

.timing-content h3 {
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 20px;
    font-family: 'Source Serif 4', Georgia, serif;
}

.timing-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timing-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.timing-icon {
    font-size: 2rem;
}

.timing-text {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* Фильтры (десктоп) */
.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--accent-color);
    background: white;
    color: var(--text-color);
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: bold;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* Мобильные фильтры (горизонтальный скролл) */
.mobile-filters {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    overflow-x: auto;
    background: white;
    border-bottom: 1px solid #ffe4e1;
    position: sticky;
    top: 100px;
    z-index: 100;
    -webkit-overflow-scrolling: touch;
}

.mobile-filters::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 8px 20px;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.filter-chip.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Секция каталога */
.catalog-section {
    padding: 40px 15px;
    max-width: 100%;
}

/* Обёртка тела каталога */
.catalog-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 60px;
}


/* Сетка товаров — 4 колонки на PC, 2 на мобильном */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Карточка товара */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 154, 162, 0.28);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.product-card:hover .product-image {
    transform: scale(1.04);
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}


.product-info {
    padding: 10px 12px 14px;
    flex: 1;
}

/* Цена — крупно, как на маркетплейсе */
.product-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 0 0 4px;
    line-height: 1.2;
}

.product-title {
    font-size: 0.95rem;
    color: var(--text-color);
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Source Serif 4', Georgia, serif;
}

.product-desc {
    font-size: 0.8rem;
    color: #999;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    padding: 0 10px 10px;
}

.product-card-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 10px;
    background: var(--accent-color);
    color: white;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 10px;
    font-family: 'Source Serif 4', Georgia, serif;
    transition: background 0.2s;
}
.product-card:hover .product-card-btn {
    background: #ff7a85;
}

.product-actions {
    padding: 0 4px 4px;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    text-decoration: none;
    transition: all 0.3s;
}
.btn-secondary:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* Фильтры по категориям */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 15px;
}

/* Нет товаров */
.no-products {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.no-products p {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 10px 0;
}

.no-products-hint {
    font-size: 1rem;
    color: #999;
}

/* Хлебные крошки (мобильные) */
.breadcrumbs {
    padding: 15px 20px;
    background: white;
    font-size: 0.9rem;
    border-bottom: 1px solid #ffe4e1;
}

.breadcrumbs a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Активная ссылка в навигации */
.nav-links a.active,
.desktop-nav a.active {
    color: var(--accent-color);
    position: relative;
}

.nav-links a.active::after,
.desktop-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

/* Утилиты для показа/скрытия */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* ==================== АДАПТИВНОСТЬ ==================== */

/* Планшеты */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .catalog-header h1 {
        font-size: 2.5rem;
    }
}

/* Средние планшеты */
@media (min-width: 769px) and (max-width: 1199px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Телефоны */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .catalog-header {
        padding: 110px 15px 30px; /* 98px fixed header at 768px + 12px */
    }
    
    .catalog-header h1 {
        font-size: 2rem;
    }
    
    .catalog-subtitle {
        font-size: 1rem;
    }
    
    .catalog-section {
        padding: 20px 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-desc {
        display: none;
    }
    
    /* Увеличиваем зоны нажатия для пальцев */
    .btn,
    .filter-chip,
    .nav-links a {
        min-height: 44px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    /* nav wraps to 2 rows → total fixed height ~148px */
    .hero {
        margin-top: 155px;
    }
    .catalog-header {
        padding-top: 158px;
    }
    .mobile-filters {
        top: 150px;
    }
    .catalog-header h1 {
        font-size: 1.8rem;
    }

    .product-title {
        font-size: 1.1rem;
    }
    
    .product-desc {
        font-size: 0.9rem;
    }
    
    .product-badge {
        font-size: 1rem;
        padding: 6px 12px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease;
}

/* ==================== ORDER ==================== */

.order-page {
    margin-top: 112px;
    min-height: calc(100vh - 112px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
}

.order-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    padding: 50px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.order-box h2 {
    color: var(--accent-color);
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.order-box > p {
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    transition: all 0.3s;
}

.btn-tg {
    background: #2CA5E0;
    color: white;
    border: 2px solid #2CA5E0;
}
.btn-tg:hover { background: #1a96d4; transform: translateY(-2px); }

.btn-vk {
    background: #4C75A3;
    color: white;
    border: 2px solid #4C75A3;
}
.btn-vk:hover { background: #3d6090; transform: translateY(-2px); }

.btn-max {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
}
.btn-max:hover { background: var(--primary-color); transform: translateY(-2px); }

.btn-phone {
    background: white;
    color: var(--text-color);
    border: 2px solid var(--primary-color);
}
.btn-phone:hover { background: var(--primary-color); transform: translateY(-2px); }

@media (max-width: 480px) {
    .order-page { margin-top: 155px; min-height: calc(100vh - 155px); }
    .order-box { padding: 35px 20px; }
    .order-box h2 { font-size: 1.8rem; }
    .contact-btn { font-size: 1rem; padding: 13px 20px; }
}

/* ==================== PRODUCT PAGE ==================== */

.product-back-bar {
    max-width: 960px;
    margin: 0 auto;
    padding: 124px 20px 16px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    padding: 8px 18px;
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    background: white;
    transition: all 0.3s;
}
.btn-back:hover { background: var(--accent-color); color: white; }

.product-page {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.product-image-col {
    flex: 0 0 42%;
}

.product-detail-img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
    display: block;
}

.product-detail-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
    border-radius: 16px;
}

.product-detail-info {
    flex: 1;
    min-width: 0;
    padding-top: 8px;
}

.product-detail-tag {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--text-color);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.product-detail-title {
    font-size: 2rem;
    color: var(--accent-color);
    margin: 0 0 16px;
    line-height: 1.3;
}

.product-detail-price {
    font-size: 2.4rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 0 0 20px;
    line-height: 1;
}

.product-detail-desc {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.7;
    margin: 0 0 30px;
    white-space: pre-line;
}

.btn-order-big {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    background: var(--accent-color);
    color: white;
    border-radius: 14px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.15rem;
    font-family: 'Source Serif 4', Georgia, serif;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255,154,162,0.4);
}
.btn-order-big:hover { background: #ff7a85; transform: translateY(-2px); }

/* Галерея миниатюр на странице товара — горизонтальный скролл */
.product-gallery {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    padding-bottom: 4px;
}
.gallery-thumb {
    width: 58px;
    height: 87px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.65;
    transition: all 0.2s;
}
.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--accent-color);
    opacity: 1;
}

@media (max-width: 640px) {
    .product-back-bar { padding-top: 168px; }
    .product-page { flex-direction: column; gap: 20px; }
    .product-image-col { width: 100%; }
    .product-detail-title { font-size: 1.6rem; }
    .product-detail-price { font-size: 1.9rem; }
}

/* ==================== ADMIN ==================== */

.admin-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 130px 20px 60px;
    font-family: 'Source Serif 4', Georgia, serif;
}

.admin-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header-bar h2 {
    color: var(--accent-color);
    font-size: 2rem;
    margin: 0;
    text-align: left;
}

.btn-logout {
    padding: 10px 20px;
    background: white;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}
.btn-logout:hover { background: var(--accent-color); color: white; }

.flash {
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: bold;
}
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.flash-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%);
    padding: 20px;
}

.login-form {
    max-width: 400px;
    width: 100%;
    padding: 50px 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.login-form h2 {
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 30px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 15px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    box-sizing: border-box;
    outline: none;
    color: var(--text-color);
    background: var(--bg-color);
}
.login-form input:focus { border-color: var(--accent-color); }

.btn-primary {
    padding: 12px 30px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-primary:hover { background: #ff7a85; transform: translateY(-2px); }

.login-form .btn-primary { width: 100%; }

.admin-form {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    margin-bottom: 35px;
}

.admin-form h3 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    margin-top: 0;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    padding: 11px 16px;
    margin-bottom: 14px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    box-sizing: border-box;
    outline: none;
    color: var(--text-color);
    background: var(--bg-color);
}
.admin-form input:focus,
.admin-form textarea:focus { border-color: var(--accent-color); }

.admin-form textarea { min-height: 90px; resize: vertical; }

.admin-form input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-bottom: 0;
}

.admin-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-cancel {
    padding: 12px 24px;
    background: white;
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-cancel:hover { background: var(--primary-color); }

.admin-table-wrapper {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--accent-color);
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: bold;
}

.admin-table th:first-child { border-radius: 12px 0 0 0; }
.admin-table th:last-child  { border-radius: 0 12px 0 0; }

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ffe4e1;
    vertical-align: middle;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1rem;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fff0f5; }

.btn-danger {
    padding: 8px 14px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-danger:hover { background: #e53935; }

.btn-edit {
    padding: 8px 14px;
    background: var(--secondary-color);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-edit:hover { background: var(--primary-color); }

.td-actions { display: flex; gap: 8px; align-items: center; }

.admin-img-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.admin-photos-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.admin-extra-photo {
    position: relative;
    display: inline-block;
}

.btn-del-img {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-del-img:hover { background: #e53935; }

/* ==================== CROP MODAL ==================== */
.crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.crop-modal.active { display: flex; }

.crop-modal-box {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 520px;
    width: 100%;
    text-align: center;
}
.crop-modal-box h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}
.crop-area {
    max-height: 400px;
    overflow: hidden;
    border-radius: 12px;
    background: #222;
}
.crop-area img {
    display: block;
    max-width: 100%;
}
.crop-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
}
.crop-preview-wrap {
    display: none;
    margin-top: 12px;
    text-align: center;
}
.crop-preview-wrap img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}
.crop-preview-wrap span {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-top: 4px;
}

.extra-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.extra-preview-item {
    position: relative;
    display: inline-block;
}
.extra-preview-item img {
    width: 72px;
    height: 108px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* ==================== CATEGORY NAV (DodoPizza-стиль) ==================== */

/* Cat-nav прижат к шапке — margin-top равен высоте фиксированной шапки */
.cat-nav-wrap {
    position: sticky;
    top: 112px;
    margin-top: 112px;   /* сдвигает первую отрисовку прямо под шапку */
    z-index: 900;
    background: white;
    border-bottom: 2px solid #ffe4e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cat-nav {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 1400px;
    margin: 0 auto;
}
.cat-nav::-webkit-scrollbar { display: none; }

/* Используем <a>, не <button> */
.cat-nav-btn {
    flex-shrink: 0;
    padding: 9px 20px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--text-color);
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.95rem;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.25s;
    text-decoration: none;
    display: inline-block;
}
.cat-nav-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.cat-nav-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

@media (max-width: 480px) {
    .cat-nav-wrap {
        top: 155px;
        margin-top: 155px;
    }
}

/* ==================== CATEGORY SECTIONS ==================== */

.cat-section {
    padding: 40px 0 20px;
    scroll-margin-top: 175px;
}
.cat-section-inner {
    max-width: 1400px;
    margin: 0 auto;
}
.cat-section-title {
    font-size: 1.6rem;
    color: var(--text-color);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    text-align: left;
    max-width: none;
    font-family: 'Source Serif 4', Georgia, serif;
}
.cat-section + .cat-section {
    border-top: 1px solid #ffe4e1;
}

@media (max-width: 480px) {
    .cat-section { scroll-margin-top: 215px; }
    .cat-section-title { font-size: 1.3rem; }
}

/* ==================== IMAGE SLIDER (product page) ==================== */

.img-slider-wrap {
    position: relative;
    width: 100%;
}

.img-slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 16px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}
.img-slider-track::-webkit-scrollbar { display: none; }

.slider-img {
    flex: 0 0 100%;
    scroll-snap-align: start;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-color);
}
.slider-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.slider-prev { left: 8px; }
.slider-next { right: 8px; }

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    min-height: 14px;
}
.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.slider-dot.active {
    background: var(--accent-color);
    width: 20px;
    border-radius: 4px;
}

/* ==================== ADMIN TOGGLE BUTTON ==================== */

.btn-toggle-status {
    padding: 7px 14px;
    border: none;
    border-radius: 20px;
    font-size: 0.88rem;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-available {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.btn-available:hover { background: #c8e6c9; }
.btn-unavailable {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.btn-unavailable:hover { background: #ffcdd2; }

/* ==================== ADMIN CATEGORIES MANAGEMENT ==================== */

.admin-categories {
    background: white;
    padding: 24px 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    margin-bottom: 30px;
}
.admin-categories h3 {
    color: var(--accent-color);
    font-size: 1.4rem;
    margin: 0 0 16px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid #ffe4e1;
}
.cat-row-emoji { font-size: 1.3rem; }
.cat-row-name {
    flex: 1;
    font-weight: bold;
    font-size: 1rem;
}
.cat-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-reorder {
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.btn-reorder:hover {
    background: var(--primary-color);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.9rem;
}

.add-cat-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #ffe4e1;
}

.input-cat-emoji {
    width: 60px;
    padding: 9px 10px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: center;
    font-family: 'Source Serif 4', Georgia, serif;
    background: var(--bg-color);
    outline: none;
}
.input-cat-emoji:focus { border-color: var(--accent-color); }

.input-cat-name {
    flex: 1;
    min-width: 160px;
    padding: 9px 14px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Source Serif 4', Georgia, serif;
    background: var(--bg-color);
    outline: none;
    color: var(--text-color);
}
.input-cat-name:focus { border-color: var(--accent-color); }

.input-cat-slug {
    width: 130px;
    padding: 9px 14px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Source Serif 4', Georgia, serif;
    background: var(--bg-color);
    outline: none;
    color: var(--text-color);
}
.input-cat-slug:focus { border-color: var(--accent-color); }

.cat-row-slug {
    font-size: 0.78rem;
    color: #aaa;
    flex-shrink: 0;
}

.category-item {
    margin-bottom: 6px;
}

.cat-edit-form {
    background: #fff5f5;
    border: 1px solid #ffd6d6;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 4px;
}

.edit-cat-form-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.edit-cat-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ==================== TIMING BANNER ==================== */

.timing-banner {
    background: linear-gradient(135deg, #fff5f7 0%, #ffeef2 100%);
    border: 1px dashed var(--accent-color);
    border-radius: 14px;
    padding: 12px 20px;
    margin: 20px 0;
    font-size: 0.95rem;
    color: var(--text-color);
    text-align: center;
    line-height: 1.6;
}

/* ==================== CATEGORY TAG (admin table) ==================== */

.cat-tag {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--text-color);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.82rem;
    margin: 2px 2px 2px 0;
    white-space: nowrap;
}

/* ==================== CATEGORY CHECKBOXES (product form) ==================== */

.category-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    background: var(--bg-color);
}

.cat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    user-select: none;
}
.cat-checkbox-label:has(.cat-checkbox:checked) {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}
.cat-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: white;
    display: none; /* hide native checkbox; label itself shows state */
}

/* catalog-body padding-top now handled by cat-nav margin-top */
.catalog-body {
    padding-top: 20px;
}