/* === ШРИФТЫ === */
@font-face {
  font-family: 'benzin-semibold';
  src: url('/static/fonts/benzin-semibold.ttf') format('truetype');
}
@font-face {
  font-family: 'Geologica';
  src: url('/static/fonts/Geologica.ttf') format('truetype');
}

/* === БАЗА === */
body {
  margin: 0;
  background-color: #121212;
  color: #e0e0e0;
  font-family: 'Geologica', sans-serif;
}

h2, h4, p,
.cart-title,
.checkout-form label {
  font-family: 'benzin-semibold', sans-serif;
  color: #ffffff;
}

p {
  font-size: 16px;
}

.mb-4 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 15px; }
.mt-4 { margin-top: 20px; }

/* === ШАПКА === */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: #1e1e1e;
  color: #00c853;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-family: 'benzin-semibold', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #00c853;
}

.site-header .logo a,
.cart-icon {
  text-decoration: none;
  color: #00c853;
}

/* === КАТАЛОГ === */
.catalog-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.product-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px;
  justify-items: center;
}

.product {
  background-color: #1a1a1a;
  border-radius: 10px;
  padding: 10px;
  max-width: 320px;
  width: 105%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}


.product img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 6px;
}

.product-name {
  font-family: 'benzin-semibold', sans-serif;
  font-size: 13px; /* Шрифт названия товара */
  margin-top: 4px;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
  text-align: center;
}

.description {
  font-size: 11px; /* Шрифт описания товара */
  color: #999;
  margin: 4px 0;
  flex-grow: 1;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: center;
  font-weight: normal !important;
  font-family: 'Geologica', sans-serif !important;
}

.product-info {
  flex-grow: 1;
}

.product-action {
  margin-top: auto;
  display: flex;
  justify-content: center;
}

.add-btn,
.product button {
  font-size: 12px;
  background-color: #1e1e1e; /* #00c853 */
  color: #00ff00;
  border: 1px solid #00ff00;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 10px;
  font-family: 'benzin-semibold', sans-serif;
}

.add-btn:hover,
.product button:hover {
  background-color: #00ff00;
  color: black;
}

/* === КНОПКИ КОЛИЧЕСТВА === */
.quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.quantity-controls input {
    width: 25px;
    text-align: center;
    border-radius: 6px;
    padding: 6px;
    font-size: 14px;
    border: 1px solid #00ff00;
    background-color: #1e1e1e;
    color: #00ff00;
    box-shadow: 0 0 8px rgba(0, 195, 126, 0.4);
    transition: box-shadow 0.2s ease;
}

.quantity-controls button {
  background-color: #0f0;
  color: black;
  border: none;
  padding: 4px 7px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* === КОРЗИНА === */
.cart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 30px auto;
  max-width: 800px;
}

.cart-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 30px;
}

.cart-item-card,
.cart-item {
  background-color: #1a1a1a;
  border: 1px solid #00ff00;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #e0e0e0;
  width: 100%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.cart-item img,
.cart-item-card img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-name {
  font-size: 1rem;
  font-weight: bold;
  margin: 0 10px;
  flex: 1;
  color: #f0f0f0;
  font-family: 'benzin-semibold', sans-serif;
}

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

.quantity-btn,
.cart-item button {
  background-color: #00ff00;
  color: black;
  border: none;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
  cursor: pointer;
}

.remove-btn {
  background-color: transparent;
  color: #f00;
  border: 1px solid #f00;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 4px;
  font-weight: bold;
}

.remove-btn:hover {
  background-color: #f00;
  color: white;
}

/* === КНОПКА КОРЗИНЫ === */
.cart-icon {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background-color: #00c853;
  color: black;
  padding: 10px 14px;
  border-radius: 50px;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

.cart-icon-pop {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* === КНОПКА ЗАКАЗА === */
.order-button {
  background-color: #28a745;
  color: black;
  font-family: 'benzin-semibold', sans-serif;
  font-size: 16px;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  transition: 0.3s ease;
}

.order-button:hover {
  background-color: #45c156;
}

.order-button.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: 0.5s ease;
}

/* === СТРАНИЦА ПОДТВЕРЖДЕНИЯ === */
.order-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
}

.order-item {
  background-color: #1e1e1e;
  border-radius: 10px;
  padding: 15px;
  max-width: 350px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 15px;
}

.order-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.order-item-info h5 {
  font-size: 14px;
  color: #00c853;
  margin: 0;
}

.order-item-info p {
  font-size: 13px;
  margin: 0;
}

/* === ФОРМА ЗАКАЗА === */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #1a1a1a;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,255,0,0.05);
  margin-top: 20px;
}

.checkout-form input {
  padding: 10px;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  background-color: #121212;
  color: #e0e0e0;
  font-size: 14px;
  font-family: 'Geologica', sans-serif;
  outline: none;
  transition: border-color 0.3s ease;
}

.checkout-form input:focus {
  border-color: #00c853;
  box-shadow: 0 0 4px #00c85355;
}

/* === ССЫЛКА НАЗАД В КАТАЛОГ === */
.catalog-link {
  display: inline-block;
  color: #0f0;
  font-weight: bold;
  text-decoration: none;
  padding: 10px 20px;
  background-color: #111;
  border: 2px solid #0f0;
  border-radius: 10px;
  transition: background-color 0.3s ease;
}

.catalog-link:hover {
  background-color: #0f0;
  color: #000;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 480px) {
  .product {
    max-width: 105px;
    padding: 2px;
    word-break: normal;
  }

  .product img {
    width: 105%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0;
    margin-bottom: 4px;
  }

  .product-name {
      font-size: 6px;
      margin-top: 0px;
      margin-bottom: 2px;
      line-height: 1.2;
      white-space: normal;
      word-break: break-word;
      overflow-wrap: break-word;
      hyphens: none;
      text-align: center;
  }

  .description {
    font-size: 7px;
    margin: 1px 0;
    line-height: 1.2;
    margin-bottom: 2px;
    font-weight: normal !important;/* Убираем жирность */
    font-family: 'Geologica', sans-serif !important;
  }

  .add-btn,
  .product button {
    font-size: 7px;
    padding: 3px 7px;
  }

  .quantity-controls input {
        width: 25px;
        text-align: center;
        border-radius: 6px;
        padding: 6px;
        font-size: 14px;
        border: 1px solid #00ff00;
        background-color: #1e1e1e;
        color: #00ffae;
        box-shadow: 0 0 8px rgba(0, 195, 126, 0.4);
        transition: box-shadow 0.2s ease;
    }

  .quantity-controls button {
    width: 20px;        /* Увеличено */
    height: 20px;       /* Увеличено */
    font-size: 12px;    /* Увеличено */
    padding: 0;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-item-controls {
    margin-top: 10px;
    flex-wrap: wrap;
  }

  .cart-item-name {
    font-size: 0.9rem;
  }
}
