:root {
  --color-bg: #faf9f5;
  --color-surface: #ffffff;
  --color-text: #2d2a22;
  --color-muted: #7a7566;
  --color-border: #ece7da;

  /* Оливково-бузкова палітра бренду (задана дружиною) */
  --color-accent: #808000;         /* оливковий — основна палітра: кнопки, ціна */
  --color-accent-dark: #5c5c00;    /* темна оливка — hover, заголовки-акценти */
  --color-accent-light: #f2f2df;   /* світла оливка — чипси, іконки */
  --color-lilac: #c8a2c8;          /* бузковий — додаткова палітра: акцент, hover-рамки */
  --color-lilac-dark: #8f6a95;     /* темний бузковий — градієнт, hover-текст */
  --color-lilac-light: #f5eef5;    /* світлий бузковий — чипси, іконки */

  --color-danger: #b3261e;
  --radius: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--color-accent-dark), var(--color-lilac-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.main-nav a:hover { color: var(--color-lilac-dark); }

.search-form {
  flex: 1;
  min-width: 200px;
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--color-surface);
}

.search-form input {
  flex: 1;
  padding: 9px 16px;
  border: none;
  font-size: 0.95rem;
  background: transparent;
}
.search-form input:focus { outline: none; }

.search-form button {
  padding: 9px 18px;
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-form button:hover { background: var(--color-accent-dark); }

.cart-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--color-accent-dark);
  white-space: nowrap;
}

.cart-badge {
  background: var(--color-lilac-dark);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 0.8rem;
}

/* Messages */
.messages { list-style: none; margin: 16px 0 0; padding: 0; }
.messages li {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  border: 1px solid #dde4c8;
}
.messages li.error { background: #fbeaea; color: var(--color-danger); border-color: #f2c9c6; }
.messages li.info { background: var(--color-lilac-light); color: var(--color-lilac-dark); border-color: #e2d5ef; }

/* Layout */
.page { padding: 28px 0 60px; }
.page-title { font-size: 1.6rem; margin: 0 0 20px; letter-spacing: -0.01em; }

/* Category chips */
.category-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.category-chips a {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-muted);
  transition: all 0.15s ease;
}
.category-chips a.active,
.category-chips a:hover {
  background: linear-gradient(120deg, var(--color-accent), var(--color-lilac));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(122, 95, 160, 0.5);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.product-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.product-card:hover {
  box-shadow: 0 16px 32px -14px rgba(122, 95, 160, 0.35);
  transform: translateY(-6px);
  border-color: var(--color-lilac);
}

.product-card__image {
  aspect-ratio: 4 / 5;
  background: #f5f2ea;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-card__image img { transform: scale(1.05); }
.product-card__no-image { color: var(--color-muted); font-size: 0.85rem; }

.product-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card__title { font-weight: 700; font-size: 0.98rem; }
.product-card__category {
  font-size: 0.72rem;
  color: var(--color-lilac-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 1.15rem; color: var(--color-accent-dark); }
.price--old { text-decoration: line-through; color: var(--color-muted); font-size: 0.9rem; }
.out-of-stock { color: var(--color-danger); font-size: 0.85rem; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { background: var(--color-accent-dark); transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(79, 90, 42, 0.5); }
.btn--outline {
  background: transparent;
  color: var(--color-accent-dark);
  border: 2px solid var(--color-accent);
  padding: 10px 22px;
}
.btn--outline:hover { background: var(--color-accent); color: #fff; }
.btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.7);
  padding: 10px 22px;
}
.btn--ghost:hover { background: #fff; color: var(--color-accent-dark); }
.btn--small { padding: 8px 16px; font-size: 0.85rem; }
.btn--danger { background: var(--color-danger); }
.btn--danger:hover { background: #8f1e18; }
.btn[disabled] { background: var(--color-border); color: var(--color-muted); cursor: not-allowed; transform: none; box-shadow: none; }

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 40px;
}
@media (max-width: 720px) {
  .product-detail { grid-template-columns: 1fr; }
}
.product-detail__image {
  background: #f5f2ea;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
}
.product-detail__image img { width: 100%; height: 100%; object-fit: cover; }
.product-detail h1 { margin-top: 0; letter-spacing: -0.01em; }
.product-detail__desc { color: var(--color-muted); margin: 16px 0; white-space: pre-line; }

.related-products { margin-top: 48px; }
.section-title { font-size: 1.35rem; margin-bottom: 18px; letter-spacing: -0.01em; }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); }
.cart-table th, .cart-table td { padding: 14px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.cart-table th { background: var(--color-accent-light); font-size: 0.85rem; color: var(--color-accent-dark); text-transform: uppercase; letter-spacing: 0.03em; }
.cart-table tbody tr:hover { background: var(--color-lilac-light); }
.cart-table input[type="number"] { width: 64px; padding: 7px; border: 1px solid var(--color-border); border-radius: 8px; }
.cart-summary { display: flex; justify-content: flex-end; gap: 20px; align-items: center; margin-top: 24px; }
.cart-summary .total { font-size: 1.3rem; font-weight: 800; color: var(--color-accent-dark); }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--color-muted); }

/* Forms */
.form-grid { display: grid; gap: 16px; max-width: 520px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(111, 125, 60, 0.15);
}
.form-errors { color: var(--color-danger); font-size: 0.85rem; margin-top: 4px; }

.checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 36px; }
@media (max-width: 860px) { .checkout-layout { grid-template-columns: 1fr; } }
.order-summary { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; align-self: start; box-shadow: 0 12px 28px -18px rgba(45, 42, 34, 0.25); }
.order-summary li { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; }
.order-summary .total { border-top: 1px solid var(--color-border); margin-top: 10px; padding-top: 10px; font-weight: 800; display: flex; justify-content: space-between; color: var(--color-accent-dark); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-accent-dark), var(--color-lilac-dark));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  margin-bottom: 0;
}
.hero h1 { margin: 0 0 12px; font-size: 2.2rem; letter-spacing: -0.02em; }
.hero p { margin: 0 0 26px; opacity: 0.92; max-width: 540px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Смуга переваг (трохи "накладається" на hero знизу) */
.trust-bar {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -24px rgba(45, 42, 34, 0.3);
  margin: -32px 0 40px;
  position: relative;
  z-index: 2;
  padding: 28px;
  border: 1px solid var(--color-border);
}
.trust-bar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  text-align: center;
}
.trust-item__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}
.trust-item:nth-child(even) .trust-item__icon {
  background: var(--color-lilac-light);
  color: var(--color-lilac-dark);
}
.trust-item h3 { margin: 4px 0; font-size: 1rem; }
.trust-item p { margin: 0; color: var(--color-muted); font-size: 0.85rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 60px;
  padding: 28px 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.success-box { text-align: center; padding: 60px 20px; }
.success-box .icon { font-size: 3rem; }

.pagination { display: flex; gap: 10px; margin-top: 28px; justify-content: center; }
.pagination a, .pagination span { padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface); font-weight: 600; }
.pagination .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* Одиниці виміру та варіанти товару */
.unit-label { color: var(--color-muted); font-size: 0.9rem; }
.variant-select {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 10px 0 16px;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
}
.variant-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(111, 125, 60, 0.15);
}
.cart-item__unit { color: var(--color-muted); font-size: 0.8rem; margin-top: 2px; }

/* Радіо-кнопки способу доставки */
.form-field ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.form-field ul li { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.form-field ul input[type="radio"] { accent-color: var(--color-accent); width: 18px; height: 18px; }
