/**
 * 🛒 cart.css — RollsByTepyuk
 * 🎨 Цветовая схема: лосось + пастельный голубой
 */

/* ===== ПЕРЕМЕННЫЕ (наследуются из main.css) ===== */
:root {
  /* 🔥 Если не определены в main.css — фоллбэки */
  --primary: #ff9233;           /* 🍣 Лосось — основной акцент */
  --primary-dark: #e67e22;      /* Тёмный оранжевый для ховера */
  --accent: #ffb366;            /* Светлый акцент */
  
  --bg-light: #f8fbff;          /* 🌊 Пастельный голубой фон */
  --text-dark: #2c3e50;         /* Тёмный сине-серый */
  --text-muted: #7f9db5;        /* Приглушённый голубовато-серый */
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  
  /* 🔹 Тени с холодным оттенком */
  --shadow-sm: 0 4px 16px rgba(44, 62, 80, 0.08);
  --shadow-md: 0 6px 20px rgba(44, 62, 80, 0.12);
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ===== БАЗОВЫЕ СТИЛИ СТРАНИЦЫ ===== */
.cart-page {
  background: var(--bg-light);
  min-height: 100vh;
  padding-bottom: 40px;
}

.cart-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 10px;
  text-align: center;
}

.cart-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 30px;
  text-align: center;
}

/* ===== КАРТОЧКА ТОВАРА В КОРЗИНЕ ===== */
.cart-item {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  animation: slideIn var(--transition-normal) ease;
  position: relative;
  border: 1px solid rgba(44, 62, 80, 0.04);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-item.removing {
  animation: slideOut var(--transition-normal) ease forwards;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(100px);
    height: 0;
    padding: 0;
    margin: 0;
  }
}

.cart-item-image {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  /* 🎨 Новый фон: пастельный голубой градиент */
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2fa 100%);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item-info {
  flex-grow: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-item-price {
  font-size: 1.3rem;
  font-weight: 800;
  /* 🎨 Градиент лосось → тёмный оранжевый */
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== КОЛИЧЕСТВО ТОВАРА ===== */
.cart-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-light);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(44, 62, 80, 0.08);
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #fff;
  border-radius: 8px;
  font-size: 1.1rem;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 146, 51, 0.3);
}

.quantity-btn:hover:not(:disabled) {
  transform: scale(1.1);
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.quantity-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  background: #f5f9fc;
}

.quantity-value {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  color: var(--text-dark);
}

/* ===== ИТОГО ПО ПОЗИЦИИ ===== */
.cart-item-total {
  text-align: right;
  min-width: 80px;
}

.cart-item-total-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-item-total-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* ===== КНОПКА УДАЛЕНИЯ ===== */
.cart-item-remove {
  width: 36px;
  height: 36px;
  border: none;
  /* 🎨 Фон: светло-голубой вместо красного */
  background: #e8f2fa;
  border-radius: 10px;
  /* 🎨 Цвет иконки: лосось вместо красного */
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.cart-item-remove:hover {
  /* 🎨 Ховер: лосось вместо красного */
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}

/* ===== СВОДКА ЗАКАЗА ===== */
.cart-summary {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px 0 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(44, 62, 80, 0.06);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(44, 62, 80, 0.08);
}

.cart-summary-row:last-child {
  border-bottom: none;
  padding-top: 15px;
  margin-top: 5px;
  font-size: 1.1rem;
}

.cart-summary-label {
  font-size: 1rem;
  color: var(--text-muted);
}

.cart-summary-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.cart-summary-total {
  font-size: 1.5rem !important;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== КНОПКА ОЧИСТКИ КОРЗИНЫ ===== */
.cart-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  /* 🎨 Граница и цвет: лосось вместо красного */
  border: 2px solid var(--primary);
  border-radius: 50px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.cart-clear-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== ПУСТАЯ КОРЗИНА ===== */
.cart-empty {
  text-align: center;
  padding: 60px 20px;
}

.cart-empty-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 25px;
  /* 🎨 Фон: пастельный голубой градиент */
  background: linear-gradient(135deg, var(--bg-light) 0%, #e6f2fa 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-muted);
}

.cart-empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.cart-empty-text {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 25px;
}

.cart-empty-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-empty-btn:hover {
  transform: translateY(-2px);
  /* 🎨 Тень с оттенком лосося */
  box-shadow: 0 10px 25px rgba(255, 146, 51, 0.35);
}

/* ===== ТАБЫ ДОСТАВКИ/САМОВЫВОЗА ===== */
.delivery-tabs {
  display: flex;
  gap: 8px;
  /* 🎨 Фон: пастельный голубой */
  background: #eef5fb;
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.delivery-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.delivery-tab i {
  font-size: 1.1rem;
  color: var(--primary);
}

.delivery-tab:hover:not(.active) {
  /* 🎨 Ховер: светло-голубой */
  background: #d9e8f5;
  color: var(--text-dark);
}

.delivery-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  /* 🎨 Тень с оттенком лосося */
  box-shadow: 0 4px 15px rgba(255, 146, 51, 0.35);
}

.delivery-tab.active i {
  color: #fff;
}

/* ===== СЕКЦИИ ФОРМЫ ===== */
.form-section {
  display: none;
  animation: fadeIn var(--transition-normal) ease;
}

.form-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== ПОЛЯ ФОРМЫ ===== */
.form-label {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: block;
}

.form-control {
  width: 100%;
  /* 🎨 Граница: пастельный голубой */
  border: 2px solid rgba(127, 157, 181, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 1rem;
  transition: var(--transition-fast);
  background: #fff;
  color: var(--text-dark);
}

.form-control:focus {
  /* 🎨 Фокус: лосось */
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 146, 51, 0.15);
  outline: none;
}

.form-control:disabled {
  background: #f5f9fc;
  cursor: not-allowed;
  opacity: 0.7;
  color: var(--text-muted);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

/* ===== СЕЛЕКТ ВРЕМЕНИ ===== */
.time-select-wrapper {
  position: relative;
}

.time-select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid rgba(127, 157, 181, 0.4);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: #fff;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition-fast);
  size: 6;
  overflow-y: auto;
  display: block;
  appearance: none;
  -webkit-appearance: none;
}

.time-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 146, 51, 0.15);
  outline: none;
}

