/* === СТИЛИ СТРАНИЦЫ === */

/* Основные переменные цветов */
:root{
  --primary:#8B0000; /* Основной красный цвет */
  --bg:#f8f9fa;      /* Цвет фона */
  --text:#333;       /* Цвет текста */
}

/* Сброс стилей */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

/* Основные стили тела страницы */
body{
  font-family:Montserrat,sans-serif;
  background:var(--bg);
  color:var(--text);
  overflow-x: hidden;  /* Отключаем горизонтальный скролл */
  overflow-y: auto;    /* Включаем вертикальный скролл */
  -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

/* Контейнер для контента */
.container{
  max-width:1200px;
  margin:auto;
  padding:0 20px;
}

/* === OVERLAY ДЛЯ TIKTOK БРАУЗЕРА === */
.tiktok-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #8B0000 0%, #6b0000 100%);
  color: white;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  font-family: Montserrat, sans-serif;
}

.tiktok-overlay-content {
  max-width: 500px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tiktok-overlay h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #ffcc00;
}

.tiktok-overlay p {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.9;
}

.tiktok-open-btn {
  display: inline-block;
  background: #25D366;
  color: white;
  padding: 16px 40px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 18px;
  font-weight: bold;
  margin: 20px 0;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.tiktok-open-btn:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tiktok-instructions {
  margin-top: 30px;
  font-size: 14px;
  opacity: 0.8;
  text-align: left;
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
}

.tiktok-instructions ol {
  margin-left: 20px;
}

.tiktok-instructions li {
  margin-bottom: 8px;
}

.tiktok-logo {
  margin-bottom: 30px;
  font-size: 36px;
  font-weight: bold;
  color: white;
}

/* === ШАПКА САЙТА === */
header{
  background:rgba(255,255,255,.95);
  padding:15px 0;
  box-shadow:0 2px 20px rgba(0,0,0,.1);
}
.header-content{
  display:flex;
  align-items:center;
}
.logo img{
  height:50px;
}

/* === ЗАГОЛОВОК СТРАНИЦЫ === */
.page-title{
  text-align:center;
  padding:40px 0 25px;
}
.page-title h1{
  font-size:28px;
  color:var(--primary);
  font-weight:500;
}

/* === СЛАЙДЕР С ТОВАРАМИ === */
.slider-wrapper{
  position:relative;
  margin-bottom:40px;
  width:100%;
}

.slider-track{
  display:flex;
  transition: transform 0.4s ease;
  width:100%;
}

/* === КАРТОЧКА ТОВАРА === */
.product-card{
  flex: 0 0 auto;
  background:#fff;
  border-radius:18px;
  padding:20px;
  box-shadow:0 10px 30px rgba(0,0,0,.1);
  margin:0 10px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 420px;
}

.product-image{
  flex: 0 0 auto;
  width: 100%;
  height: 180px;
  background: #f5f5f5;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:15px;
  overflow:hidden;
  position: relative;
}

.product-image img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.03);
}

