:root {
  --ink: #17211f;
  --muted: #60706c;
  --line: #d9e1dd;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --steel: #53625f;
  --accent: #b3261e;
  --accent-dark: #861b16;
  --olive: #4b634f;
  --gold: #c6903d;
  --shadow: 0 18px 50px rgba(27, 38, 34, 0.16);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(247, 248, 245, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

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

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  gap: 24px;
  color: var(--steel);
  font-size: 15px;
}

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

.header-actions,
.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  padding: 4px;
  background: #e9eeeb;
  border-radius: 8px;
}

.lang-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  font-size: 16px;
}

.lang-switch button,
.icon-action {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.lang-switch button {
  min-width: 76px;
  padding: 0 10px;
  color: var(--steel);
  background: transparent;
}

.lang-switch button.active {
  color: white;
  background: var(--ink);
}

.icon-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.cart-trigger strong {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 999px;
  font-size: 12px;
}

.hero {
  position: relative;
  min-height: clamp(560px, 78vh, 760px);
  overflow: hidden;
  background: #1d2422;
}

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

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(14, 19, 18, 0.78), rgba(14, 19, 18, 0.32) 48%, rgba(14, 19, 18, 0.05)),
    linear-gradient(0deg, rgba(14, 19, 18, 0.5), transparent 34%);
}

.hero-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: clamp(500px, 70vh, 680px);
  max-width: 760px;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(20px, 5vw, 72px) 110px;
  color: white;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 28px;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.5;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-actions,
.product-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary,
.secondary,
.sync-button,
.product-foot button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  padding: 0 20px;
  color: white;
  background: var(--accent);
}

.secondary {
  padding: 0 20px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.stats div {
  min-height: 108px;
  padding: 24px clamp(18px, 4vw, 46px);
  background: white;
}

.stats strong {
  display: block;
  color: var(--accent);
  font-size: 32px;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 320px) 1fr;
  gap: clamp(20px, 3vw, 36px);
  padding: clamp(30px, 5vw, 64px) clamp(18px, 4vw, 56px);
}

.filters {
  position: sticky;
  top: 84px;
  align-self: start;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(27, 38, 34, 0.07);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}

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

label {
  color: var(--steel);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12);
}

.sync-button {
  width: 100%;
  color: white;
  background: var(--olive);
}

.sync-state {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-only,
#api-endpoint,
.field:has(#api-endpoint),
#sync {
  display: none !important;
}

.economy-note {
  display: grid;
  gap: 5px;
  margin: 4px 0 15px;
  padding: 12px;
  background: #f0f3ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.economy-note strong {
  color: var(--ink);
  font-size: 13px;
}

.economy-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.bundle-note,
.logistics-note {
  display: grid;
  gap: 5px;
  margin: 0 0 15px;
  padding: 12px;
  color: var(--olive);
  background: #f2f6ec;
  border: 1px solid #d7e3cd;
  border-radius: 8px;
}

.bundle-note strong,
.logistics-note strong {
  font-size: 13px;
}

.bundle-note span,
.logistics-note span {
  color: var(--steel);
  font-size: 12px;
  line-height: 1.35;
}

.logistics-note {
  background: #f7f8f5;
}

.catalog-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.catalog-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

.category-browser {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.category-browser-head {
  display: flex;
  justify-content: flex-end;
}

.category-reset {
  min-height: 36px;
  padding: 0 13px;
  color: var(--olive);
  background: #eef2ef;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.category-reset.active {
  color: white;
  background: var(--ink);
}

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

.subcategory-grid {
  padding: 12px;
  background: #eef2ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.category-tile {
  position: relative;
  display: grid;
  min-height: 122px;
  overflow: hidden;
  padding: 16px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(27, 38, 34, 0.05);
  cursor: pointer;
}

.category-tile::after {
  position: absolute;
  inset: auto 0 0 0;
  height: 44%;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0));
  content: "";
}

.category-tile span {
  position: relative;
  z-index: 2;
  max-width: 72%;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.category-tile img {
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 44%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(27, 38, 34, 0.12));
}

.category-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.08);
}

.category-tile.active span {
  color: var(--accent);
}

.subcategory-tile {
  min-height: 104px;
}

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

.product-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(27, 38, 34, 0.07);
}

.product-media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #dfe5e1;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  cursor: pointer;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  color: white;
  background: var(--olive);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}

.badge.order {
  background: var(--gold);
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 13px;
}

.product-category {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-sku {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 4px 7px;
  color: var(--steel);
  background: #f3f5f1;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.product-body h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.18;
  cursor: pointer;
}

.product-description {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.delivery-box {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding: 12px;
  background: #f7f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.delivery-box strong {
  color: var(--olive);
}

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

.shipping-options {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  border: 0;
  padding: 0;
}

.card-bundle-hint {
  margin: -4px 0 14px;
  padding: 9px 10px;
  color: var(--olive);
  background: #f4f8ef;
  border: 1px solid #dbe7d3;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.card-bundle-hint.oversized,
.row-discount.oversized,
.detail-warning {
  color: #8b3d13;
  background: #fff4e8;
  border-color: #e5c6a3;
}

.detail-warning {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e5c6a3;
  border-radius: 8px;
}

.detail-warning span {
  color: var(--steel);
  font-size: 13px;
  line-height: 1.4;
}

.shipping-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  cursor: pointer;
}

.shipping-option:has(input:checked) {
  border-color: var(--accent);
  background: #fff7f4;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.08);
}

.shipping-option input {
  width: 18px;
  min-height: 18px;
  margin: 3px 0 0;
}

.shipping-option strong,
.shipping-option span {
  display: block;
}

.shipping-option strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 13px;
}

.shipping-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 10px;
  margin: auto 0 18px;
  color: var(--steel);
  font-size: 13px;
}