/* Скроллбар для Webkit */
.time-select::-webkit-scrollbar { width: 6px; }
.time-select::-webkit-scrollbar-track { background: #f1f7fb; border-radius: 3px; }
.time-select::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
.time-select::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Скроллбар для Firefox */
.time-select {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #f1f7fb;
}

@media (max-width: 480px) {
  .time-select {
    size: 5;
    max-height: 180px;
    font-size: 0.95rem;
  }
}

/* ===== КАСТОМНЫЙ ДРОПДАУН ВРЕМЕНИ ===== */
.time-select-trigger {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(127, 157, 181, 0.4);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: left;
  font-size: 1rem;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.time-select-trigger:hover,
.time-select-trigger:focus {
  border-color: var(--primary);
  outline: none;
}

.time-select-trigger .time-select-placeholder {
  color: var(--text-muted);
}

.time-select-trigger .arrow {
  color: var(--primary);
  transition: transform 0.2s ease;
}

.time-select-trigger.active .arrow {
  transform: rotate(180deg);
}

.time-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
  box-shadow: var(--shadow-md);
}

.time-select-dropdown.show {
  display: block;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.time-select-option {
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-dark);
  border-bottom: 1px solid rgba(44, 62, 80, 0.04);
}

.time-select-option:last-child {
  border-bottom: none;
}

.time-select-option:hover {
  /* 🎨 Ховер: пастельный голубой с оттенком лосося */
  background: rgba(255, 146, 51, 0.08);
  color: var(--text-dark);
}

.time-select-option.selected {
  /* 🎨 Выбранное: лёгкий фон лосося */
  background: rgba(255, 146, 51, 0.15);
  font-weight: 600;
  color: var(--text-dark);
}

.time-select-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Скроллбар для дропдауна */
.time-select-dropdown::-webkit-scrollbar { width: 6px; }
.time-select-dropdown::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===== КАРТОЧКИ ФИЛИАЛОВ ===== */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.branch-card {
  padding: 16px;
  /* 🎨 Граница: пастельный голубой */
  border: 2px solid rgba(127, 157, 181, 0.3);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.branch-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  /* 🎨 Тень с оттенком лосося */
  box-shadow: 0 8px 25px rgba(255, 146, 51, 0.15);
}

.branch-card.selected {
  border-color: var(--primary);
  /* 🎨 Фон: очень светлый лосось */
  background: linear-gradient(135deg, rgba(255, 146, 51, 0.06) 0%, rgba(255, 179, 102, 0.03) 100%);
  box-shadow: 0 6px 20px rgba(255, 146, 51, 0.2);
}

.branch-card.selected::before {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.branch-name {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.branch-address {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.branch-address i {
  color: var(--primary);
  margin-top: 3px;
}

.branch-phone {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.branch-phone i {
  font-size: 0.9rem;
}

/* ===== ОШИБКА ЗАБЛОКИРОВАННОЙ ДАТЫ ===== */
.date-error {
  /* 🎨 Фон: очень светлый красный/оранжевый */
  background: #fff7f2;
  border: 1px solid #ffd9c4;
  /* 🎨 Текст: тёмный оранжевый вместо красного */
  color: #c96e1a;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: none;
}

.date-error.show {
  display: block;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ===== КНОПКА ОФОРМЛЕНИЯ ЗАКАЗА ===== */
#checkout-trigger {
  padding: 0 15px;
}

.cart-submit-btn {
  width: 100%;
  max-width: 500px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  /* 🎨 Тень с оттенком лосося */
  box-shadow: 0 6px 20px rgba(255, 146, 51, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
}

.cart-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 146, 51, 0.5);
}

.cart-submit-btn:active {
  transform: translateY(0);
}

.cart-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(135deg, #ffb366 0%, #ff9233 100%);
}

.cart-form-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 15px;
  line-height: 1.5;
}

.cart-form-note i {
  color: var(--primary);
  margin-right: 4px;
}

/* ===== МОДАЛЬНОЕ ОКНО ОФОРМЛЕНИЯ ===== */
#checkoutModal .modal-content {
  border-radius: var(--radius-lg);
  background: #fff;
  border: none;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(44, 62, 80, 0.2);
}

#checkoutModal .modal-header {
  padding: 20px 24px 10px;
  border-bottom: 1px solid rgba(44, 62, 80, 0.08);
}

#checkoutModal .modal-title {
  font-size: 1.25rem;
  color: var(--text-dark);
  font-weight: 700;
}

