/* Подключаем локальный шрифт Montserrat */
@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-display: swap;
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat-Italic-VariableFont_wght.ttf') format('truetype');
    font-display: swap;
    font-weight: 100 900;
    font-style: italic;
}

/* Подключаем локальный шрифт Open Sans */
@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype');
    font-display: swap;
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans-Italic-VariableFont_wdth,wght.ttf') format('truetype');
    font-display: swap;
    font-weight: 100 900;
    font-style: italic;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: #f7f4f0;
    color: #2C3E50;
    line-height: 1.6;
    overflow-x: hidden;
}

.screen {
    display: none;
    width: 100%;
    padding: 0;
}

/* Все экраны с прокруткой */
.screen {
    min-height: 100vh;
    overflow-y: auto;
}

.screen.active {
    display: block;
}



/* Верхняя панель */
.top-bar {
    background: #1A1F2E;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Скрываем любые красные элементы в верхней панели */
.top-bar *[style*="red"],
.top-bar *[style*="#FF"],
.top-bar *[style*="#ff"],
.top-bar *[style*="crimson"],
.top-bar *[style*="maroon"] {
    display: none !important;
}

/* Скрываем элементы с красным цветом */
.top-bar .red-element,
.top-bar [class*="red"],
.top-bar [id*="red"] {
    display: none !important;
}

.work-hours {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.top-buttons {
    display: flex;
    gap: 10px;
}

.top-btn {
    background: #252B3A;
    color: white;
    border: none;
    padding: 10px;
    width: 44px;
    height: 44px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-btn:hover {
    background: #0b5c56;
}

.top-btn.active {
    background: #D4A574;
    color: #1A1F2E;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #0b5c56;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Уведомление о минимальном заказе */
.min-order-notice {
    text-align: center;
    color: #232733;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
}

/* Заголовок страницы */
.page-header {
    padding: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: space-between; /* Распределяем элементы по краям */
}
.top-icon,
.top-btn-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    pointer-events: none;
}

.page-header .left-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.page-header .cart-icon {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header .cart-icon:hover {
    transform: scale(1.1);
}

.page-header .cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.back-btn {
    background: #0b5c56;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1A1F2E;
}

/* Сетка категорий */
.categories-grid {
    padding: 5px; /* Минимальный отступ от краев экрана */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px; /* Минимальный зазор между картинками */
}

.category-card {
    background: white;
    border-radius: 16px;
    padding: 8px 8px 12px 8px; /* Минимальные отступы: верх лево-право, чуть больше снизу для текста */
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px; /* Адаптивная высота */
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: #0b5c56;
    box-shadow: 0 8px 30px rgba(11,92,86,0.2);
}

.category-image {
    position: relative;
    width: 100%; /* Адаптивная ширина */
    height: 0;
    padding-bottom: 120%; /* Еще больше увеличен размер изображения для borderless эффекта */
    margin: 0 0 6px 0; /* Возвращаем минимальный отступ только снизу */
    border-radius: 16px; /* Квадратные углы с закруглением */
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.category-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px; /* Квадратные углы с закруглением */
}

.category-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0b5c56, #2C5530);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px; /* Увеличиваем иконку */
    color: white;
}

.category-name {
    font-size: 18px; /* Возвращен к исходному размеру */
    font-weight: 600;
    color: #1A1F2E;
    margin-bottom: 4px; /* Уменьшен отступ снизу */
    margin-top: 3px; /* Уменьшен отступ сверху от изображения */
}

.category-desc {
    font-size: 14px;
    color: #95A5A6;
}

.category-count {
    font-size: 12px;
    color: #0b5c56;
    margin-top: 5px;
}

/* Список товаров */
.products-list {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 колонки как у категорий */
    gap: 15px; /* Такой же отступ как у категорий */
}

.product-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px; /* Добавляем минимальную высоту для равномерности */
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    width: 100%;
    height: 160px; /* Фиксированная высота вместо padding-bottom */
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.product-image-emoji {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: #0b5c56;
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A1F2E;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #0b5c56;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.product-price .price-new {
    display: block;
    color: #c62828;
    font-size: 20px;
    line-height: 1.2;
}
.product-price .price-old {
    display: block;
    font-size: 14px;
    color: #9aa0a6;
    font-weight: 500;
    text-decoration-line: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(198, 40, 40, 0.6);
    line-height: 1.2;
}
.product-image .product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.35);
}

.product-actions {
    margin-top: auto; /* Прижимаем к низу карточки */
    display: flex;
    flex-direction: column;
    /* Убираем gap чтобы элементы точно совпадали */
}

.add-to-cart-btn {
    width: 100%;
    height: 36px; /* одинаковая высота с количеством */
    background: #0b5c56;
    color: white;
    border: none;
    padding: 0 12px; /* выравниваем по краям */
    border-radius: 10px;
    font-size: 12px; /* компактнее */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex; /* центрируем текст */
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid transparent; /* синхронизируем толщину с счетчиком */
}

/* Счетчик количества на карточке товара */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 36px; /* одинаковая высота с кнопкой */
    background: #f8f9fa;
    border-radius: 9px;
    padding: 4px 8px; /* чуть компактнее */
    border: 1px solid #0b5c56; /* тоньше рамка */
    box-sizing: border-box;
}

