:root {
  --bg-main: #f7f3ec;
  --bg-info: #eee5d7;
  --accent-green: #747b4b;
  --text-main: #28241e;
  --border-soft: #d8cdbb;
  --muted: #6d6254;
  --panel: #fffaf2;
  --shadow: 0 16px 40px rgba(54, 43, 32, .09);
  --page-max: 1250px;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.topbar, .admin-bar {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  padding: 16px 0;
  background: var(--bg-main);
  border-bottom: 1px solid rgba(120, 110, 91, .12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--text-main);
  text-decoration: none;
}

.brand-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.08;
}

.brand img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

.main-nav, .footer nav, .admin-bar nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2vw, 28px);
  flex: 1;
}

.main-nav a, .footer nav a, .admin-bar nav a {
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
}

.main-nav a.active, .main-nav a:hover, .footer nav a:hover {
  border-color: var(--text-main);
}

.socials {
  display: flex;
  gap: 12px;
  color: #766b51;
  font-size: 13px;
  font-weight: 800;
}

.socials a, .contact-links a {
  text-decoration: none;
}

.contact-icon {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid rgba(116, 123, 75, .35);
  border-radius: 999px;
  color: var(--accent-green);
  font-size: 12px;
  font-weight: 800;
}

.outline-button, .green-button {
  min-height: 40px;
  border-radius: 7px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
}

.outline-button {
  background: transparent;
  border: 1px solid var(--accent-green);
  color: var(--text-main);
}

.green-button {
  border: 1px solid var(--accent-green);
  background: var(--accent-green);
  color: #fffdf7;
}

.small { min-height: 34px; padding: 7px 12px; }
.menu-toggle { display: none; border: 1px solid var(--border-soft); border-radius: 7px; background: var(--panel); padding: 8px 12px; }

.hero-static {
  position: relative;
  overflow: hidden;
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  background: var(--bg-main);
}

.hero-static > img {
  width: 100%;
  height: auto;
}

.hero-click-zone {
  position: absolute;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 0;
}

.hero-click-zone:hover {
  background: rgba(116, 123, 75, .08);
}

.hero-catalog-zone { left: 9.3%; top: 62.7%; width: 11.1%; height: 10.2%; }
.hero-contact-zone { left: 21.25%; top: 62.7%; width: 12.3%; height: 10.2%; }

.header-order-button {
  width: auto;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
}

.site-toast {
  position: fixed;
  top: 92px;
  right: max(18px, calc((100vw - var(--page-max)) / 2 + 18px));
  z-index: 20;
  max-width: min(320px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid rgba(116, 123, 75, .22);
  border-radius: 8px;
  background: rgba(255, 253, 247, .96);
  color: var(--text-main);
  box-shadow: 0 12px 30px rgba(60, 48, 33, .14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}

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

.dynamic-section {
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 18px;
  background: var(--bg-main);
}

#dynamic-content {
  transition: opacity .22s ease, transform .22s ease;
}

#dynamic-content.loading {
  opacity: .2;
  transform: translateY(8px);
}

.dynamic-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.dynamic-head h2 {
  margin: 0;
  font-size: 22px;
}

