/* Цвета: природные бежевые */
:root {
  --beige-50: #faf8f5;
  --beige-100: #f5f0e8;
  --beige-200: #ebe3d6;
  --beige-300: #d4c4a8;
  --beige-400: #b8a078;
  --beige-500: #9a7b52;
  --beige-600: #7d6342;
  --beige-700: #5c4a32;
  --beige-800: #3d3222;
  --beige-900: #2a2218;
  --accent: #6b5344;
  --white: #fff;
  --shadow: rgba(44, 34, 24, 0.12);
  --radius: 999px;
  --radius-card: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--beige-100);
  color: var(--beige-800);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--beige-600);
  text-decoration: none;
}

a:hover {
  color: var(--beige-700);
}

/* Шапка */
.header {
  background: var(--white);
  box-shadow: 0 2px 12px var(--shadow);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-wrap {
  display: flex;
  align-items: center;
}

.logo-wrap img {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--beige-200);
  color: var(--beige-800);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav a:hover {
  background: var(--beige-300);
  color: var(--beige-900);
}

/* Кнопки — овально-закругленные */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

/* hover-анимация кнопок — в motion.js (spring) */

.btn-primary {
  background: var(--beige-500);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--beige-600);
}

.btn-secondary {
  background: var(--beige-200);
  color: var(--beige-800);
}

.btn-secondary:hover {
  background: var(--beige-300);
}

.btn-small {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

/* Контейнер */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

@media (max-width: 900px) {
  .nuts-slider { min-height: 0; }
  .nuts-slider-track { min-height: 0; }
  .nuts-slide .nut-card { min-height: 280px; }
  .nuts-slide .nut-card-caption { padding: 1rem; }
  .nuts-slide .nut-card-title { font-size: 1.1rem; }
}

/* ——— Плашки орехов: карусель по 4 ——— */
.nuts-cards-section {
  padding: 5rem 1.5rem 4rem;
  position: relative;
}

.nuts-slider {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 520px;
}

.nuts-slider-track {
  position: relative;
  width: 100%;
  min-height: 520px;
}

.nuts-slider-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  padding: 0 0.5rem;
  min-height: 520px;
}

.nuts-slide {
  flex: 0 0 90px;
  min-height: 480px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 8px 32px var(--shadow), 0 2px 12px rgba(0,0,0,0.06);
  transition: flex 0.5s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.3s ease;
}
.nuts-slide[hidden] {
  display: none !important;
}

.nuts-slide.nuts-slide-active {
  flex: 1 1 620px;
  max-width: 680px;
  box-shadow: 0 16px 48px rgba(44, 34, 24, 0.18), 0 8px 24px rgba(0,0,0,0.08);
}

/* Плашка: картинка на всю площадь, надпись поверх (картинка и текст на всю плашку) */
.nut-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
  border-radius: inherit;
  display: block;
}

.nut-card-bg {
  position: absolute;
  inset: 0;
  background: var(--beige-200);
}

.nut-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nut-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.4) 60%, transparent);
  color: #fff;
}

.nut-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.nut-card-subtitle {
  font-size: 0.95rem;
  margin: 0;
  opacity: 0.95;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Боковые превью: та же плашка, компактная подпись */
.nuts-slide.nuts-slide-side .nut-card-caption {
  padding: 0.6rem 0.5rem;
}

.nuts-slide.nuts-slide-side .nut-card-title {
  font-size: 0.75rem;
  margin: 0;
}

.nuts-slide.nuts-slide-side .nut-card-subtitle {
  display: none;
}

.nuts-slider-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.5rem;
}

.nuts-slider-dots button {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--beige-400);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.nuts-slider-dots button.active {
  background: var(--beige-600);
  transform: scale(1.2);
}

.nuts-cards-wrap {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  min-height: 520px;
}

/* ——— Контакты ——— */
.contact-section {
  background: linear-gradient(180deg, var(--beige-100) 0%, var(--beige-200) 100%);
  padding: 2.5rem 1rem;
  margin-top: 2rem;
}

.contact-section h2 {
  text-align: center;
  font-size: 1.4rem;
  color: var(--beige-800);
  margin-bottom: 1.5rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: 0 2px 10px var(--shadow);
}

.contact-icon {
  font-size: 1.25rem;
}

.contact-item a,
.contact-item span {
  color: var(--beige-700);
  font-size: 0.95rem;
}

.contact-item a:hover {
  color: var(--beige-800);
  text-decoration: underline;
}

/* ——— Подвал (футер) ——— */
.footer {
  margin-top: 0;
  padding: 2rem 1rem 1.5rem;
  background: var(--beige-800);
  color: var(--beige-200);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col strong {
  display: block;
  color: var(--white);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.footer-col p {
  margin: 0.25rem 0;
  color: var(--beige-300);
}

.footer-col a {
  color: var(--beige-200);
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--beige-600);
  color: var(--beige-400);
  font-size: 0.85rem;
}

/* Блок акций */
.promos-section h2 {
  margin-bottom: 1rem;
  color: var(--beige-800);
  font-size: 1.4rem;
}

.promos-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.promo-card {
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
}

.promo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.promo-card-caption {
  padding: 0.75rem 1rem;
  color: var(--beige-700);
}

.promo-card-title {
  display: block;
  font-weight: 600;
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.promo-card-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--beige-600);
}

