:root {
  --bg: #f3f3f0;
  --card: #ffffff;
  --text: #1f2b1f;
  --muted: #5e6b5e;
  --accent: #2f6f3a;
  --accent-2: #6fb86b;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100svh;
}

.page-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page-shell main {
  flex: 1 1 auto;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 247, 242, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e0e4d9;
}

.header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "nav nav";
  align-items: center;
  gap: clamp(10px, 1.8vw, 16px);
  padding: clamp(10px, 1.8vw, 14px) 0;
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  display: block;
  height: clamp(44px, 7vw, 64px);
  background: transparent;
  mix-blend-mode: multiply;
}

.brand-text {
  display: grid;
  line-height: 1;
}

.brand-top {
  font-size: clamp(12px, 2vw, 16px);
  color: #2b3a2b;
}

.brand-bottom {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  color: #1f2b1f;
}

.nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
  justify-content: stretch;
  align-items: center;
  width: 100%;
  font-size: clamp(14px, 2vw, 16px);
}

.nav a {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.nav a:hover { color: var(--accent); }

.header-actions {
  grid-area: actions;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-right: 10px;
}

.cart {
  display: grid;
  grid-template-columns: clamp(28px, 3vw, 42px) minmax(max-content, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 1px;
  color: var(--text);
}

.cart:hover { color: var(--accent); }

.cart img {
  grid-row: 1 / span 2;
  width: clamp(28px, 3vw, 42px);
  height: clamp(28px, 3vw, 42px);
  object-fit: contain;
  margin: 0;
  align-self: center;
}

.cart-label {
  display: grid;
  grid-auto-rows: min-content;
  justify-items: start;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.cart-title {
  font-size: clamp(11px, 1.45vw, 18px);
  font-weight: 700;
  line-height: 1.02;
  white-space: nowrap;
}

.cart-sub {
  font-size: clamp(9px, 1vw, 13px);
  color: #4f5e4f;
  font-weight: 600;
  line-height: 1.02;
  white-space: nowrap;
}

.phone {
  font-weight: 700;
  color: var(--accent);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-video,
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video {
  z-index: 0;
}

.hero-bg {
  z-index: 0;
}

@supports (object-fit: cover) {
  .hero-bg { display: none; }
}

.hero-content {
  position: relative;
  padding: 64px 0 72px;
  color: #f6fff3;
  text-align: left;
}

.hero-tag {
  margin: 0 0 8px;
  font-size: 18px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.2;
}

.hero-sub {
  margin: 0 0 18px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 22px;
  font-weight: 600;
}

.btn.outline {
  background: #fff;
  color: var(--accent);
}

.btn.small {
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 14px;
}

.btn.big {
  padding: 12px 26px;
  border-radius: 24px;
  font-size: 16px;
}

.why-strip {
  margin-top: -26px;
  position: relative;
  z-index: 2;
}

.why-strip-inner {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  padding: 10px 16px;
}

.why-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.why-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  white-space: normal;
}

.why-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.why-tight {
  white-space: normal;
}

.why-tight span {
  max-width: 120px;
}

.section {
  padding: 40px 0;
}

.section h2 {
  text-align: center;
  margin: 0 0 20px;
}

.grid {
  display: grid;
  gap: 18px;
}

.products {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  display: grid;
  gap: 8px;
}

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

.price { color: var(--accent); font-weight: 700; }

.catalog-cta {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.catalog-cta-top {
  margin-top: 0;
  margin-bottom: 20px;
}

.products-home {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-product-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.home-product-image {
  width: 100%;
  padding-top: 68%;
  border-radius: 14px;
  background: #edf1e8 center / cover no-repeat;
  cursor: pointer;
}

.home-product-card h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  cursor: pointer;
}

.home-product-card .muted {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.1;
  min-height: 2.2em;
  cursor: pointer;
  flex: 1 1 auto;
}

.home-product-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-top: auto;
}

.home-category {
  color: #5b6558;
  font-size: 16px;
}

.home-cart-zone {
  display: flex;
  align-items: end;
  margin-top: 2px;
}

.home-cart-zone > * {
  width: 100%;
}

.home-price {
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.price-stack {
  display: grid;
  gap: 4px;
}

.price-promo-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-old {
  font-size: 20px;
  color: #747d70;
  text-decoration: line-through;
  line-height: 1;
}

.price-new {
  color: #c43f3f;
  font-size: 32px;
  line-height: 1;
}

.promo-flag {
  background: #c43f3f;
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.home-cart-zone button,
.qty-inline button {
  height: 40px;
  border: 1px solid var(--accent);
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.qty-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty-inline button {
  width: 40px;
  padding: 0;
}

.qty-inline input {
  width: 64px;
  height: 40px;
  border: 1px solid #d6dfd0;
  border-radius: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.tips-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.tips-carousel-track {
  display: flex;
  gap: 14px;
  width: max-content;
  will-change: transform;
}

.tips-carousel.is-moving .tips-carousel-track {
  animation: tips-slide var(--tips-duration, 40s) linear infinite;
}

.tips-carousel.is-moving:hover .tips-carousel-track {
  animation-play-state: paused;
}

.tips-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #2f6f3a;
  background: rgba(255, 255, 255, 0.92);
  color: #2f6f3a;
  font-size: 30px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tips-arrow-left { left: 0; }
.tips-arrow-right { right: 0; }

.tips-carousel.has-controls:hover .tips-arrow,
.tips-carousel.has-controls:focus-within .tips-arrow {
  opacity: 1;
  pointer-events: auto;
}

.tip-card {
  flex: 0 0 260px;
  width: 260px;
  background: var(--card);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  cursor: pointer;
  user-select: none;
}

.tip-card img {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.tip-card h3 {
  margin: 10px 2px 4px;
  font-size: 20px;
  line-height: 1.2;
}

@keyframes tips-slide {
  from { transform: translateX(0); }
  to { transform: translateX(calc(var(--tips-distance, 0px) * -1)); }
}

.media {
  padding-top: 10px;
}

.media-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}

.video {
  position: relative;
}

.video img { width: 100%; border-radius: 16px; }

.play {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: #fff;
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 600;
}

.telegram {
  background: #f7f8f2;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  display: grid;
  gap: 10px;
}

.site-footer {
  position: relative;
  color: #f7f4ee;
  padding: clamp(18px, 3vw, 28px) 0;
  margin-top: auto;
}

.footer-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.footer-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  font-size: clamp(13px, 1.6vw, 14px);
}
.footer-link {
  display: inline-flex;
  justify-content: center;
}

.footer-link:hover { text-decoration: underline; }

.cookie-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d6dfd0;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.cookie-notice p {
  margin: 0;
  color: #2b3b2d;
  font-size: 15px;
  line-height: 1.3;
}

.cookie-notice button {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
}

.feedback-modal {
  width: min(760px, 94vw);
  border: none;
  border-radius: 18px;
  padding: 18px 20px;
}

.feedback-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.feedback-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.feedback-modal .modal-head h3 {
  margin: 0;
  font-size: 32px;
}

.feedback-modal .modal-body p {
  margin: 0;
  font-size: 22px;
  color: #2b3a2b;
}

.feedback-modal .modal-close-btn {
  height: 44px;
  border-radius: 12px;
  border: 1px solid #2f6f3a;
  background: #2f6f3a;
  color: #fff;
  padding: 0 14px;
  font-size: 16px;
  cursor: pointer;
}

.feedback-form {
  display: grid;
  gap: 10px;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  color: #2b3a2b;
  font-size: 16px;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  height: 46px;
  border-radius: 10px;
  border: 1px solid #d6dfd0;
  background: #fff;
  padding: 0 12px;
  font: inherit;
}

.feedback-form textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.feedback-rules {
  margin: 0 0 4px;
  color: #405240;
  font-size: 15px;
  line-height: 1.35;
}

.feedback-message-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 240px);
}

.feedback-consent-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.feedback-read-btn {
  height: 40px;
  border-radius: 10px;
  border: 1px solid #2f6f3a;
  background: transparent;
  color: #2f6f3a;
  padding: 0 12px;
  font-size: 14px;
  cursor: pointer;
}

.feedback-consent-label {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.feedback-consent-link {
  color: var(--accent);
  text-decoration: underline;
}

.feedback-consent-link:hover {
  color: #245a2d;
}

.feedback-consent-details {
  border: 1px solid #d6dfd0;
  border-radius: 10px;
  background: #f9fbf8;
  padding: 8px 10px;
}

.feedback-consent-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #1f2b1f;
}

.feedback-consent-details div {
  margin-top: 8px;
  color: #425342;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
}

.feedback-actions button {
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.feedback-actions button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .container {
    width: min(1100px, calc(100vw - 24px));
  }

  .site-header {
    padding: 0;
  }

  .header-row {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    align-items: start;
    gap: 8px 12px;
    padding: 8px 92px 10px 0;
  }

  .brand {
    justify-content: flex-start;
    min-width: 0;
    gap: 8px;
  }

  .brand img {
    height: 40px;
  }

  .brand-top {
    font-size: 11px;
  }

  .brand-bottom {
    font-size: 15px;
  }

  .header-actions {
    position: absolute;
    top: 6px;
    right: 0;
    width: auto;
    justify-content: flex-end;
    min-width: 0;
  }

  .nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 14px;
    padding-top: 0;
    font-size: 14px;
    white-space: nowrap;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .cart {
    justify-content: flex-end;
    gap: 2px;
  }

  .cart img {
    width: 46px;
    height: 46px;
    margin-right: -4px;
  }

  .cart-label {
    gap: 0;
  }

  .cart-title {
    font-size: 13px;
  }

  .cart-sub {
    font-size: 10px;
  }

  .why-strip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .products-home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid,
  .footer-row,
  .cookie-notice,
  .feedback-message-grid {
    grid-template-columns: 1fr;
  }

  .footer-row {
    justify-items: center;
    text-align: center;
  }

  .feedback-consent-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100vw - 20px);
  }

  .header-row {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    gap: 8px;
    padding: 6px 0 8px;
  }

  .brand {
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: calc(100% - 104px);
  }

  .brand img {
    height: 34px;
    flex: 0 0 auto;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-top {
    font-size: 10px;
  }

  .brand-bottom {
    font-size: 13px;
  }

  .header-actions {
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    justify-content: flex-end;
    align-items: flex-start;
  }

  .cart {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    justify-content: end;
    width: 100px;
    gap: 1px 4px;
    line-height: 1;
  }

  .cart img {
    width: 24px;
    height: 24px;
    margin-right: 0;
    margin-top: 1px;
  }

  .cart-label {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
  }

  .cart-title {
    font-size: 9px;
    white-space: nowrap;
  }

  .cart-sub {
    font-size: 9px;
    white-space: nowrap;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    padding-right: 0;
    font-size: 9px;
    overflow: visible;
    white-space: normal;
  }

  .nav a {
    min-width: 0;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    font-size: 0;
  }

  .nav a::before {
    font-size: 9px;
    line-height: 1.1;
  }

  .nav a:nth-child(1)::before { content: "Каталог"; }
  .nav a:nth-child(2)::before { content: "Советы"; }
  .nav a:nth-child(3)::before { content: "Вопросы"; }
  .nav a:nth-child(4)::before { content: "Контакты"; }

  .products-home,
  .why-strip-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified custom dialog (alerts/confirms) */
.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3500;
  background: rgba(13, 28, 20, 0.46);
  display: grid;
  place-items: center;
  padding: 16px;
}

.ui-dialog-box {
  width: min(460px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(49, 126, 67, 0.2);
  box-shadow: 0 22px 50px rgba(13, 27, 19, 0.24);
  padding: 20px;
}

.ui-dialog-head h3 {
  margin: 0;
  color: #12271c;
  font-size: 30px;
  font-weight: 700;
}

.ui-dialog-message {
  margin-top: 12px;
  color: #294338;
  font-size: 26px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.ui-dialog-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ui-dialog-btn {
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 14px;
  border: 1px solid #2f7d41;
  font-size: 24px;
  cursor: pointer;
}

.ui-dialog-btn-outline {
  background: #fff;
  color: #2f7d41;
}

.ui-dialog-btn-primary {
  background: #2f7d41;
  color: #fff;
}


@media (max-width: 600px) {
  .header-row {
    padding: 6px 0 8px !important;
    gap: 8px !important;
  }

  .brand {
    max-width: calc(100% - 118px) !important;
  }

  .header-actions {
    top: 8px !important;
    right: 0 !important;
    width: 118px !important;
    align-items: flex-start !important;
    padding-right: 0 !important;
  }

  .cart {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
    width: 118px !important;
    gap: 0 6px !important;
    align-items: center !important;
  }

  .cart img {
    grid-row: 1 / span 2;
    width: 28px !important;
    height: 28px !important;
    object-fit: contain;
    margin: 0 !important;
    align-self: center;
  }

  .cart-label {
    display: grid !important;
    grid-auto-rows: min-content;
    justify-items: start !important;
    align-content: center;
    gap: 2px !important;
    min-width: 0;
  }

  .cart-title {
    font-size: 11px !important;
    font-weight: 700;
    line-height: 1.02;
    white-space: nowrap;
  }

  .cart-sub {
    font-size: 9px !important;
    line-height: 1.02;
    white-space: nowrap;
  }

  .nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 4px !important;
    padding-right: 0 !important;
    justify-items: stretch !important;
  }

  .nav a {
    font-size: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden;
    line-height: 1.1 !important;
  }

  .nav a::before {
    font-size: 10px !important;
    line-height: 1.1;
  }
}

.home-product-card.is-sold-out {
  background: #f4f4f1;
  border: 1px solid #d8ddd1;
  opacity: 0.9;
}

.home-product-card.is-sold-out .home-product-image {
  filter: grayscale(1);
}
