:root {
  --ink: #151412;
  --muted: #6d675f;
  --paper: #f7f3ec;
  --soft: #efe7db;
  --line: #ded2c3;
  --gold: #a77a2b;
  --teal: #0f6d65;
  --plum: #8d2f55;
  --panel: #fffdf9;
  --shadow: 0 16px 40px rgba(41, 32, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(21, 20, 18, 0.1);
  background: rgba(247, 243, 236, 0.9);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 15px;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 34px;
  min-height: 560px;
  padding: 74px 40px 54px;
  background:
    linear-gradient(115deg, rgba(15, 109, 101, 0.14), transparent 34%),
    linear-gradient(245deg, rgba(141, 47, 85, 0.12), transparent 42%),
    #f0e8dc;
}

.hero-copy {
  align-self: center;
  max-width: 720px;
}

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

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

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(52px, 7vw, 104px);
  line-height: 0.96;
  font-weight: 500;
}

.lede {
  max-width: 610px;
  color: #514b43;
  font-size: 19px;
  line-height: 1.55;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(21, 20, 18, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.5);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-stats strong {
  color: var(--ink);
  font-size: 18px;
}

.hero-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  min-width: 0;
}

.hero-preview img {
  width: 100%;
  min-width: 0;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border: 1px solid rgba(21, 20, 18, 0.08);
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-preview img:nth-child(2) {
  transform: translateY(-34px);
}

.catalog-shell {
  padding: 42px 40px 56px;
}

.toolbar,
.filters,
.result-line,
.product-grid,
.load-row {
  max-width: 1480px;
  margin-right: auto;
  margin-left: auto;
}

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

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 500;
}

.search-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px) auto;
  align-items: center;
  gap: 10px;
}

label,
.filters span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input {
  min-width: 0;
  padding: 0 12px;
}

button {
  padding: 0 14px;
  cursor: pointer;
  touch-action: manipulation;
}

body.modal-open {
  overflow: hidden;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.filter-chip {
  min-height: 34px;
  border-color: rgba(21, 20, 18, 0.14);
  background: transparent;
  color: #4c4740;
  font-size: 13px;
  font-weight: 800;
}

.filter-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

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

.load-row {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.load-more {
  min-width: min(100%, 280px);
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.load-more[hidden] {
  display: none;
}

.product-card {
  display: grid;
  grid-template-rows: 360px 1fr;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(21, 20, 18, 0.1);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(41, 32, 22, 0.07);
}

.image-shell {
  display: grid;
  width: 100%;
  height: 360px;
  place-items: center;
  padding: 30px 24px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(145deg, rgba(167, 122, 43, 0.08), transparent),
    #fbf9f5;
}

.image-shell img {
  display: block;
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.card-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 0;
  width: 100%;
  min-height: 250px;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
}

.title-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.title-button:hover h3,
.title-button:focus-visible h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.meta-row,
.price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.meta-row {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-row span:last-child {
  color: var(--plum);
}

h3 {
  margin: 12px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

.card-body p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.price-row {
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
}

.price-row strong {
  color: var(--ink);
  font-size: 20px;
  white-space: nowrap;
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.cart-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 38px rgba(21, 20, 18, 0.28);
  font-weight: 900;
}

.cart-icon {
  width: 24px;
  height: 24px;
}

.modal,
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.modal[hidden],
.cart-drawer[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 20, 18, 0.52);
}

.product-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 0.78fr);
  gap: 0;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.modal-close,
.image-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.modal-image {
  display: grid;
  min-height: 560px;
  place-items: center;
  padding: 34px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(145deg, rgba(15, 109, 101, 0.08), transparent),
    #fbf8f2;
}

.modal-image img {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
}

.modal-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 52px 36px 36px;
}

.modal-info h2 {
  margin-top: 16px;
  line-height: 1.06;
}

.modal-info p {
  margin: 18px 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-price {
  margin-bottom: 26px;
  font-size: 28px;
}

.modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  font-weight: 900;
}

.primary-action {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.secondary-action {
  background: #fff;
}

.source-link {
  margin-top: 18px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.image-dialog {
  position: relative;
  display: grid;
  width: min(980px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 28px));
  place-items: center;
  margin: 14px auto;
  padding: 28px;
}

.image-dialog img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.cart-drawer {
  display: flex;
  justify-content: flex-end;
  background: rgba(21, 20, 18, 0.42);
}

.cart-panel {
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  height: 100%;
  padding: 24px;
  background: var(--panel);
  box-shadow: -18px 0 48px rgba(21, 20, 18, 0.22);
  touch-action: manipulation;
}

.cart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  font-size: 30px;
}

.cart-items {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 18px 0;
}

.empty-cart {
  color: var(--muted);
  line-height: 1.45;
}

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

.cart-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fbf8f2;
}

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

.cart-item strong {
  font-size: 14px;
  line-height: 1.25;
}

.cart-item span,
.cart-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.qty-row {
  display: grid;
  grid-template-columns: 30px 28px 30px;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.qty-row button {
  min-height: 30px;
  padding: 0;
  touch-action: manipulation;
  user-select: none;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.cart-total strong {
  color: var(--ink);
  white-space: nowrap;
}

.contact-form {
  display: grid;
  gap: 10px;
  padding-top: 18px;
}

.contact-form label {
  display: grid;
  gap: 6px;
}

.contact-status {
  min-height: 20px;
  margin: 0;
  color: var(--teal);
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero,
  .filters {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding: 46px 22px 36px;
  }

  .toolbar,
  .result-line {
    align-items: start;
    flex-direction: column;
  }

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

  .product-dialog {
    grid-template-columns: 1fr;
  }

  .modal-image {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 0 18px;
  }

  nav {
    gap: 14px;
  }

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

  .hero-preview img:nth-child(2) {
    transform: none;
  }

  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 32px;
  }

  .catalog-shell {
    padding: 32px 16px 42px;
  }

  .search-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

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

  .product-card {
    grid-template-rows: 310px 1fr;
  }

  .image-shell {
    height: 310px;
    padding: 24px 18px;
  }

  .card-body {
    min-height: 240px;
  }

  .cart-toggle {
    right: 14px;
    bottom: 14px;
  }

  .product-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    margin: 9px auto;
  }

  .modal-info {
    padding: 28px 18px 20px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .modal-image {
    min-height: 300px;
    padding: 24px;
  }

  .cart-panel {
    padding: 18px;
  }

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

  .cart-item img {
    width: 62px;
    height: 62px;
  }

  .qty-row {
    grid-column: 1 / -1;
    justify-content: end;
  }
}
