/* База + тема «Уютная кухня» (kitchen) */
:root,
[data-theme="kitchen"] {
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --bg: #f3ebe0;
  --bg-accent: radial-gradient(1200px 600px at 10% -10%, rgba(139, 90, 43, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(46, 125, 50, 0.1), transparent 50%),
    linear-gradient(180deg, #faf6f0 0%, #f0e8dc 100%);
  --surface: #fffdf9;
  --surface-2: rgba(255, 253, 249, 0.92);
  --text: #2a241c;
  --muted: #6b6358;
  --green: #2e6b3a;
  --green-dark: #1f4a28;
  --brown: #6b4423;
  --brown-light: #8b5a32;
  --border: #e2d6c8;
  --shadow: 0 18px 40px rgba(42, 36, 28, 0.08);
  --shadow-sm: 0 6px 16px rgba(42, 36, 28, 0.06);
  --radius-lg: 22px;
  --radius: 14px;
}

/* Тема «Свежий сад» (garden) */
[data-theme="garden"] {
  --bg: #e9f2eb;
  --bg-accent: radial-gradient(1000px 480px at 0% 0%, rgba(27, 94, 32, 0.14), transparent 55%),
    radial-gradient(800px 400px at 100% 20%, rgba(93, 64, 55, 0.08), transparent 50%),
    linear-gradient(180deg, #f4faf5 0%, #e3efe6 100%);
  --surface: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.95);
  --text: #1e2a22;
  --muted: #5c6b62;
  --green: #1b5e20;
  --green-dark: #0d3810;
  --brown: #4e342e;
  --brown-light: #6d4c41;
  --border: #c8e0cd;
  --shadow: 0 20px 48px rgba(27, 94, 32, 0.1);
  --shadow-sm: 0 8px 20px rgba(27, 94, 32, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-accent);
  min-height: 100vh;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

/* Шапка */
.site-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

.brand {
  color: var(--brown);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.2s ease;
  background: linear-gradient(135deg, var(--brown) 0%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand:hover {
  filter: brightness(1.2);
}

.site-nav {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* Корзина в шапке: кнопка + мини-корзина */
.cart-nav-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
  z-index: 100;
}

.cart-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 4px 6px 2px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: color 0.2s, border-color 0.2s;
}

.cart-nav-trigger:hover,
.cart-nav-wrap--active .cart-nav-trigger {
  color: var(--green);
  border-bottom-color: var(--green);
}

.cart-nav-icon {
  display: block;
  flex-shrink: 0;
}

#cart-badge {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: white;
  border-radius: 999px;
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 5px;
  margin-left: 0;
  vertical-align: middle;
}

.cart-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 280px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.cart-nav-wrap.is-open .cart-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.cart-dropdown__empty {
  margin: 0;
  font-size: 0.95rem;
}

.cart-dropdown__list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-dropdown__line {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px 10px;
  align-items: center;
  font-size: 0.92rem;
  line-height: 1.35;
}

.cart-dropdown__name {
  color: var(--text);
  font-weight: 500;
}

.cart-dropdown__qty {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.cart-dropdown__price {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.cart-dropdown__total {
  margin: 0 0 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.98rem;
}

.cart-dropdown__foot.actions {
  margin-top: 0;
  flex-direction: column;
  align-items: stretch;
}

.cart-dropdown__foot .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.cart-dropdown .btn-remove {
  font-size: 0.85rem;
  padding: 2px 6px;
  line-height: 1;
}

.btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.btn-remove:hover {
  color: #b71c1c;
  background: color-mix(in srgb, #b71c1c 8%, transparent);
}

.cart-item__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

main {
  padding: 32px 0 52px;
}

/* Главная — hero */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  background: radial-gradient(circle, rgba(46, 107, 58, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero--home {
  background-image: linear-gradient(
      to right,
      rgba(255, 253, 249, 0.97) 0%,
      rgba(255, 253, 249, 0.95) 40%,
      rgba(255, 253, 249, 0.3) 100%
    ),
    url("https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=1400&q=80");
  background-size: cover;
  background-position: center;
  min-height: 320px;
  display: flex;
  align-items: center;
}

.hero--home .hero__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
}

.hero h1,
.hero__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.hero .muted,
.hero__lead {
  margin: 0;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 52ch;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 12px 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 8%, transparent);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn.primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  border-color: var(--green-dark);
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.why-cards {
  margin-top: 16px;
  align-items: stretch;
}

.why-cards .why-card {
  min-height: 140px;
}

.why-card__icon {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(107, 68, 35, 0.15);
  border-color: var(--brown-light);
}

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

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

.product-content strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.section-title {
  position: relative;
  margin: 0 0 20px;
  padding-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--green);
  border-radius: 2px;
}

.reviews-section .section-title {
  margin-bottom: 20px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.review-card {
  padding: 8px;
  overflow: hidden;
}

.review-card img {
  width: 100%;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}

.review-card {
  margin: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.help-card h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.help-steps {
  margin: 12px 0 0;
  padding-left: 1.25em;
  line-height: 1.55;
}

.help-steps li {
  margin-bottom: 8px;
}

.help-steps li:last-child {
  margin-bottom: 0;
}

.help-steps--plain {
  list-style: none;
  padding-left: 0;
  margin-top: 12px;
}

.panel a:not(.btn) {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel a:not(.btn):hover {
  color: var(--green-dark);
}

.cart-list {
  display: grid;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

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

.qty-controls {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.qty-controls button {
  border: none;
  background: color-mix(in srgb, var(--brown) 6%, var(--surface));
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text);
  transition: background 0.15s;
}

.qty-controls button:hover {
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
}

.qty-controls span {
  display: inline-flex;
  width: 38px;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

form {
  display: grid;
  gap: 12px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent);
}

/* Подвал + переключатель тем */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  margin-top: auto;
}

.footer-inner {
  min-height: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.footer-inner > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner > a {
  color: var(--brown);
  text-decoration: none;
  font-weight: 500;
}

.footer-inner > a:hover {
  color: var(--green);
}

.footer-social {
  display: flex;
  align-items: center;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  padding: 4px;
  transition: color 0.2s ease;
}

.footer-social-link:hover {
  color: var(--green);
}

.footer-social-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.contact-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-main:hover {
  transform: scale(1.1);
}

.fab-main.active {
  background: var(--green-dark);
  transform: rotate(45deg);
}

.contact-fab__items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-fab__items.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.fab-item {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
  background: var(--surface);
  border: 1px solid var(--border);
}

.fab-item:hover {
  transform: scale(1.1);
}

.fab-phone {
  background: #fff;
  border: 2px solid #e0e0e0;
}

.fab-whatsapp {
  background: #25d366;
}

.fab-telegram {
  background: #2aabee;
}

.fab-max {
  background: #005FF9;
}

.fab-instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.theme-switch {
  display: none;
}

.theme-switch__label {
  font-weight: 600;
  color: var(--text);
}

.theme-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.theme-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.theme-btn.is-active {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border-color: var(--green-dark);
  color: #fff;
}

/* Кнопка «В корзину» на каталоге — краткий успех */
.btn.btn--to-cart.btn--added-success {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  border-color: var(--green-dark);
}

.btn.btn--to-cart.btn--added-success:hover {
  filter: brightness(1.05);
}

/* Toast (уведомления) */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  pointer-events: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(120%);
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--leaving {
  opacity: 0;
  transform: translateX(40%);
  transition:
    opacity 0.22s ease,
    transform 0.26s ease;
}

/* Пустая корзина */
.cart-empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(36px, 8vw, 64px) 24px;
  gap: 16px;
}

.cart-empty-state.is-visible {
  display: flex;
}

.cart-filled.is-hidden {
  display: none;
}

.cart-empty-state__icon {
  width: 96px;
  height: 96px;
  color: var(--muted);
  opacity: 0.85;
}

.cart-empty-state__icon svg {
  width: 100%;
  height: 100%;
}

.cart-empty-state__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--text);
}

.cart-empty-state .muted {
  margin: -4px 0 0;
  max-width: 32ch;
}

@media (max-width: 700px) {
  .toast-stack {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
  }

  main {
    padding-top: calc(120px + env(safe-area-inset-top, 0px));
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: max(4px, env(safe-area-inset-top, 0px));
  }

  .cart-nav-wrap {
    position: relative;
    z-index: 200;
  }

  .site-nav {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .site-nav::-webkit-scrollbar {
    height: 4px;
  }

  .site-nav > a,
  .site-nav .cart-nav-wrap {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .cart-dropdown {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }

  .cart-nav-wrap.is-open .cart-dropdown {
    display: none !important;
  }

  .product-card img {
    height: 200px;
  }

  .category-filters {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 8px;
    margin-top: 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .category-filters .btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-fab {
    bottom: 16px;
    right: 16px;
  }

  .fab-main {
    width: 50px;
    height: 50px;
  }

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