#checkoutModal .modal-body {
  padding: 10px 24px 24px;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

#checkoutModal .form-control {
  border: 2px solid rgba(127, 157, 181, 0.4);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 1rem;
  transition: var(--transition-fast);
}

#checkoutModal .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 146, 51, 0.15);
  outline: none;
}

#checkoutModal .btn-close {
  padding: 0.5rem;
  opacity: 0.6;
  filter: none;
}

#checkoutModal .btn-close:hover {
  opacity: 1;
}

/* ===== АДАПТИВНЫЕ СТИЛИ ===== */

/* Планшеты и меньше */
@media (max-width: 991px) {
  .branches-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Мобильные */
@media (max-width: 767px) {
  .cart-item {
    flex-wrap: wrap;
    text-align: center;
    padding: 14px;
  }

  .cart-item-image {
    margin: 0 auto;
  }

  .cart-item-info {
    text-align: center;
    margin: 10px 0;
    width: 100%;
  }

  .cart-quantity,
  .cart-item-total {
    margin: 0 auto;
  }

  .cart-item-remove {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .delivery-tabs {
    flex-direction: column;
  }

  .delivery-datetime {
    grid-template-columns: 1fr;
  }

  .time-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .cart-submit-btn {
    padding: 14px 24px;
    font-size: 1rem;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .cart-title {
    font-size: 1.5rem;
  }

  .cart-item-name {
    font-size: 1rem;
  }

  .cart-item-price {
    font-size: 1.1rem;
  }

  .quantity-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .branches-grid {
    grid-template-columns: 1fr;
  }

  .time-select {
    padding: 10px 36px 10px 14px;
    font-size: 0.95rem;
  }

  #checkoutModal .modal-dialog {
    margin: 16px;
  }

  #checkoutModal .modal-content {
    border-radius: var(--radius-md);
  }
}

/* ===== УТИЛИТЫ ===== */
.text-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* ===== ПРЕЛОАДЕР СТРАНИЦЫ ===== */
#page-preloader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  /* 🎨 Фон прелоадера в новой палитре */
  background: linear-gradient(135deg, var(--bg-light) 0%, #eef5fb 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#page-preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo {
  position: relative;
  width: 80px; height: 80px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-spinner {
  position: absolute;
  width: 100%; height: 100%;
  border: 4px solid rgba(255, 146, 51, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.preloader-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.preloader-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.preloader-progress {
  width: 200px; height: 4px;
  background: rgba(255, 146, 51, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
  0% { width: 0%; margin-left: 0; }
  50% { width: 70%; margin-left: 30%; }
  100% { width: 0%; margin-left: 100%; }
}

@media (max-width: 480px) {
  .preloader-logo { width: 60px; height: 60px; }
  .preloader-text { font-size: 1rem; }
  .preloader-progress { width: 160px; }
}

/* 🔹 Алерт про соевый соус */
.alert-soya {
  border: 2px solid #ff9233;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: #856404;
  font-size: 0.95rem;
  box-shadow: 0 2px 12px rgba(255, 146, 51, 0.15);
  animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-soya .alert-icon {
  font-size: 1.25rem;
  color: #ff9233;
  flex-shrink: 0;
}

.alert-soya .alert-content {
  flex: 1;
  line-height: 1.4;
}

.alert-soya .btn-close {
  filter: none !important;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.alert-soya .btn-close:hover {
  opacity: 1;
}

/* Адаптив для мобильных */
@media (max-width: 576px) {
  .alert-soya {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }
  .alert-soya .d-flex {
    flex-wrap: wrap;
  }
  .alert-soya .btn-close {
    order: -1;
    margin-left: auto !important;
  }
}

/* 👥 Компактный блок персон в одну строку */
.persons-block-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 146, 51, 0.06);
    border: 1px solid rgba(255, 146, 51, 0.15);
    border-radius: 10px;
    padding: 10px 16px;
    margin: 12px 0;
}

.persons-label-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    white-space: nowrap; /* Запрещаем перенос текста */
    cursor: pointer;
}

.persons-icon {
    font-size: 1.1rem;
}

.persons-input-inline {
    width: 65px; /* Компактная ширина */
    padding: 6px 8px;
    border: 2px solid rgba(127, 157, 181, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    transition: var(--transition-fast);
    background: #fff;
}

.persons-input-inline:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 146, 51, 0.15);
    outline: none;
}


.persons-hint-inline {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap; /* Запрещаем перенос подсказки */
}

/* Адаптив: если экран ОЧЕНЬ узкий, аккуратно переносим подсказку вниз */
@media (max-width: 380px) {
    .persons-block-inline {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 8px;
    }
    .persons-hint-inline {
        width: 100%;
        margin-top: -4px;
    }

}#customer-phone.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.branch-worktime {
  font-size: 0.85rem;
  color: var(--primary-dark);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.branch-worktime i {
  font-size: 0.9rem;
}
.branch-worktime small {
  color: #6c757d;
  font-size: 0.75rem;
}

.branch-delivery {
  font-size: 0.85rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.branch-delivery i {
  font-size: 0.9rem;
}
.branch-delivery small {
  font-size: 0.75rem;
  opacity: 0.8;
}

#delivery-cost-block {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
}
#summary-delivery-row {
  transition: all 0.3s ease;
}

/* ============================================================================
   🚚 БЛОК СТОИМОСТИ ДОСТАВКИ — улучшенные стили
   ============================================================================ */

/* 🔹 Базовый контейнер — красивый градиент в палитре сайта */
#delivery-cost-block {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2fa 50%, #f8fbff 100%);
  border: 2px solid rgba(127, 157, 181, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px !important;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: deliveryBlockSlideIn 0.4s ease;
}

/* 🔹 Анимация появления */
@keyframes deliveryBlockSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🔹 Декоративная полоска слева (как акцент) */
#delivery-cost-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 4px 0 0 4px;
}

/* 🔹 Hover-эффект */
#delivery-cost-block:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 146, 51, 0.12);
}

