/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* ─────────── Глобальные переменные ─────────── */
:root {
  --primary-purple: #47256E;
  --accent-orange : #FE9800;
  --white         : #FFFFFF;
  --dark-gray     : #333333;
  --radius-sm     : 8px;
  --shadow-card   : 0 4px 12px rgba(71, 37, 110, 0.2);
  --product-card-size: 200px;
}

/* ─────────── Базовые сбросы ─────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Roboto', sans-serif;
  color: var(--dark-gray);
  background: var(--white);
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ═══════════════ HEADER ═══════════════ */
header {
  background: var(--primary-purple);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.logo { font-weight: 700; font-size: 1.5rem; }

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active { background: var(--accent-orange); }

.burger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--primary-purple);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 300px; }
  .burger         { display: block; }
}

/* ═══════════════ КАТАЛОГ ТОВАРОВ ═══════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  justify-items: center;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease-out both;
}

@keyframes fadeInUp {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--white);
  border-radius: var(--radius-sm);
  width: var(--product-card-size);
  padding: 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-top: 4px solid var(--accent-orange);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(71, 37, 110, 0.25);
}

.card img {
  width: 100%;
  height: var(--product-card-size);
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--dark-gray);
  line-height: 1.2;
  height: 2.4em;
  overflow: hidden;
}

.card p {
  font-size: 0.85rem;
  color: var(--dark-gray);
  opacity: 0.7;
  height: 2.5em;
  overflow: hidden;
  margin: 0 0 8px;
}

.card .price  { font-weight: 700; font-size: 1rem; margin-bottom: 12px; }
.card .btn-primary { width: 100%; font-size: 0.9rem; padding: 10px; }

/* ═══════════════ FOOTER ═══════════════ */
footer {
  background: var(--primary-purple);
  color: var(--white);
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 80px;
}

/* ═══════════════ КНОПКИ ═══════════════ */
.btn-primary {
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-orange);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(254,152,0,0.4); }
.btn-primary:active { transform: translateY(0);    box-shadow: 0 3px  8px rgba(254,152,0,0.3); }

/* ═══════════════ ФОРМА ДОСТАВКИ ═══════════════ */
.delivery-form label { display: block; margin-top: 12px; font-weight: 500; color: var(--primary-purple); }

.delivery-form input,
.delivery-form select,
.delivery-form textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(71, 37, 110, 0.3);
  background: var(--white);
  font-size: 0.95rem;
  color: var(--dark-gray);
}
.delivery-form textarea { resize: vertical; }

.form-section { font-size: 1.2rem; margin: 24px 0 12px; color: var(--accent-orange); }
.form-row     { display: flex; flex-wrap: wrap; gap: 16px; }
.form-row > label { flex: 1 1 200px; }

/* ═══════════════ ПРОЧЕЕ ═══════════════ */
main.container { padding-top: 40px; max-width: 720px; margin-inline: auto; }

/* ── продавец ── */
.store-section { margin-bottom: 64px; }
.store-title   {
  margin: 0 0 16px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-purple);
  border-left: 6px solid var(--accent-orange);
  padding-left: 12px;
  cursor: pointer;
  transition: color 0.2s;
}
.store-title:hover,
.store-title:focus-visible { color: var(--accent-orange); text-decoration: underline; }

/* ═══════════════  МОДАЛКИ  ═══════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.6);
  overflow: auto;
}
.modal-overlay.hidden { display: none; }

.modal-overlay      { z-index: 1000; }   /* продавец */
.product-overlay    { z-index: 1100; }   /* карточка товара выше */

/* ― продавец (белая «простыня») ― */
.modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;          /* снова широкая: 4 × 200 px + отступы */
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 24px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.3s ease-out both;
}
.modal-grid .card { width: var(--product-card-size); }

.modal-title { margin: 0 0 16px; font-size: 1.4rem; font-weight: 700; color: var(--primary-purple); }
.modal-close { position: absolute; top: 16px; right: 16px; font-size: 1.8rem; background: none; border: none; cursor: pointer; color: var(--dark-gray); line-height: 1; }

/* ― карточка товара (суженная на 30 %) ― */
.product-modal-content {
  max-width: 450px;           /* 70 % от прежних 640 px */
  padding: 24px;
}

.product-body           { display: flex; flex-direction: column; }
.product-image-large    {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.product-name  { font-size: 1.3rem; margin: 0 0 8px; }
.price-large   { font-weight: 700; font-size: 1.2rem; margin-bottom: 12px; }
.composition   { font-size: .9rem; opacity: .8; margin: 12px 0; }

/* курсор у кликабельных карточек */
.card.product-card { cursor: pointer; }

/* шире только для страницы корзины */
main.container.cart-page {
  max-width: 1080px;   /* 720 px × 1.5 = 1080 px  (+50 %) */
}

.qty-btn{
  width:32px;height:32px;
  border:none;border-radius:4px;
  background:var(--accent-orange);
  color:#fff;font-size:1rem;font-weight:700;
  cursor:pointer;
  line-height:1;
}
.qty-btn:disabled{opacity:.3;cursor:default;}


/* ===== доп. оформление футера ===== */
.footer {
  display: flex;
  flex-wrap: wrap;          /* перенос строк на мобильных */
  gap: 16px;
  justify-content: center;  /* все по центру, но можно space-between */
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;                /* расстояние между ссылками */
}

.footer a {
  color: inherit;           /* белый из var(--white) */
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}

.footer a:hover {
  border-color: currentColor;  /* тонкое подчёркивание при наведении */
}

.legal-doc { line-height:1.6; font-size:1rem; }
.legal-doc h2, .legal-doc h3 { margin-top:1.2em; font-weight:600; }
.legal-doc ul, .legal-doc ol { padding-left:1.4em; margin:0.6em 0; }
.legal-doc table { width:100%; border-collapse:collapse; margin:1em 0; }
.legal-doc th, .legal-doc td { border:1px solid rgba(0,0,0,0.1); padding:6px; }
