/* ============================================
   ONE CHEF - Постоянная тёмная тема
   ============================================ */

/* Тёмная тема (единственная) */
:root, [data-theme="dark"] {
    /* Цвета бренда */
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8c5a;
    --accent: #00d4aa;
    --accent-dark: #00b894;
    
    /* Фоны */
    --bg-body: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-navbar: #141414;
    --bg-footer: #0a0a0a;
    --bg-hover: #222222;
    
    /* Текст */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --text-light: #f8f9fa;
    
    /* Границы */
    --border-color: #333333;
    --border-light: #444444;
    
    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-primary: 0 0 20px rgba(255, 107, 53, 0.3);
    
    /* Радиусы */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    
    /* Анимации */
    --transition: all 0.3s ease;
}

/* ============================================
   Базовые стили
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

/* ============================================
   Типография
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ============================================
   Навигация
   ============================================ */

.navbar {
    background-color: var(--bg-navbar) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.navbar-brand h1 {
    color: var(--primary);
    font-size: 1.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand h1 i {
    font-size: 1.6rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

/* ============================================
   Кнопки
   ============================================ */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    color: white;
}

.btn-outline-primary {
    color: var(--primary);
    border: 2px solid var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-outline-light {
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: white;
}

/* ============================================
   Карточки
   ============================================ */

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
}

/* ============================================
   Секции
   ============================================ */

section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    margin: 1rem auto;
    border-radius: 2px;
}

/* ============================================
   Промо-баннер
   ============================================ */

.promo-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.promo-banner h2 {
    color: white;
    margin: 0;
    font-size: 1.3rem;
}

/* ============================================
   Категории
   ============================================ */

.category-card {
    height: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* ============================================
   Контакты
   ============================================ */

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.contact-icon {
    color: var(--primary);
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

/* ============================================
   Информационные блоки
   ============================================ */

.delivery-info {
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.1), 
        rgba(0, 212, 170, 0.1));
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.discount-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
}

/* ============================================
   Футер
   ============================================ */

.footer {
    background-color: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer h4, .footer h5 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary);
    text-decoration: none;
}

.social-icon {
    color: var(--text-secondary);
    font-size: 1.4rem;
    margin: 0 0.5rem;
    transition: var(--transition);
    display: inline-block;
}

.social-icon:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

/* ============================================
   Утилиты
   ============================================ */

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-light { color: var(--text-light) !important; }

.bg-dark { background-color: var(--bg-card) !important; }
.bg-darker { background-color: var(--bg-footer) !important; }

.rounded { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ============================================
   Анимации
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   Адаптивность
   ============================================ */

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .navbar-brand h1 { font-size: 1.5rem; }
    .category-icon { font-size: 2.8rem; }
    
    section { padding: 3rem 0; }
    .footer { padding: 2rem 0 1rem; }
}

@media (max-width: 576px) {
    .promo-banner h2 { font-size: 1.1rem; }
    .btn { padding: 0.4rem 1.2rem; }
    .card-body { padding: 1.25rem; }
}

/* ============================================
   Кастомные элементы Bootstrap для тёмной темы
   ============================================ */

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.alert-info {
    background-color: rgba(0, 212, 170, 0.1);
    border-color: rgba(0, 212, 170, 0.2);
    color: var(--text-primary);
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.bg-primary {
    background-color: var(--primary) !important;
}

/* ============================================
   Глобальные исправления
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

::selection {
    background-color: var(--primary);
    color: white;
}


/* ============================================
   Модальное окно деталей товара
   ============================================ */

.product-modal-img-container {
    height: 250px;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.product-modal-img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-img-wrapper {
    height: 200px;
    overflow: hidden;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

/* Кликабельные карточки */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
    border-color: var(--primary);
}

/* Бейджи */
.badge {
    font-weight: 600;
    padding: 0.5em 0.8em;
    font-size: 0.8rem;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* Характеристики товара */
.product-feature {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* Модальное окно */
.modal-content {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

/* Кнопка "Поделиться" */
#shareProductBtn {
    border: 2px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

#shareProductBtn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 107, 53, 0.05);
}

/* Кнопка закрытия модального окна */
.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .product-modal-img-container {
        height: 200px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: var(--radius);
    }
}

@media (max-width: 576px) {
    .product-modal-img-container {
        height: 180px;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
}

/* Скругления */
.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

/* Z-index для кнопки закрытия */
.z-3 {
    z-index: 3;
}

/* Выделение товара при открытии по ссылке */
.product-card.highlighted {
    box-shadow: 0 0 0 3px var(--primary) !important;
    border-color: var(--primary) !important;
    animation: pulse-highlight 2s infinite;
}

@keyframes pulse-highlight {
    0% {
        box-shadow: 0 0 0 3px var(--primary);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.5);
    }
    100% {
        box-shadow: 0 0 0 3px var(--primary);
    }
}

/* Модальное окно при открытии по ссылке */
.modal-backdrop.show {
    opacity: 0.85;
}

/* Статическое модальное окно (не закрывается при клике вне окна) */
.modal[data-bs-backdrop="static"] {
    backdrop-filter: blur(3px);
}


/* ============================================
   Стили для корзины
   ============================================ */

.empty-cart {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cart-item {
    transition: all 0.3s ease;
}

.cart-item:hover {
    background-color: rgba(255, 107, 53, 0.05);
}

.quantity-input {
    max-width: 60px;
    border-left: 0;
    border-right: 0;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    opacity: 1;
    height: auto;
}

/* Анимация при обновлении корзины */
@keyframes cartUpdate {
    0% { background-color: transparent; }
    50% { background-color: rgba(255, 107, 53, 0.1); }
    100% { background-color: transparent; }
}

.cart-item-updating {
    animation: cartUpdate 0.5s ease;
}

/* Стили для модального окна оформления */
#checkoutModal .modal-content {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

#checkoutModal .modal-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-navbar);
}

#checkoutModal .modal-body {
    background: var(--bg-card);
}

#checkoutModal .modal-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-navbar);
}

/* Стили для формы */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
}

