:root {
  --ink: #241916;
  --muted: #766961;
  --paper: #f7f2eb;
  --line: #d8c7b6;
  --brand: #6f2f1d;
  --brand-2: #2f5f56;
  --gold: #b9863a;
  --hide: #3c2219;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .56), rgba(247, 242, 235, .98)),
    var(--paper);
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  min-height: 42px;
  padding: 0 16px;
}

button:hover {
  background: var(--hide);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 24px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 56px);
  background: rgba(247, 242, 235, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.menu-toggle {
  min-width: 92px;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  min-width: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: white;
  font-weight: 900;
}

.cart-button b {
  color: var(--brand);
}

.lang-select {
  width: auto;
  min-width: 76px;
  font-weight: 850;
  background: white;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  color: white;
  background: var(--brand);
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.nav,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: clamp(16px, 4vw, 56px);
  width: min(360px, calc(100vw - 32px));
  display: none;
  align-items: stretch;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 244, .98);
  box-shadow: 0 24px 56px rgba(61, 35, 24, .18);
}

.menu-panel.open {
  display: flex;
}

.menu-panel a {
  width: 100%;
}

.nav a,
.filters a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, .55);
}

.nav b {
  color: var(--brand);
}

.filters a.active {
  color: white;
  background: var(--brand-2);
  border-color: var(--brand-2);
}

.hero {
  min-height: 460px;
  display: flex;
  align-items: end;
  padding: clamp(32px, 7vw, 92px) clamp(16px, 4vw, 56px);
  color: white;
  background:
    linear-gradient(90deg, rgba(35, 20, 15, .88), rgba(79, 42, 25, .36)),
    url("https://images.unsplash.com/photo-1600857062241-98e5dba7f214?auto=format&fit=crop&w=1800&q=80") center/cover;
  border-bottom: 8px solid var(--brand);
}

.hero div {
  max-width: 720px;
}

.eyebrow {
  color: var(--gold);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 82px);
  line-height: .98;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  font-size: 20px;
  line-height: 1.5;
}

.filters {
  padding: 24px clamp(16px, 4vw, 56px) 0;
}

.layout {
  display: block;
  padding: 24px clamp(16px, 4vw, 56px) 56px;
}

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

.product {
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(61, 35, 24, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.product:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 52px rgba(61, 35, 24, .14);
}

.product-link {
  display: block;
}

.product img,
.gallery-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #eadfce;
}

.product-body {
  padding: 16px;
}

.pill {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.product h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

.product h2 a:hover,
.back-link:hover,
.detail-actions a:hover {
  color: var(--brand);
}

.product p {
  min-height: 66px;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.buy-row,
.cart-item,
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.buy-row strong,
.cart-item strong {
  white-space: nowrap;
}

.just-added button {
  background: var(--brand-2);
}

.panel {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 56px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inline-notice {
  width: min(1180px, calc(100% - 32px));
  margin: 20px auto 0;
}

.panel.narrow {
  width: min(760px, calc(100% - 32px));
}

.notice {
  padding: 14px;
  border-radius: 6px;
  background: #edf7f2;
  color: #17483a;
}

.product-detail {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 64px;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 34px;
  align-items: start;
}

.gallery,
.detail-copy {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gallery {
  overflow: hidden;
}

.gallery-main {
  aspect-ratio: 1 / 1;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #fffaf4;
}

.thumb {
  min-height: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: white;
}

.thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
}

.detail-copy {
  padding: clamp(22px, 4vw, 38px);
}

.detail-copy h1 {
  margin: 12px 0 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.detail-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 800;
}

.detail-price {
  display: block;
  margin: 24px 0;
  font-size: 28px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
}

.error {
  padding: 14px;
  border-radius: 6px;
  background: #fff1ee;
  color: #8b2c1f;
}

.dev-link {
  overflow-wrap: anywhere;
  color: var(--brand-2);
}

.cart-list,
.checkout-form,
.admin-form,
.contact-form {
  display: grid;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  justify-content: stretch;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item small {
  color: var(--muted);
  font-weight: 800;
}

.remove-btn {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  background: #efe3d7;
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
}

.remove-btn:hover {
  background: var(--brand);
  color: white;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.check {
  display: flex;
  align-items: center;
}

.check input {
  width: auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 24px;
}

.admin-tabs a,
.admin-edit {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  font-weight: 800;
  background: #fffaf4;
}

.admin-tabs a.active {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

.admin-form {
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.admin-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admin-list-row a {
  color: var(--brand);
  font-weight: 850;
}

.telegram-status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.danger-btn {
  background: #8b2c1f;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
}

.contact-band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 64px;
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 28px;
  align-items: start;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(111, 47, 29, .08), rgba(47, 95, 86, .08)),
    #fffaf4;
}

.contact-band h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
}

.contact-band p {
  color: var(--muted);
  line-height: 1.6;
}

.contact-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 980px) {
  .site-header,
  .admin-grid,
  .product-detail,
  .contact-band {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 360px;
  }

  .thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cart-item,
  .buy-row,
  .admin-head,
  .footer,
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
