/* Общие стили */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  background: #fff;
  color: #333;
  line-height: 1.6;
}
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* Шапка */
.site-header {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 10px 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header .logo img {
  width: 150px;
  height: auto;
}
.menu a {
  margin: 0 15px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}
.menu a:hover {
  color: #ff4081;
}
.header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.insta {
  color: #ff4081;
  text-decoration: none;
}

/* Герой */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: #fafafa;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}
.hero p {
  font-size: 1.2rem;
  color: #555;
}
.logo-load {
  width: 120px;
  margin-bottom: 15px;
  border-radius: 50%;
  animation: pulse 3s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Карточки товаров */
.products {
  padding: 40px 20px;
}
.products h2 {
  text-align: center;
  margin-bottom: 30px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  justify-content: center;
}

.card {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s;
  position: relative;

  max-width: 280px; /* 🔹 ограничение по ширине */
  margin: 0 auto;   /* 🔹 чтобы одиночная карточка по центру */
}


.card {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s;
  position: relative;
}
.card:hover {
  transform: translateY(-5px);
}

/* Ссылка на фото */
.img-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Обертка изображения */
.img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}
.img-wrap img.main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s, filter 0.5s;
}
.img-link:hover .img-wrap img.main-img {
  transform: scale(1.1);
  filter: brightness(0.5);
}

/* Логотип при наведении */
.hover-logo {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  background: rgba(255,255,255,0.3);
  transition: opacity 0.5s;
  border-radius: 15px;
}
.img-link:hover .hover-logo {
  opacity: 1;
}
.hover-logo img {
  width: 100%;          /* почти вся ширина обертки */
  height: auto;        /* сохраняем пропорции */
  max-width: none;     /* снимаем ограничение */
  opacity: 0.7;
  object-fit: contain;
}