/* Кнопка отправки заказа */
#submit-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Адаптивность для корзины */
@media (max-width: 768px) {
    .cart-item td {
        padding: 0.5rem !important;
    }
    
    .cart-item .input-group {
        width: 100px !important;
    }
    
    .quantity-input {
        max-width: 40px;
    }
}

@media (max-width: 576px) {
    .cart-item {
        display: block;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 0;
    }
    
    .cart-item td {
        display: block;
        border: none;
        padding: 0.25rem 0 !important;
    }
    
    .cart-item td:first-child {
        float: left;
        width: 80px;
        margin-right: 1rem;
    }
    
    .cart-item td:nth-child(2) {
        overflow: hidden;
    }
    
    .cart-item td:nth-child(3),
    .cart-item td:nth-child(4),
    .cart-item td:nth-child(5) {
        display: inline-block;
        margin-right: 1rem;
        margin-top: 0.5rem;
    }
    
    .cart-item td:last-child {
        display: inline-block;
        margin-top: 0.5rem;
    }
    
    .table thead {
        display: none;
    }
}

/* ============================================
   Стили для новых элементов корзины
   ============================================ */

/* Кнопка геолокации */
#geolocation-btn {
    border-color: var(--primary);
    color: var(--primary);
}

#geolocation-btn:hover {
    background-color: var(--primary);
    color: white;
}

/* Дополнительные поля адреса */
#address-entrance,
#address-floor,
#address-intercom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

#address-entrance:focus,
#address-floor:focus,
#address-intercom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
}

/* Поля выбора даты и времени */
#delivery-date,
#delivery-time-input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

#delivery-date:focus,
#delivery-time-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
}

/* Иконки в радио кнопках */
.form-check-label i {
    width: 20px;
    text-align: center;
}

/* Подсказки */
small.text-muted {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

/* Адаптивность для новых элементов */
@media (max-width: 768px) {
    .delivery-address-block .row .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    #time-selection-block .row .col-md-6 {
        margin-bottom: 0.5rem;
    }
}


/* ============================================
   Стили для мобильных устройств
   ============================================ */

@media (max-width: 768px) {
    /* Поле ввода адреса для iOS */
    #address-input {
        font-size: 16px !important; /* Предотвращает масштабирование в iOS */
        height: 44px !important; /* Минимальная высота для удобного нажатия */
        -webkit-appearance: none; /* Убираем стандартные стили iOS */
        border-radius: 8px !important;
    }
    
    /* Контейнер для кнопок поиска на мобильных */
    .mobile-search-buttons {
        display: flex;
        gap: 10px;
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    .mobile-search-buttons .btn {
        flex: 1;
        min-width: 120px;
        padding: 10px 12px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Улучшаем отображение результатов автозаполнения на мобильных */
    .pac-container {
        z-index: 1050 !important; /* Выше модальных окон */
        font-size: 14px;
        border-radius: 8px;
        margin-top: 5px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    }
    
    .pac-item {
        padding: 10px 15px;
        border-bottom: 1px solid var(--border-color);
        cursor: pointer;
        transition: background-color 0.2s;
        color: var(--text-primary);
    }
    
    .pac-item:hover {
        background-color: var(--bg-hover);
    }
    
    .pac-item-selected,
    .pac-item:active {
        background-color: var(--primary-light);
        color: white;
    }
    
    .pac-icon {
        margin-right: 10px;
        color: var(--primary);
    }
    
    /* Улучшаем поле ввода для touch устройств */
    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.3);
    }
    
    /* Кнопка геолокации */
    #geolocation-btn {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Карточки выбора типа доставки на мобильных */
    .order-type-card {
        padding: 15px;
    }
    
    .order-type-card .fa-3x {
        font-size: 2.5rem !important;
    }
    
    /* Таблица корзины на мобильных */
    .table-responsive {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .cart-item td {
        padding: 12px 8px !important;
    }
    
    .quantity-input {
        height: 36px;
        font-size: 16px;
    }
    
    /* Модальное окно на мобильных */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    /* Улучшаем кнопки на мобильных */
    .btn {
        touch-action: manipulation; /* Улучшает отклик на касание */
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Дополнительные исправления для очень маленьких экранов */
@media (max-width: 576px) {
    .mobile-search-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .mobile-search-buttons .btn {
        width: 100%;
    }
    
    #address-input {
        font-size: 16px !important;
        padding: 12px 15px !important;
    }
    
    .order-type-card {
        margin-bottom: 10px;
    }
    
    .cart-item {
        font-size: 14px;
    }
    
    .cart-item img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Исправление для iOS Safari */
@supports (-webkit-touch-callout: none) {
    #address-input {
        font-size: 16px !important;
    }
    
    select.form-control,
    textarea.form-control,
    input[type="text"].form-control,
    input[type="tel"].form-control,
    input[type="email"].form-control {
        font-size: 16px !important;
    }
}

/* Предотвращение масштабирования при фокусе в iOS */
input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
    font-size: 16px !important;
}

/* Улучшение для клавиатуры на мобильных */
input:focus {
    outline: none;
}

/* Улучшение скролла на мобильных */
.modal-body {
    -webkit-overflow-scrolling: touch;
}