/* Гарантируем одинаковое позиционирование внутри карточки */
.product-actions .add-to-cart-btn,
.product-actions .quantity-selector {
    margin: 0; /* без разницы в отступах */
}

.qty-btn {
    width: 20px; /* еще компактнее */
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #0b5c56;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Не сжимаем кнопки */
}

.qty-btn:hover {
    background: #2C5530;
    transform: scale(1.1);
}

.qty-display {
    font-size: 11px; /* еще чуть меньше */
    font-weight: 600;
    color: #0b5c56;
    min-width: 20px;
    text-align: center;
    flex: 1; /* Занимает оставшееся пространство */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; /* единый шрифт */
    font-variant-numeric: tabular-nums; /* ровные цифры */
    line-height: 1;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #2C5530;
}

.add-to-cart-btn:disabled {
    background: #95A5A6;
    cursor: not-allowed;
}

/* Детальная карточка товара */
.product-detail {
    padding: 20px;
    background: white;
}

.detail-image {
    position: relative;
    width: 100%;
    height: 300px; /* Фиксированная высота для контроля размера */
    margin-bottom: 20px;
    border-radius: 16px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px; /* Отступы для того чтобы изображение не касалось краев */
    overflow: hidden; /* Важно: скрываем то что может выйти за рамки */
}

.detail-image-img {
    max-width: calc(100% - 30px); /* Учитываем padding контейнера */
    max-height: calc(100% - 30px); /* Учитываем padding контейнера */
    width: auto;
    height: auto;
    object-fit: contain; /* Сохраняем пропорции, помещаем в контейнер */
    object-position: center; /* Центрируем изображение */
    display: block;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.detail-image-emoji {
    font-size: 80px;
    color: #0b5c56;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

.detail-name {
    font-size: 24px;
    font-weight: 700;
    color: #1A1F2E;
    margin-bottom: 12px;
    line-height: 1.3;
}

.detail-price {
    font-size: 28px;
    font-weight: 700;
    color: #0b5c56;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.detail-price .price-new {
    color: #c62828;
    font-size: 32px;
    line-height: 1.2;
}
.detail-price .price-old {
    font-size: 18px;
    color: #9aa0a6;
    font-weight: 500;
    text-decoration-line: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(198, 40, 40, 0.6);
    line-height: 1.2;
}
.detail-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
}

.detail-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.detail-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1A1F2E;
    margin-bottom: 8px;
}

.detail-info p {
    font-size: 14px;
    color: #2C3E50;
    margin-bottom: 15px;
    line-height: 1.5;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #0b5c56;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover:not(:disabled) {
    background: #2C5530;
    transform: scale(1.1);
}

.qty-btn:disabled {
    background: #95A5A6;
    cursor: not-allowed;
    transform: none;
}

.qty-display {
    font-size: 24px;
    font-weight: 600;
    color: #1A1F2E;
    min-width: 40px;
    text-align: center;
}

/* Корзина */
.cart-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.cart-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #0b5c56;
    position: relative;
    overflow: hidden;
}

.cart-item-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.cart-item-image-emoji {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #0b5c56;
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
}

.cart-item-info { flex: 1; }

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A1F2E;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 14px;
    color: #0b5c56;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cart-item-price .price-new {
    color: #c62828;
    font-weight: 700;
}
.cart-item-price .price-old {
    color: #9aa0a6;
    text-decoration: line-through;
}
.cart-item-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ffe6e0;
    color: #d84315;
    font-size: 11px;
    font-weight: 600;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #0b5c56;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.cart-item-total {
    font-size: 16px;
    font-weight: 700;
    color: #1A1F2E;
}

