:root {
  --primary-green: #2c5f2d;
  --accent-red: #97151a;
  --bg-color: #f5f5f0;
  --text-dark: #333333;
  --text-light: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
}

header {
  color: var(--text-light);
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.cart-status {
  background-color: var(--accent-red);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

main {
  padding: 2rem 5%;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(310px, 1fr));
  gap: 2rem;
  margin-bottom: 10rem;
  align-items: start;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1500px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(310px, 1fr));
  }
}

@media (max-width: 1110px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* =========================================
   СТИЛИ КАРТОЧКИ С ИСПРАВЛЕНИЯМИ
   ========================================= */
.product-card-v2 {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card-v2.expanded {
  border-bottom-color: var(--accent-red);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
}

/* Зона клика для раскрытия. 
   Включает слайдер и заголовок.
*/
.card-header-clickable {
  cursor: pointer;
}

/* --- СЛАЙДЕР --- */
.slider-container {
  position: relative;
  height: 220px;
  background-color: #eee;
  overflow: hidden;
}

.slide {
  display: none; /* Скрываем все слайды */
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #fff;
  font-size: 1.2rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  background-size: cover;
}

.slide.active {
  display: flex; /* Показываем активный */
  animation: fadeEffect 0.5s;
}

/* Кнопки слайдера */
.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  margin-top: -22px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  background-color: rgba(0, 0, 0, 0.2);
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
  background-color: var(--accent-red);
}

@keyframes fadeEffect {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}
/* ---------------- */

.product-summary {
  padding: 1.2rem;
  text-align: center;
  background: #fff;
  position: relative;
  z-index: 2;
}

.product-summary h3 {
  color: var(--primary-green);
  font-size: 1.4rem;
  margin: 0;
}

.click-hint {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
  transition: opacity 0.3s;
  cursor: pointer;
}

/* Скрываем подсказку "подробнее", если карточка открыта */
.product-card-v2.expanded .click-hint {
  opacity: 0;
}

/* --- ДЕТАЛИ (ТЕКСТ) --- */
.product-details {
  display: none;
  padding: 0 1.5rem 1.5rem 1.5rem;
  background-color: #fcfcfc;
  border-top: 1px solid #eee;
  text-align: left;
  /* Возвращаем обычный курсор для текста */
}

.product-card-v2.expanded .product-details {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-details .description {
  margin-bottom: 1.5rem;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
}

.card-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #ddd;
}

.product-card-v2 .price {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent-red);
}

/* Кнопки */
.btn {
  background-color: var(--primary-green);
  color: var(--text-light);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}
.btn:hover {
  background-color: #1f4520;
}

.btn-add {
  background-color: var(--accent-red);
  padding: 0.6rem 1.2rem;
}
.btn-add:hover {
  background-color: #7a1115;
}

/* Оформление заказа */
.order-section {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  border-top: 5px solid var(--primary-green);
  margin-top: 2rem;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.total-price {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: right;
  color: var(--accent-red);
  margin: 1rem 0;
}

.order-form {
  display: grid;
  gap: 1rem;
}

.order-form input {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
}

footer {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
  background: #222;
  color: #888;
}
.cart-layout {
  display: flex;
  gap: 2rem;
}

.cart-products {
  flex: 2;
}

.cart-summary {
  flex: 1;
}

.summary-box {
  position: sticky;
  top: 100px;
  background: white;
  padding: 2rem;
  border-radius: 8px;
}

.quantity-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-remove {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #97151a;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  transform: scale(0.8);
  transition: 0.3s;
}

.modal.active .modal-content {
  transform: scale(1);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 9999;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  width: 500px;
  max-width: 90%;
  transform: scale(0.85);
  transition: 0.3s;
  position: relative;
}

.modal-large {
  width: 600px;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 22px;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: var(--primary-green);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.3s;
  z-index: 10000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.cart-item {
  background: #fff;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.quantity-controls form button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: var(--primary-green);
  color: white;
  cursor: pointer;
}

.quantity-controls span {
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

.summary-box {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.btn-clear:hover {
  color: red;
}
.btn-clear {
  margin-top: 1rem;
  margin-bottom: 1rem;

  border: none;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: 6px;
}
.product-details {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    padding 0.4s ease;
  padding: 0 1.5rem;
  background-color: #fcfcfc;
  border-top: 1px solid #eee;
}

.product-card-v2.expanded .product-details {
  max-height: 500px; /* достаточно для текста */
  padding: 1rem 1.5rem 1.5rem 1.5rem;
}
.toast {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: var(--primary-green);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.3s;
  z-index: 10000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.checkout-container {
  display: flex;
  gap: 40px;
  max-width: 1200px;
  margin: auto;
}

.checkout-form {
  flex: 2;
}

.checkout-summary {
  flex: 1;
  background: #f7f7f7;
  padding: 20px;
  border-radius: 10px;
}

.checkout-form input,
.checkout-form select {
  width: 100%;
  margin-bottom: 15px;
  padding: 10px;
}
.variant-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.variant-btn:hover {
  border-color: black;
}

.variant-btn.active {
  background: black;
  color: white;
  border-color: black;
}

.dynamic-price {
  font-weight: 600;
}
body {
  font-family: system-ui;
  background: #f5f7fa;
  margin: 0;
}

.container {
  max-width: 900px;
  margin: 50px auto;
  background: white;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.qty button {
  padding: 6px 10px;
  border: none;
  background: #111;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

.total {
  text-align: right;
  font-size: 22px;
  margin-top: 20px;
  font-weight: bold;
}
.p10 {
  margin-top: 410px;
}
/* Круглые стрелки слайдера */

.product-card-v2:hover {
  transform: translateY(-6px);
  box-shadow: 0px 5px 20px x rgba(0, 0, 0, 0.1);
}
.cart-legal {
  font-size: 13px;
  margin-top: 10px;
  color: #666;
}
.cart-legal a {
  text-decoration: underline;
  color: #757575;
}
.slide {
  opacity: 0;
  transition: 0.4s;
}

.slide.active {
  opacity: 1;
}

.prev {
  left: 10px;
}
.next {
  right: 10px;
}

.slide.active {
  opacity: 1;
}
.slider button {
  position: absolute;
  top: 50%;
  width: 10%;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
}

.slider .prev {
  left: 10px;
}
.slider .next {
  right: 10px;
}
.admin-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.admin-card {
  display: block;
  padding: 15px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: black;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 200px);
  gap: 20px;
}

.variant-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #fff;
}
.save-btn {
  margin-top: 30px;
  padding: 15px;
  background: black;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