/* Метки на фото */
.label-on-image {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 12px;
  color: #fff;
  font-weight: bold;
  border-radius: 8px;
  font-size: 0.85em;
  text-transform: uppercase;
}
/* Цвета для меток */
.label-on-image.discount { background: #ff4d4d; }  
.label-on-image.new { background: #4caf50; }       
.label-on-image.hit { background: #6c63ff; }       
.label-on-image.sale { background: #ffa500; }   
.label-on-image.fire {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  background: linear-gradient(45deg, #ff0000, #ff8000, #ffff00);
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(255, 80, 0, 0.7);
  overflow: visible;
}

/* 🔥 языки огня сверху метки */
.label-on-image.fire::before,
.label-on-image.fire::after,
.label-on-image.fire span {
  content: "";
  position: absolute;
  bottom: 100%; /* поднимаем языки над меткой */
  width: 6px;
  height: 12px;
  background: radial-gradient(circle at bottom, #ffff00, #ff8000 50%, #ff0000);
  border-radius: 50% 50% 50% 50%;
  transform-origin: bottom center;
  animation: flameUp 1s infinite ease-in-out;
  opacity: 0.8;
}

.label-on-image.fire::after {
  width: 4px;
  height: 10px;
  left: 50%;
  animation-delay: 0.3s;
  opacity: 0.6;
}

.label-on-image.fire span {
  width: 3px;
  height: 8px;
  left: 60%;
  animation-delay: 0.5s;
  opacity: 0.5;
}

/* 🔥 анимация каплеобразных языков */
@keyframes flameUp {
  0%   { transform: translateY(0) scaleY(0.5) scaleX(0.7); opacity: 0.6; }
  50%  { transform: translateY(-6px) scaleY(1.2) scaleX(1); opacity: 1; }
  100% { transform: translateY(-12px) scaleY(0.5) scaleX(0.7); opacity: 0; }
}
/* Попереднє замовлення — такой же как и другие */
.label-on-image.preorder {
  top: 14px;
  left: 14px;

  background: linear-gradient(135deg, #20c997, #17a2b8); /* бирюзово-голубой */
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(23, 162, 184, 0.6);
  animation: preorderGlow 2s infinite alternate;
}

/* Мягкое свечение */
@keyframes preorderGlow {
  from {
    box-shadow: 0 0 6px rgba(23, 162, 184, 0.4);
  }
  to {
    box-shadow: 0 0 12px rgba(23, 162, 184, 0.8);
  }
}





/* Заголовки и цены */
.card h3 {
  margin: 15px 0 5px 0;
  font-size: 1.1em;
}
.card p {
  font-weight: bold;
  margin-bottom: 10px;
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 8px 20px;
  background: #000000;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
  margin-bottom: 10px;
}
.btn:hover {
  background: #a3a3a3;
}

/* Поле количества (стильное) */
.product-info input[type="number"] {
  width: 60px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
  text-align: center;
  font-weight: bold;
  margin-right: 10px;
}

/* Футер */
.site-footer {
  background: #222;
  color: #fff;
  padding: 20px 0;
  margin-top: 40px;
}
.footer-info p {
  margin: 5px 0;
}
.copy {
  text-align: center;
  font-size: 14px;
  margin-top: 10px;
  color: #bbb;
}

/* Страницы продукта */
.product-page {
  display: flex;
  gap: 30px;
  margin-top: 40px;
}
.product-view img {
  max-width: 400px;
  border-radius: 10px;
}
.product-info {
  flex: 1;
}
.product-info h1 { margin-top: 0; }
.product-info .price { font-size: 1.5rem; color: #ff4081; margin: 10px 0; }
.product-info form { margin-top: 20px; }

/* Корзина */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
.cart-table th, .cart-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
}
.cart-table th {
  background: #f5f5f5;
}

/* Форма заказа */
.checkout-page form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
}
.checkout-page input, .checkout-page select, .checkout-page textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}
.add-form textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  box-sizing: border-box;
}
/* Делает body и html 100% высоты */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Основная структура страницы */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Контент (main) растягивается на оставшееся место */
main {
  flex: 1;
}

/* Футер остается внизу */
.site-footer {
  background: #333; /* пример фона */
  color: #fff;
  padding: 20px 0;
}
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.item-card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform .3s;
}
.item-card:hover { transform: translateY(-5px); }
.item-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}
.item-card h3 { font-size: 1.1rem; margin: 8px 0; }
.item-card .price { font-weight: bold; margin: 5px 0; }
.item-card button {
  background: #6c63ff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .3s;
}
.item-card button:hover { background: #4a3fcf; }
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cart-table th, 
.cart-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.cart-table th {
  background: #fafafa;
  font-weight: 600;
  color: #333;
}

.cart-table img {
  border-radius: 8px;
}

.remove {
  color: #ff5252;
  font-size: 20px;
  text-decoration: none;
  font-weight: bold;
}

.cart-total {
  font-size: 18px;
  font-weight: 600;
  text-align: right;
  margin: 15px 0;
}

.checkout-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  font-size: 16px;
  border-radius: 10px;
  background: #000000;
  color: #fff;
  transition: 0.3s;
}
.checkout-btn:hover {
  background: #a3a3a3;
}

/* --- 📱 Мобильная версия --- */
@media (max-width: 768px) {
  .cart-table thead {
    display: none;
  }

  .cart-table, 
  .cart-table tbody, 
  .cart-table tr, 
  .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table tr {
    margin-bottom: 15px;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    position: relative; /* нужно для крестика */
  }

  .cart-table td {
    text-align: left;
    padding: 8px 0;
    border: none;
    font-size: 14px;
  }

  .cart-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: #666;
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
  }

  .cart-table img {
    width: 100px;
    height: auto;
    display: block;
    margin-bottom: 8px;
    border-radius: 8px;
  }

  /* крестик в углу */
  .cart-table td[data-label='Видалити'] {
    position: absolute;
    top: 8px;
    right: 12px;
    padding: 0;
  }

  .cart-table td[data-label='Видалити']::before {
    display: none;
  }

  .cart-table .remove-btn {
    color: #ffffff;
    font-size: 20px;
    text-decoration: none;
  }

  .cart-table .remove-btn:hover {
    color: #a3a3a3;
  }
}