.cart-summary {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-total {
    font-size: 20px;
    font-weight: 700;
    color: #1A1F2E;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}

/* 🔥 Стили для скидки лояльности */
.loyalty-discount {
    color: #0b5c56 !important;
    font-weight: 600 !important;
    background: rgba(11, 92, 86, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 5px 0;
}

.loyalty-discount span:last-child {
    color: #0b5c56 !important;
    font-weight: 700 !important;
}

.checkout-btn {
    width: 100%;
    background: #0b5c56;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.checkout-btn:hover:not(:disabled) { background: #2C5530; }
.checkout-btn:disabled { background: #95A5A6; cursor: not-allowed; }

/* Пустая корзина */
.empty-cart { text-align: center; padding: 60px 20px; }
.empty-cart-icon { font-size: 72px; color: #95A5A6; margin-bottom: 20px; }
.empty-cart-title { font-size: 24px; font-weight: 600; color: #1A1F2E; margin-bottom: 10px; }
.empty-cart-desc { font-size: 16px; color: #95A5A6; margin-bottom: 30px; }
.go-shopping-btn { background: #0b5c56; color: white; border: none; padding: 16px 30px; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; }

/* Профиль */
.loyalty-card { background: #0b5c56; margin: 20px; padding: 25px; border-radius: 16px; color: white; }
.loyalty-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.loyalty-stats { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 15px; 
    gap: 8px;
}
.loyalty-stat { 
    text-align: center; 
    flex: 1;
    padding: 12px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    min-width: 0;
}
.loyalty-stat-value { font-size: 18px; font-weight: 700; margin-bottom: 5px; line-height: 1.2; }
.loyalty-stat-label { font-size: 12px; opacity: 0.9; }
.loyalty-progress { margin-bottom: 15px; }
.loyalty-progress-label { font-size: 14px; margin-bottom: 8px; }
.progress-bar { background: rgba(255,255,255,0.2); height: 8px; border-radius: 4px; overflow: hidden; }
.progress-fill { background: #D4A574; height: 100%; transition: width 0.3s ease; }
.loyalty-levels { background: rgba(255,255,255,0.1); padding: 15px; border-radius: 12px; margin-top: 15px; }
.loyalty-level { display: flex; align-items: center; padding: 8px 0; font-size: 14px; }
.loyalty-level.active { background: rgba(212, 165, 116, 0.2); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.level-icon { margin-right: 10px; }
.menu-list { padding: 0 20px; }
.menu-item { background: white; border-radius: 12px; padding: 18px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.menu-item:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.menu-item-left { display: flex; align-items: center; gap: 15px; }
.menu-item-icon { width: 40px; height: 40px; background: #f8f9fa; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.menu-item-text { font-size: 16px; font-weight: 500; color: #1A1F2E; }

.menu-item-arrow {
    color: #95A5A6;
    font-size: 18px;
    font-weight: 600;
}

/* Устаревшие стили toggle-switch (для совместимости) */
.toggle-switch { position: relative; width: 50px; height: 28px; background: #ddd; border-radius: 14px; cursor: pointer; transition: background 0.3s ease; }
.toggle-switch.active { background: #0b5c56; }
.toggle-switch::after { content: ''; position: absolute; width: 24px; height: 24px; background: white; border-radius: 50%; top: 2px; left: 2px; transition: transform 0.3s ease; }
.toggle-switch.active::after { transform: translateX(22px); }

/* Уведомления */
.notification { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #232733; color: white; padding: 15px 25px; border-radius: 25px; font-size: 14px; font-weight: 600; z-index: 1000; opacity: 0; display: none; animation: slideInNotification 0.3s ease-out forwards; }
.notification.success { background: #27ae60; }
.notification.warning { background: #f39c12; }
.notification.info { background: #3498db; }
.notification.error { background: #e74c3c; }
@keyframes slideInNotification { from { opacity: 0; transform: translateX(-50%) translateY(-20px);} to { opacity: 1; transform: translateX(-50%) translateY(0);} }

/* Форма заказа */
.order-form { padding: 20px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: #1A1F2E; margin-bottom: 8px; }
.form-hint { font-size: 12px; color: #666; margin-top: 4px; font-style: italic; }
.promo-code-group { animation: fadeIn 0.2s ease-in-out; }
.promo-hint-success { color: #2e7d32; }
.promo-hint-error { color: #c62828; }
.cart-summary .promo-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e1e8ed;
}
.promo-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #1A1F2E;
}
.promo-toggle input {
    width: 20px;
    height: 20px;
}
.promo-input-wrapper {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.promo-input-wrapper .form-input {
    flex: 1;
}
.promo-apply-btn {
    padding: 12px 18px;
    background: #0b5c56;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.promo-apply-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}
.promo-apply-btn:not(:disabled):hover {
    background: #2C5530;
    transform: translateY(-2px);
}
.summary-row.promo-discount span:last-child {
    color: #c62828;
    font-weight: 600;
}
.form-input { width: 100%; padding: 12px 16px; border: 2px solid #e1e8ed; border-radius: 12px; font-size: 16px; color: #1A1F2E; transition: border-color 0.3s ease; }
.form-input:focus { outline: none; border-color: #0b5c56; }
.form-select { width: 100%; padding: 12px 16px; border: 2px solid #e1e8ed; border-radius: 12px; font-size: 16px; color: #1A1F2E; background: white; cursor: pointer; }
.form-textarea { width: 100%; padding: 12px 16px; border: 2px solid #e1e8ed; border-radius: 12px; font-size: 16px; color: #1A1F2E; resize: vertical; min-height: 80px; }
.delivery-info { 
    background: #f8f9fa; 
    padding: 20px; 
    border-radius: 12px; 
    margin-bottom: 20px; 
    border-left: 4px solid #0b5c56;
}

.delivery-info h4 {
    color: #1A1F2E;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.delivery-rules {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-rule {
    font-size: 14px;
    color: #2C3E50;
    line-height: 1.4;
}

.delivery-rule strong {
    color: #0b5c56;
}

/* Модальное окно с часами работы */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: #0b5c56;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #1A1F2E;
    font-size: 15px;
    line-height: 1.6;
}

.about-text p {
    margin: 0;
}

.about-text strong {
    color: #0b5c56;
}

.work-hours-info {
    text-align: center;
}

.work-hours-row {
    display: block; /* показываем день и время один под другим */
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.work-hours-row .day {
    display: block;
    font-weight: 600;
    color: #1A1F2E;
    white-space: nowrap; /* не переносим */
}

.work-hours-row .time {
    display: block;
    font-weight: 700;
    color: #0b5c56;
    font-size: 18px;
    margin-top: 6px; /* отступ от дня */
}

.work-hours-note {
    color: #95A5A6;
    font-size: 14px;
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .categories-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 2px; /* Минимальный зазор */
        padding: 3px; /* Меньше отступ от краев */
    }
    .category-card { 
        padding: 6px 6px 10px 6px; /* Минимальные отступы на планшетах */
        min-height: 250px;
    }
    .category-name {
        font-size: 16px; /* Возвращен к исходному размеру */
    }
    .products-list {
        gap: 12px;
        padding: 15px;
    }
    .product-card {
        padding: 15px;
        min-height: 280px;
    }
    .product-image {
        height: 140px; /* Уменьшаем для планшетов */
    }
    .detail-image {
        height: 280px; /* Уменьшаем для планшетов */
        padding: 12px;
    }
    .detail-image-img {
        max-width: calc(100% - 24px);
        max-height: calc(100% - 24px);
    }
}

@media (max-width: 480px) {
    .categories-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 1px; /* Практически без зазора на мобильных */
        padding: 2px; /* Минимальный отступ от краев */
    }
    .category-card { 
        padding: 5px 5px 8px 5px; /* Минимальные отступы на мобильных */
        min-height: 220px;
    }
    .category-name {
        font-size: 14px; /* Возвращен к исходному размеру */
    }
    .products-list {
        gap: 10px;
        padding: 12px;
    }
    .product-card {
        padding: 12px;
        min-height: 250px;
    }
    .product-image {
        height: 120px; /* Уменьшаем для телефонов */
    }
    .detail-image {
        height: 250px; /* Уменьшаем для телефонов */
        padding: 10px;
    }
    .detail-image-img {
        max-width: calc(100% - 20px);
        max-height: calc(100% - 20px);
    }
    .product-name {
        font-size: 14px;
    }
    .product-price {
        font-size: 16px;
    }
    .quantity-selector {
        height: 40px; /* Немного меньше для телефонов */
        padding: 8px 14px;
    }
    .qty-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    .loyalty-stats { 
        gap: 6px; /* Меньший отступ на мобильных */
    }
    .loyalty-stat {
        padding: 10px 6px; /* Меньше отступов на мобильных */
    }
    .stat-value {
        font-size: 16px; /* Немного меньше на мобильных */
    }
    .stat-label {
        font-size: 12px; /* Меньше текст на мобильных */
    }
    .cart-item-controls { flex-direction: column; gap: 15px; align-items: flex-start; }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 360px) {
    .categories-grid { 
        gap: 1px; /* Практически без зазора */
        padding: 1px; /* Минимальный отступ от краев */
    }
    .category-card { 
        padding: 4px 4px 6px 4px; /* Минимальные отступы на очень маленьких экранах */
        min-height: 200px;
    }
    .category-name {
        font-size: 12px; /* Возвращен к исходному размеру */
    }
    .products-list {
        gap: 8px;
        padding: 10px;
    }
    .product-card {
        padding: 10px;
        min-height: 220px;
    }
    .product-image {
        height: 100px; /* Уменьшаем для малых экранов */
    }
    .detail-image {
        height: 220px; /* Уменьшаем для малых экранов */
        padding: 8px;
    }
    .detail-image-img {
        max-width: calc(100% - 16px);
        max-height: calc(100% - 16px);
    }
    .product-name {
        font-size: 12px;
    }
    .product-price {
        font-size: 14px;
    }
    .quantity-selector {
        height: 36px; /* Еще меньше для малых экранов */
        padding: 6px 12px;
    }
    .qty-btn {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }
    .qty-display {
        font-size: 14px;
    }
    
    .work-hours-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Экран ожидания оплаты */
.payment-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    text-align: center;
}

.payment-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.payment-title {
    font-size: 28px;
    font-weight: 700;
    color: #1A1F2E;
    margin-bottom: 10px;
}

.payment-subtitle {
    font-size: 18px;
    color: #95A5A6;
    margin-bottom: 40px;
}

.payment-timer {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    color: white;
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3);
    min-width: 280px;
}

.timer-title {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.timer-display {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.timer-warning {
    font-size: 14px;
    opacity: 0.8;
}

.payment-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 30px;
}

.payment-btn {
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.payment-btn.primary {
    background: #0b5c56;
    color: white;
}

.payment-btn.primary:hover {
    background: #2C5530;
    transform: translateY(-2px);
}

.payment-btn.secondary {
    background: #e74c3c;
    color: white;
}

.payment-btn.secondary:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.payment-btn.tertiary {
    background: #95A5A6;
    color: white;
}

.payment-btn.tertiary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.payment-status {
    font-size: 14px;
    color: #95A5A6;
    font-style: italic;
}

/* Анимация пульсации */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Анимация мигания для критичного времени */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Экран успешного заказа */
.welcome-title {
    font-size: 32px;
    font-weight: 600;
    color: #0b5c56;
    margin-bottom: 10px;
    text-align: center;
}

.welcome-subtitle {
    font-size: 18px;
    color: #95A5A6;
    opacity: 0.8;
    margin-bottom: 30px;
    text-align: center;
}

.success-message {
    font-size: 16px;
    color: #0b5c56;
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(11, 92, 86, 0.1);
    border-radius: 12px;
    border-left: 4px solid #0b5c56;
}

.welcome-btn {
    background: #0b5c56;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.welcome-btn:hover {
    background: #2C5530;
    transform: translateY(-2px);
}

/* Новая карта лояльности */
.loyalty-card {
    background: linear-gradient(135deg, #0b5c56, #2C5530);
    border-radius: 20px;
    padding: 24px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(11, 92, 86, 0.3);
}

.loyalty-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.loyalty-icon {
    font-size: 24px;
    margin-right: 12px;
}

.loyalty-title {
    font-size: 20px;
    font-weight: 600;
}

.loyalty-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 8px;
}

.loyalty-stat {
    text-align: center;
    flex: 1;
    padding: 12px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    min-width: 0; /* Позволяет элементам сжиматься */
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.loyalty-progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

/* 🏆 СООБЩЕНИЕ О ДОСТИЖЕНИИ МАКСИМУМА */
.loyalty-max-message {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    animation: celebration 0.5s ease-in-out;
}

.max-achievement-text h3 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.max-achievement-text p {
    margin: 4px 0;
    color: white;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.max-achievement-subtitle {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    font-style: italic;
}

@keyframes celebration {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}


.progress-text {
    font-size: 14px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #0b5c56; /* Темно-зеленый цвет вместо красного */
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loyalty-tiers {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
}

.tier-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
}

.tier-item:last-child {
    margin-bottom: 0;
}

.tier-item.current {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 -12px 12px -12px;
}

.tier-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.tier-info {
    font-size: 14px;
    font-weight: 500;
}

/* 📋 СТИЛИ ДЛЯ ИСТОРИИ ЗАКАЗОВ */
.loading-orders, .loading-text {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

.orders-list {
    padding: 20px;
    padding-bottom: 80px;
}

.order-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-number {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.order-date {
    color: #999;
    font-size: 14px;
}

.order-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.order-amount {
    font-size: 18px;
    font-weight: bold;
    color: #2E7D32;
}

.order-items-count {
    color: #666;
    font-size: 14px;
}

.order-items {
    margin-bottom: 15px;
}

.order-item-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f8f8;
}

.order-item-detail:last-child {
    border-bottom: none;
}

.item-name {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.item-qty {
    color: #666;
    font-size: 14px;
    margin: 0 10px;
}

.item-price {
    color: #2E7D32;
    font-weight: bold;
    font-size: 14px;
}

.order-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.order-status.completed {
    background: #E8F5E8;
    color: #2E7D32;
}

/* 🔥 СТИЛИ ДЛЯ КАРТЫ ЛОЯЛЬНОСТИ - ДОПОЛНЕНИЯ */
.loading-text {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 💳 СТИЛИ ДЛЯ СТРАНИЦЫ УСПЕШНОЙ ОПЛАТЫ */
.payment-success-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: success-bounce 0.6s ease-out;
}

@keyframes success-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-title {
    font-size: 24px;
    font-weight: bold;
    color: #2E7D32;
    margin-bottom: 10px;
}

.success-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.success-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-number-success {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.order-amount-success {
    font-size: 20px;
    font-weight: bold;
    color: #2E7D32;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.success-actions .primary-btn,
.success-actions .secondary-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.success-actions .primary-btn {
    background: #2E7D32;
    color: white;
}

.success-actions .primary-btn:hover {
    background: #1B5E20;
}

.success-actions .secondary-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.success-actions .secondary-btn:hover {
    background: #e9e9e9;
}

/* 📱 АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ */
@media (max-width: 480px) {
    .order-item {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .order-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .order-item-detail {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .payment-success-content {
        padding: 20px 15px;
    }
    
    .success-icon {
        font-size: 48px;
    }
    
    .success-title {
        font-size: 20px;
    }
    
    .order-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* Стили для списка заказов */
.orders-list {
    padding: 20px;
}

.order-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-number {
    font-size: 18px;
    font-weight: 600;
    color: #1A1F2E;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.order-status.new { background: #fff3cd; color: #856404; }
.order-status.accepted { background: #d4edda; color: #155724; }
.order-status.preparing { background: #cce5ff; color: #004085; }
.order-status.delivering { background: #e2e3e5; color: #383d41; }
.order-status.completed { background: #d1ecf1; color: #0c5460; }
.order-status.cancelled { background: #f8d7da; color: #721c24; }

.order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.order-amount {
    font-weight: 600;
    color: #1A1F2E;
}

/* Стили для деталей заказа */
.order-details {
    padding: 20px;
}

.order-detail-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.order-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1F2E;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
}

.order-status-badge.new { background: #fff3cd; color: #856404; }
.order-status-badge.accepted { background: #d4edda; color: #155724; }
.order-status-badge.preparing { background: #cce5ff; color: #004085; }
.order-status-badge.delivering { background: #e2e3e5; color: #383d41; }
.order-status-badge.completed { background: #d1ecf1; color: #0c5460; }
.order-status-badge.cancelled { background: #f8d7da; color: #721c24; }

.order-items-list {
    list-style: none;
    padding: 0;
}

.order-items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-items-list li:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: #1A1F2E;
}

.item-quantity {
    color: #666;
    font-size: 14px;
}

.item-price {
    font-weight: 600;
    color: #1A1F2E;
}

/* Стили для пустых заказов */
.empty-orders {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-orders-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-orders-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.empty-orders-desc {
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.go-shopping-btn {
    background: #D4A574;
    color: #1A1F2E;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.go-shopping-btn:hover {
    background: #c19660;
    transform: translateY(-2px);
}