dt {
  font-weight: 800;
}

dd {
  margin: 0;
}

.price {
  font-size: 20px;
}

.product-foot {
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: auto;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.product-foot button,
.details-button {
  padding: 0 14px;
  color: white;
  background: var(--accent);
}

.details-button {
  color: var(--olive);
  background: #edf2eb;
}

.cart-route {
  display: grid;
  gap: 5px;
  margin: 8px 0;
  color: var(--olive);
  font-size: 12px;
  font-weight: 800;
}

.cart-route select {
  width: min(280px, 100%);
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.product-meta span {
  padding: 5px 8px;
  color: var(--steel);
  background: #eef2ef;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
}

.service,
.quote {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) 1.2fr;
  gap: clamp(22px, 4vw, 56px);
  padding: clamp(42px, 6vw, 76px) clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

.service {
  background: #edf1ed;
}

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

.service-list article {
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.service-list span {
  color: var(--accent);
  font-weight: 900;
}

.service-list h3 {
  margin: 16px 0 8px;
}

.service-list p {
  color: var(--muted);
  line-height: 1.45;
}

.quote {
  background: #19221f;
  color: white;
}

.quote-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quote-form textarea {
  grid-column: 1 / -1;
  min-height: 108px;
  resize: vertical;
}

.quote-form .primary {
  width: fit-content;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 21, 19, 0.42);
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  width: min(520px, 100%);
  height: 100%;
  overflow: auto;
  padding: 24px;
  background: white;
  box-shadow: var(--shadow);
}

.detail-drawer {
  justify-content: center;
  padding: 22px;
}

.detail-panel {
  width: min(1060px, 100%);
  height: min(92vh, 100%);
  border-radius: 10px;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.drawer-head h2 {
  font-size: 28px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}

.detail-main-button {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  background: transparent;
  border: 0;
}

.detail-main-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f7f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.detail-thumb {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.detail-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f7f8f5;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.detail-thumb.active img {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 24, 21, 0.86);
}

.image-lightbox.open {
  display: grid;
}

.image-lightbox figure {
  display: grid;
  gap: 12px;
  width: min(1120px, 100%);
  margin: 0;
}

.image-lightbox img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  background: white;
  border-radius: 8px;
}

.image-lightbox figcaption {
  color: white;
  text-align: center;
  font-weight: 800;
}

.image-lightbox-close,
.image-lightbox-nav {
  position: fixed;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: white;
  background: rgba(15, 24, 21, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
}

.image-lightbox-close {
  top: 20px;
  right: 20px;
  font-size: 30px;
}

.image-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 42px;
}

.image-lightbox-nav.prev {
  left: 20px;
}

.image-lightbox-nav.next {
  right: 20px;
}

.detail-summary {
  display: grid;
  align-content: start;
  gap: 16px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-tags span {
  padding: 6px 9px;
  color: var(--steel);
  background: #eef2ef;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
}

.detail-price {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: #fff7f4;
  border: 1px solid var(--accent);
  border-radius: 8px;
}

.detail-price strong {
  color: var(--accent);
  font-size: 26px;
}

.detail-price span {
  color: var(--muted);
  font-weight: 800;
}

.detail-cart-button {
  width: fit-content;
}

.detail-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin-bottom: 10px;
  font-size: 19px;
}

.detail-section p {
  max-width: 82ch;
  color: var(--steel);
  line-height: 1.55;
}

.detail-specs {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) 1fr;
  gap: 10px 16px;
  margin: 0;
  font-size: 14px;
}

.detail-specs dt {
  color: var(--olive);
}

.close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

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

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-row h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.cart-row p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.row-discount {
  display: inline-block;
  margin-top: 7px;
  color: var(--olive);
  font-size: 13px;
  font-weight: 800;
}

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

.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f8f5;
  cursor: pointer;
}

.cart-discount {
  display: none;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  color: var(--olive);
  background: #f2f6ec;
  border: 1px solid #d7e3cd;
  border-radius: 8px;
}

.cart-discount:not(:empty) {
  display: grid;
}

.cart-discount strong,
.cart-discount span {
  display: block;
}

.cart-discount span {
  color: var(--steel);
  font-size: 13px;
  line-height: 1.35;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.checkout-form,
.account-form {
  display: grid;
  gap: 12px;
}

.checkout-form textarea {
  min-height: 90px;
  resize: vertical;
}

.account-summary {
  margin-top: 18px;
  padding: 16px;
  color: var(--steel);
  background: #eef2ef;
  border-radius: 8px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .nav {
    display: none;
  }

  .stats,
  .grid,
  .category-grid,
  .subcategory-grid,
  .service-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace,
  .service,
  .quote {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .phone {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .lang-switch {
    width: 100%;
    overflow-x: auto;
  }

  .lang-switch button {
    min-width: max-content;
  }

  h1 {
    font-size: 38px;
  }

  .stats,
  .grid,
  .category-grid,
  .subcategory-grid,
  .service-list,
  .quote-form {
    grid-template-columns: 1fr;
  }

  .category-tile {
    min-height: 142px;
  }

  .category-tile span {
    max-width: 64%;
    font-size: 18px;
  }

  .catalog-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-drawer {
    padding: 0;
  }

  .detail-panel {
    height: 100%;
    border-radius: 0;
  }

  .detail-specs {
    grid-template-columns: 1fr;
  }

  .product-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