/* 🔹 Иконка грузовика — анимация */
#delivery-cost-block .bi-truck {
  color: var(--primary);
  font-size: 1.2rem;
  display: inline-block;
  animation: truckBounce 2s ease-in-out infinite;
}

@keyframes truckBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

/* 🔹 Левая часть — подпись */
#delivery-cost-block > span:first-child {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 🔹 Правая часть — цена */
#delivery-cost-value {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* 🔹 Состояние "Бесплатно" — зелёный акцент */
#delivery-cost-block.free-delivery {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

#delivery-cost-block.free-delivery::before {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

#delivery-cost-block.free-delivery .bi-truck {
  color: #22c55e;
  animation: truckBounce 1.5s ease-in-out infinite, confetti 0.6s ease;
}

#delivery-cost-value.text-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes confetti {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(1.2) rotate(10deg); }
}

/* 🔹 Строка доставки в сводке корзины */
#summary-delivery-row {
  background: linear-gradient(90deg, rgba(255, 146, 51, 0.04) 0%, transparent 100%);
  border-radius: 8px;
  padding: 8px 12px !important;
  margin: 4px 0;
  transition: all 0.3s ease;
}

#summary-delivery-row:hover {
  background: linear-gradient(90deg, rgba(255, 146, 51, 0.08) 0%, transparent 100%);
}

/* 🔹 Адаптив для мобильных */
@media (max-width: 576px) {
  #delivery-cost-block {
    padding: 14px 16px !important;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  #delivery-cost-value {
    font-size: 1.3rem !important;
  }
  
  #delivery-cost-block > span:first-child {
    justify-content: center;
  }
}

/* 🔹 Отключение анимаций для пользователей с prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #delivery-cost-block,
  #delivery-cost-block .bi-truck {
    animation: none;
    transition: none;
  }
  
  #delivery-cost-block:hover {
    transform: none;
  }
}