:root {
  /* Цветовая схема */
  --tg-bg: var(--tg-theme-bg-color, #f4f4f4);
  --tg-text: var(--tg-theme-text-color, #2a2a2a);
  --tg-button: var(--tg-theme-button-color, #e74c3c);
  --tg-button-hover: #c0392b;
  --tg-button-text: var(--tg-theme-button-text-color, #fff);
  --tg-secondary: #f39c12;
  --tg-border: #dfe6e9;
  --tg-success: #27ae60;
  --tg-error: #e74c3c;
  
  /* Размеры */
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Общие стили */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--tg-bg);
  color: var(--tg-text);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  font-size: 16px;
  padding-bottom: 80px;
}

/* Шапка можно оставить как есть */
.tg-header {
  padding: 1rem;
  background: black;
  color: var(--tg-button-text);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;            /* шапка */
  box-shadow: var(--shadow);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 140px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Сетка товаров */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Карточка товара */
.product-card {
  background: var(--tg-button-text);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  padding: 1rem;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 📌 Делаем сам Swiper-контейнер скругленным */
.swiper-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    min-height: 200px;
    border-radius: var(--radius) !important; /* Скругляем рамку */
}


/* 📌 Основной контейнер Swiper */
.swiper {
    width: 100%;
    height: auto;
    display: block;
}

/* 📌 Обертка для слайдов */
.swiper-wrapper {
    display: flex !important;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* 📌 Настройки самих слайдов */
.swiper-slide {
    flex-shrink: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 200px !important;
    opacity: 1 !important;
    visibility: visible !important;
    border-radius: var(--radius) !important;
    overflow: hidden !important;
}

/* 📌 Настройки изображений в Swiper */
.swiper-slide img {
    max-width: 100%;
    width: 100%;
    height: auto !important;
    object-fit: cover; /* Заполняем всю область */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: var(--radius) !important; /* Скругляем картинки */
}

/* 📌 Центрируем точки (пагинацию) */
.swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
    z-index: 10;
}

/* 📌 Делаем точки более заметными */
.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.8) !important;
    opacity: 0.6 !important;
    transition: opacity 0.3s ease;
    width: 10px; /* Размер точки */
    height: 10px;
    margin: 0 5px !important; /* Равномерное расстояние между точками */
}

/* 📌 Активная точка (более видимая) */
.swiper-pagination-bullet-active {
    opacity: 1 !important;
    background: white !important;
}


/* Фикс глобального `overflow`, чтобы Swiper не ломал прокрутку */
html, body {
    overflow: auto !important;
    position: relative !important;
}


/* Информация о товаре */
.product-info {
  padding: 1rem;
}

.product-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.price-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
}

.price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--tg-secondary);
}

/* Кнопки +/- */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  width: 40px; /* Делаем их больше */
  height: 40px;
  border: none;
  border-radius: 50%; /* Делаем кнопки круглыми */
  background: var(--tg-border);
  color: var(--tg-text);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:active {
  transform: scale(0.9);
}

.quantity-btn:hover {
  background: var(--tg-secondary);
  color: white;
}

/* Исправляем стили для количества */
.quantity {
  font-size: 20px;
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

/* Кнопка "В корзину" */
.add-to-cart {
  width: 100%;
  padding: 1rem;
  background: var(--tg-success);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: var(--transition);
}

.add-to-cart:hover {
  background: #219a52;
}

/* Кнопка корзины */
.cart-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--tg-button);
  color: var(--tg-button-text);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 999;
  transition: var(--transition);
}

.cart-fab:hover {
  transform: scale(1.05) rotate(5deg);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--tg-error);
  color: white;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Модальное окно корзины */
.tg-modal {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: var(--tg-button-text);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-height: 80vh;
  overflow-y: auto;
  z-index: 100;
  transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tg-modal.active {
  bottom: 0;
}

/* Делаем кнопки + и - горизонтальными */
.product-actions, .cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Отступ между кнопками */
}

.cart-item-controls button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--tg-border);
  cursor: pointer;
  transition: var(--transition);
}

.cart-item-controls button:active {
  transform: scale(0.9);
}

/* Кнопка закрытия корзины */
#close-cart {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--tg-error);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

#close-cart:hover {
  background: #c0392b;
  transform: scale(1.1);
}
/* Уменьшение изображения товара в корзине */
.cart-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


/* Поля ввода */
.tg-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--tg-border);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 10px;
    outline: none;
    transition: var(--transition);
}

.tg-input:focus {
    border-color: var(--tg-button);
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}

/* Кнопка "Отправить заявку" */
.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--tg-success);
    color: white;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.submit-btn:hover {
    background: #219a52;
    transform: scale(1.05);
}



.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-price {
    font-size: 18px;
    font-weight: bold;
    margin-left: auto; /* Чтобы цена прижималась к правому краю */
}

.cart-item {
    display: flex;
    flex-direction: column; /* Теперь элементы идут сверху вниз */
    gap: 5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tg-border);
}

.cart-item-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center; /* Выравниваем по центру */
    margin-bottom: 5px;
}

.cart-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-price {
    font-size: 18px;
    font-weight: bold;
    margin-left: auto; /* Чтобы цена прижималась к правому краю */
}

.total-price {
    display: flex;
    justify-content: flex-end; /* Выравнивание по правому краю */
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    margin-top: 15px; /* Отступ сверху */
    padding-top: 10px; /* Визуальное отделение */
    border-top: 2px solid var(--tg-border); /* Разделитель */
}

.cart-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: red;
    cursor: pointer;
    margin-left: 10px;
    transition: transform 0.2s ease-in-out;
}

.cart-remove:hover {
    transform: scale(1.2);
}

.cart-total {
    display: flex;
    justify-content: space-between; /* Выравниваем "Итого" влево, сумму вправо */
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    margin-top: 15px; /* Отступ сверху */
    padding-top: 10px; /* Визуальное отделение */
    border-top: 2px solid var(--tg-border); /* Разделитель */
}
.cart-total-price {
    margin-left: auto; /* Прижимает сумму к правому краю */
}

.logo {
  width: 80%; /* Устанавливаем ширину */
  height: auto;
  position: absolute;
  left: 10px; /* Отступ слева */
  top: 1%; /* Выход за пределы header */
  transform: translateY(10px); /* Поднимаем немного вверх */
  z-index: 10;
  filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease-in-out;
}



/* Мобильные стили */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .cart-item {
    grid-template-columns: 60px 1fr;
  }
  
  .tg-modal {
    padding: 1rem;
  }

  .swiper {
    height: 320px;
  }

  /* Стили кнопок + и - */
.quantity-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 50%;
    background: var(--tg-button);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}


/* Анимации */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Скроллбар */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--tg-button);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tg-button-hover);
}