/* Условия доставки и заказа */
.delivery-section {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 1.5rem 2rem;
  margin-top: 2rem;
  box-shadow: 0 4px 16px var(--shadow);
}

.delivery-section h2 {
  color: var(--beige-800);
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.delivery-section ul {
  list-style: none;
  padding-left: 0;
}

.delivery-section li {
  padding: 0.35rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--beige-700);
}

.delivery-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--beige-500);
  font-weight: bold;
}

/* Каталог */
.catalog-header {
  margin-bottom: 1.5rem;
}

.catalog-header h1 {
  font-size: 1.6rem;
  color: var(--beige-800);
}

.categories-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.categories-tabs .btn {
  border-radius: var(--radius);
}

.categories-tabs .btn.active {
  background: var(--beige-500);
  color: var(--white);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* hover-анимация карточек — в motion.js (spring) */

.product-card .img-wrap {
  width: 100%;
  height: 200px;
  background: var(--beige-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--beige-500);
  font-size: 3rem;
}

.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .title {
  font-weight: 600;
  color: var(--beige-800);
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.product-card .description {
  font-size: 0.9rem;
  color: var(--beige-600);
  margin-bottom: 0.5rem;
  flex: 1;
}

.product-card .price {
  font-weight: 700;
  color: var(--beige-700);
  margin-bottom: 0.75rem;
}

.product-card .grams-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-card input[type="number"] {
  width: 100px;
  padding: 0.5rem;
  border: 1px solid var(--beige-300);
  border-radius: 12px;
  font-size: 1rem;
}

.product-card .sum {
  font-weight: 600;
  color: var(--beige-700);
}

.product-card .add-cart {
  margin-top: 0.75rem;
  width: 100%;
  border-radius: var(--radius);
}

/* Корзина (плавающая) */
.cart-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
}

.cart-float .btn {
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 20px var(--shadow);
}

.cart-badge {
  background: var(--beige-700);
  color: var(--white);
  border-radius: var(--radius);
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  margin-left: 0.35rem;
}

/* Модальные окна */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 1.5rem 2rem;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.modal h2 {
  margin-bottom: 1rem;
  color: var(--beige-800);
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: var(--beige-700);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--beige-300);
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--beige-500);
  margin-top: 0.35rem;
}

.modal .buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal .buttons .btn {
  flex: 1;
  border-radius: var(--radius);
}

/* Корзина: список и редактирование */
.modal-cart {
  max-width: 480px;
}

.cart-hint {
  font-size: 0.9rem;
  color: var(--beige-600);
  margin-bottom: 1rem;
}

.cart-items {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.cart-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--beige-200);
}

.cart-row:last-child {
  border-bottom: none;
}

.cart-row-title {
  flex: 1;
  min-width: 100px;
  font-weight: 500;
  color: var(--beige-800);
}

.cart-row input[type="number"] {
  width: 80px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--beige-300);
  border-radius: 12px;
  font-size: 0.95rem;
}

.cart-row-sum {
  font-weight: 600;
  color: var(--beige-700);
  min-width: 4rem;
}

.cart-remove {
  border-radius: var(--radius);
}

.cart-total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--beige-800);
  margin-bottom: 1rem;
}

.cart-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cart-actions .btn {
  flex: 1;
  min-width: 140px;
  border-radius: var(--radius);
}

.cart-empty {
  color: var(--beige-500);
  padding: 1rem 0;
}

.hidden {
  display: none !important;
}

/* Админ */
.admin-bar {
  background: var(--beige-700);
  color: var(--white);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-bar a {
  color: var(--white);
  opacity: 0.9;
}

.admin-bar a:hover {
  opacity: 1;
}

.admin-section {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px var(--shadow);
}

.admin-section h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--beige-800);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--beige-200);
}

.admin-table th {
  font-weight: 600;
  color: var(--beige-700);
}

.admin-table img {
  max-height: 48px;
  width: auto;
  border-radius: 8px;
}

.admin-form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.admin-form-inline input,
.admin-form-inline select {
  padding: 0.5rem;
  border: 1px solid var(--beige-300);
  border-radius: 12px;
  font-size: 0.95rem;
}

.admin-form-inline input[type="file"] {
  padding: 0.35rem;
}

/* Футер */
.footer {
  margin-top: 3rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--beige-600);
  font-size: 0.9rem;
}

/* Адаптив */
@media (max-width: 768px) {
  .header {
    padding: 0.5rem 1rem;
  }

  .logo-wrap img {
    height: 40px;
  }

  .nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .container {
    padding: 1rem;
  }

  .nuts-cards-wrap {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .nuts-slide .nut-card { min-height: 260px; }
  .nuts-slide .nut-card-title { font-size: 1rem; }
  .nuts-slide .nut-card-caption { padding: 0.75rem; }

  .delivery-section {
    padding: 1rem 1.25rem;
  }

  .footer-grid {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .cart-float {
    bottom: 1rem;
    right: 1rem;
  }

  .modal {
    padding: 1.25rem 1.5rem;
  }

  .admin-table {
    font-size: 0.85rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.4rem 0.25rem;
  }
}

@media (max-width: 480px) {
  .categories-tabs .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .product-card .grams-row {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card input[type="number"] {
    width: 100%;
  }
}