.product-name{
  font-weight:500;
  margin-bottom:8px;
  font-size:16px;
  line-height: 1.3;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.product-info{
  font-size:14px;
  color:#666;
  margin-bottom:5px;
  line-height: 1.4;
}

.product-price{
  margin-top:10px;
  font-weight:600;
  color:var(--primary);
  font-size:18px;
  flex: 0 0 auto;
}

/* === КНОПКИ ДОБАВЛЕНИЯ/УДАЛЕНИЯ === */
.product-actions{
  display:flex;
  gap:10px;
  margin-top:15px;
  position: relative;
  flex: 0 0 auto;
}
.product-actions button{
  flex:1;
  padding:12px;
  border:none;
  border-radius:10px;
  font-size:15px;
  font-weight:600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}

/* Кнопка добавления в корзину */
.add-btn{
  background:var(--primary);
  color:#fff;
}
.add-btn:hover {
  background: #6b0000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}
.add-btn:active {
  transform: scale(0.97);
}
.add-btn.clicked {
  background: #28a745 !important;
  animation: pulse 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.add-btn.clicked::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  font-size: 16px;
}

/* Кнопка удаления из корзины */
.remove-btn{
  background:#ddd;
  color:#333;
}
.remove-btn:hover {
  background: #ccc;
  transform: translateY(-2px);
}
.remove-btn:active {
  transform: scale(0.97);
}
.remove-btn.clicked {
  background: #dc3545 !important;
  color: white !important;
  animation: shake 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.remove-btn.clicked::after {
  content: "−";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  font-size: 18px;
}

/* Стиль когда товар уже в корзине */
.add-btn.in-cart {
  background: #28a745;
  color: white;
}
.add-btn.in-cart:hover {
  background: #218838;
}

/* Стиль для продуктов-батонов (огненная иконка) */
.baton-highlight {
  position: relative;
}
.baton-highlight::before {
  content: "🔥";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff6b00;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 2;
}

/* === АНИМАЦИИ === */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  50% { transform: scale(0.96); box-shadow: 0 0 0 8px rgba(40, 167, 69, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes highlight {
  0% { box-shadow: 0 10px 30px rgba(40, 167, 69, 0); }
  50% { box-shadow: 0 10px 40px rgba(40, 167, 69, 0.4); }
  100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); }
}

.product-card.highlight {
  animation: highlight 1s ease;
}

/* === НАВИГАЦИЯ СЛАЙДЕРА === */
.slider-nav-container {
  margin-top: 25px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.slider-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 400px;
  width: 100%;
}

.slider-nav-btn {
  height: 44px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  font-weight: 600;
}

.slider-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.slider-nav-btn:hover:not(:disabled) {
  background: #6b0000;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.slider-nav-counter {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  min-width: 70px;
  text-align: center;
}

/* === КОРЗИНА ЗАКАЗОВ === */
.order-box{
  background:var(--primary);
  color:#fff;
  border-radius:18px;
  padding:20px;
  margin-bottom:40px;
}
.order-summary{
  display:flex;
  justify-content:space-between;
  margin-bottom:10px;
}

.cart-items-container {
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  border-left: 4px solid #fff;
  font-size: 14px;
}

.cart-item:last-child {
  margin-bottom: 0;
}

.cart-item-name {
  flex: 1;
  font-weight: 500;
}

.cart-item-quantity {
  background: #fff;
  color: var(--primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  margin-left: 10px;
}

.cart-empty {
  text-align: center;
  padding: 20px;
  opacity: 0.8;
  font-style: italic;
}

/* === ПОЛЯ ФОРМЫ === */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 500;
}

.delivery-fields input,
.delivery-fields textarea{
  width:100%;
  padding:12px 15px;
  border-radius:10px;
  border:none;
  margin-bottom:12px;
  font-family:Montserrat,sans-serif;
  font-size:15px;
}

.delivery-fields input:focus,
.delivery-fields textarea:focus{
  outline:none;
  box-shadow:0 0 0 2px rgba(255,255,255,0.5);
}

/* Стили ошибок валидации */
.delivery-fields input.error {
  border: 2px solid #ffcccc;
  background: #fff5f5;
}

.error-message {
  color: #ffcccc;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.error-message.show {
  display: block;
}

/* Сообщение о минимальном заказе батонов */
.min-order-error {
  color: #ffcccc;
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: rgba(255, 0, 0, 0.1);
  border-radius: 8px;
  display: none;
}

.min-order-error.show {
  display: block;
}

/* Прогресс-бар батонов */
.baton-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.baton-count {
  font-size: 16px;
  font-weight: 600;
  color: #ffcc00;
}

.baton-required {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.baton-progress-bar {
  flex-grow: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.baton-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b00, #ffcc00);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* === КНОПКА WHATSAPP === */
.whatsapp-link{
  display:block;
  text-align:center;
  background:#fff;
  color:var(--primary);
  padding:14px;
  border-radius:40px;
  text-decoration:none;
  font-weight:500;
  opacity:.5;
  pointer-events:none;
  transition:all 0.3s;
  margin-top: 20px;
  border: none;
  font-family: Montserrat, sans-serif;
  width: 100%;
  cursor: default;
}
.whatsapp-link.active{
  opacity:1;
  pointer-events:auto;
  cursor: pointer;
}
.whatsapp-link.active:hover{
  background:#f8f8f8;
  transform:translateY(-2px);
  box-shadow:0 5px 15px rgba(0,0,0,0.1);
}

/* === МОБИЛЬНАЯ ВЕРСИЯ === */
@media(max-width:768px){
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .slider-wrapper {
    width: 100%;
    overscroll-behavior-x: contain;
  }
  
  .slider-track{
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
    touch-action: pan-y pinch-zoom;
  }
  
  .slider-track::-webkit-scrollbar {
    display: none;
  }
  
  .product-card{
    width: calc(100vw - 40px);
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    margin: 0 20px;
    scroll-snap-align: start;
    padding: 15px;
    min-height: 380px;
    will-change: transform;
  }
  
  .product-image {
    height: 150px;
  }
  
  .product-name {
    font-size: 15px;
    min-height: 36px;
  }
  
  .product-info {
    font-size: 13px;
  }
  
  .product-price {
    font-size: 17px;
  }
  
  .slider-nav-btn {
    width: 100px;
    height: 40px;
    font-size: 20px;
  }
  
  .slider-nav-counter {
    font-size: 15px;
  }
  
  .slider-nav-container {
    margin: 25px 0 30px 0;
  }
  
  .product-actions button {
    padding: 10px;
    font-size: 14px;
  }
  
  .delivery-fields input,
  .delivery-fields textarea {
    font-size: 16px;
  }
  
  .baton-progress {
    flex-direction: column;
    gap: 8px;
  }
  
  .baton-progress-bar {
    width: 100%;
  }
  
  .tiktok-overlay-content {
    padding: 25px;
    margin: 15px;
  }
  
  .tiktok-overlay h2 {
    font-size: 24px;
  }
  
  .tiktok-open-btn {
    padding: 14px 30px;
    font-size: 16px;
  }
}

/* === ДЕСКТОП ВЕРСИЯ === */
@media(min-width:769px){
  .slider-wrapper {
    overflow: hidden;
  }
  
  .product-card{
    width: 320px;
    max-width: 320px;
    min-width: 320px;
    margin: 0 10px;
    min-height: 440px;
  }
  
  .product-image {
    height: 200px;
  }
  
  .slider-track {
    display: flex;
    gap: 0;
    transition: transform 0.4s ease;
  }
  
  .slider-nav-btn {
    width: 120px;
    height: 44px;
  }
  
  .slider-nav-container {
    margin: 30px 0 40px 0;
  }
}