.dynamic-head button {
  border: 0;
  background: transparent;
  color: var(--accent-green);
  cursor: pointer;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-open {
  display: grid;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.product-open img {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: cover;
}

.product-open span {
  padding: 12px 14px 2px;
}

.product-open strong {
  padding: 0 14px 14px;
  font-size: 16px;
}

.cart-add {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  border: 1px solid var(--accent-green);
  border-radius: 7px;
  background: transparent;
  color: var(--accent-green);
  padding: 8px 10px;
  cursor: pointer;
}

.heart {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 999px;
  background: rgba(255, 250, 242, .92);
  color: var(--accent-green);
  padding: 6px 9px;
  cursor: pointer;
}

.heart.liked { background: var(--accent-green); color: #fff; }
.heart.large { position: static; margin: 8px 0 16px; }

.info-static {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1.2fr .95fr 1.25fr;
  gap: 28px;
  align-items: stretch;
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 22px;
  background: var(--bg-info);
  border-top: 1px solid rgba(120, 110, 91, .15);
}

.info-column {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 16px 24px;
  border-right: 1px solid rgba(110, 96, 75, .18);
  text-align: center;
  font-family: "Segoe UI", Arial, sans-serif;
}

.info-column h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.info-column p,
.info-column li {
  font-size: 12px;
}

.info-column ul, .info-column ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.info-column li + li {
  margin-top: 10px;
}

.info-column ul li,
.info-column ol li {
  position: relative;
  padding-left: 38px;
  text-align: left;
}

.info-column ul li::before,
.info-column ol li::before {
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(116, 123, 75, .45);
  border-radius: 50%;
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 700;
}

.info-column ul li::before {
  content: "✓";
}

.info-column ol {
  counter-reset: order-steps;
}

.info-column ol li {
  counter-increment: order-steps;
}

.info-column ol li::before {
  content: counter(order-steps);
  background: #ddd2c1;
  border-color: transparent;
  color: var(--text-main);
}

.contact-links {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.contact-links.big {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.contact-links a {
  color: var(--accent-green);
  font-weight: 700;
}

.info-image {
  width: 100%;
  height: 100%;
  min-height: 182px;
  border-radius: 7px;
  object-fit: cover;
}

.footer {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(var(--page-max), calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0;
  background: var(--bg-main);
}

.footer-copyright {
  color: var(--muted);
  font-size: 11pt;
  white-space: nowrap;
}

.modal {
  width: min(780px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  color: var(--text-main);
  box-shadow: var(--shadow);
}

.modal::backdrop { background: rgba(37, 31, 23, .5); }
.modal form, .contact-modal-body { display: grid; gap: 14px; }
.cart-modal-body { display: grid; gap: 14px; }
.modal-close {
  justify-self: end;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fffdf8;
  color: var(--text-main);
}

.product-modal { width: min(960px, calc(100vw - 28px)); }
.product-modal-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
}

.product-gallery {
  display: grid;
  gap: 10px;
  max-height: 74vh;
  overflow: auto;
}

.product-gallery img {
  width: 100%;
  border-radius: 7px;
}

.product-price {
  display: block;
  margin: 12px 0;
  font-size: 22px;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.product-action-button {
  width: auto;
  min-height: 38px;
  padding: 8px 14px;
}

.quantity-row input {
  max-width: 110px;
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #fff;
  font-size: 12px;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr 74px auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
}

.cart-row img {
  width: 64px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-row button {
  border: 0;
  background: transparent;
  color: var(--accent-green);
  text-decoration: underline;
  cursor: pointer;
}

.cart-total {
  color: var(--accent-green);
  font-weight: 800;
}

.order-info-card {
  max-width: 780px;
  padding: 22px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.order-info-card-wide {
  width: 100%;
  max-width: none;
}

.order-info-card p:last-child {
  margin-bottom: 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--panel);
}

.review-card img {
  width: 110px;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
}

.review-card span {
  color: var(--muted);
  font-size: 13px;
}

.flash-wrap {
  position: fixed;
  z-index: 50;
  top: 96px;
  right: 16px;
}

.flash {
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 7px;
  border-left: 4px solid var(--accent-green);
  background: #fff;
  box-shadow: var(--shadow);
}

.flash.error { border-left-color: #a23d30; }

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-card, .admin-form, .request-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--panel);
}

.form-submit {
  justify-self: start;
  width: auto;
}

.preview-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.preview-image {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #fffdf8;
}

.preview-image img {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: cover;
  border-radius: 6px;
}

.preview-image button {
  border: 0;
  background: transparent;
  color: var(--accent-green);
  text-decoration: underline;
  cursor: pointer;
}

.error-text {
  color: #a23d30;
}

.help-text {
  color: var(--muted);
  font-size: 14px;
}

.admin-card { width: min(420px, 100%); }
.admin-page { padding: 34px clamp(18px, 7vw, 144px); }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-version { color: var(--muted); font-size: 13px; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; }
th { color: var(--muted); }
.row-actions, .row-actions form { display: flex; gap: 10px; align-items: center; }
.row-actions { display: grid; gap: 8px; min-width: 220px; }
.row-actions form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions input { min-height: 34px; padding: 7px 10px; }
.row-actions button, .admin-images button, .request-card button { border: 0; background: transparent; color: var(--accent-green); text-decoration: underline; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.admin-images div { display: grid; gap: 8px; border: 1px solid var(--border-soft); border-radius: 7px; padding: 10px; }
.admin-images img { width: 100%; aspect-ratio: 1.35; object-fit: cover; border-radius: 6px; }
.request-list { display: grid; gap: 16px; }
.request-files { display: flex; flex-wrap: wrap; gap: 10px; }
.empty { padding: 18px; border: 1px solid var(--border-soft); border-radius: 7px; background: var(--panel); }

@media (max-width: 1180px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .info-static { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-image { grid-column: span 2; }
  .review-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .topbar, .admin-bar, .footer, .hero-static, .dynamic-section, .info-static { width: min(100% - 28px, var(--page-max)); }
  .topbar, .admin-bar, .footer { flex-wrap: wrap; padding: 14px 0; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .main-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 6px; order: 5; }
  .main-nav.open { display: flex; }
  .socials { margin-left: auto; }
  .outline-button { width: 100%; }
  .header-order-button { width: auto; }
  .product-action-button { width: auto; }
  .hero-catalog-zone { left: 9.2%; top: 62.7%; width: 11.4%; height: 10.6%; }
  .hero-contact-zone { left: 21.2%; top: 62.7%; width: 12.6%; height: 10.6%; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-modal-grid, .review-grid, .form-grid { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 54px 1fr; }
  .footer nav { order: 3; width: 100%; flex-wrap: wrap; justify-content: flex-start; }
}

@media (max-width: 560px) {
  .brand { font-size: 17px; }
  .brand img { width: 46px; height: 46px; }
  .dynamic-section { padding: 20px 0; }
  .product-grid { gap: 10px; }
  .info-static { grid-template-columns: 1fr; padding: 22px 18px; }
  .info-image { grid-column: auto; }
  .info-column { border-right: 0; border-bottom: 1px solid rgba(110, 96, 75, .18); }
  .review-card { grid-template-columns: 1fr; }
  .review-card img { width: 100%; height: auto; aspect-ratio: 1.35; }
}
