:root {
  color-scheme: light;
  --ink: #20201f;
  --muted: #6f6a62;
  --line: #ddd7ce;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --gold: #bd8542;
  --gold-dark: #8d5d2b;
  --sage: #52645a;
  --shadow: 0 10px 28px rgba(42, 33, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.company {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.contact {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 14px;
}

.contact a {
  text-decoration: none;
  color: var(--gold-dark);
  font-weight: 700;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 28px 0 30px;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: 0;
}

.intro p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 148px);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.quick-stats div {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
  background: var(--panel);
}

.quick-stats strong {
  font-size: 20px;
}

.quick-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px 180px auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

input,
select,
button,
.selected-actions a {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

input,
select {
  width: 100%;
}

button,
.selected-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

button:hover,
.selected-actions a:hover {
  border-color: var(--gold);
}

.selected-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #f4efe7;
}

.selected-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#whatsappLink {
  border-color: var(--sage);
  background: var(--sage);
  color: white;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.product-card {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
}

.product-card.selected {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(82, 100, 90, 0.16);
}

.select-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: rgba(32, 32, 31, 0.12);
  background: rgba(255, 255, 255, 0.92);
  font-size: 20px;
  line-height: 1;
}

.product-card.selected .select-button {
  background: var(--sage);
  color: white;
}

.image-wrap {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f7f5f0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

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

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

.eyebrow {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h2 {
  min-height: 44px;
  margin: 8px 0 12px;
  font-size: 18px;
  line-height: 1.22;
  letter-spacing: 0;
}

.title-button {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: inherit;
}

.title-button h2 {
  margin-top: 8px;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
  line-height: 1.35;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.price {
  margin-top: auto;
  padding-top: 14px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 700;
}

.details-button {
  width: fit-content;
  min-height: 34px;
  margin-top: 14px;
  color: var(--gold-dark);
  background: #fbfaf7;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 32, 31, 0.48);
}

.modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 48%) minmax(0, 1fr);
  gap: 28px;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  padding: 24px;
  overflow: auto;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 24px;
}

.modal-media {
  min-width: 0;
}

.modal-media > img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7f5f0;
  border: 1px solid var(--line);
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.modal-gallery button {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: #f7f5f0;
}

.modal-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.modal-content h2 {
  min-height: 0;
  margin: 8px 0 8px;
  font-size: 28px;
}

.modal-sku {
  color: var(--muted);
  font-weight: 700;
}

.modal-details {
  margin-top: 20px;
  gap: 10px;
}

.modal-details div {
  grid-template-columns: 150px minmax(0, 1fr);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.modal-select {
  margin-top: 20px;
  border-color: var(--sage);
  background: var(--sage);
  color: white;
}

.empty {
  grid-column: 1 / -1;
  padding: 42px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  background: white;
}

@media (max-width: 900px) {
  .topbar,
  .intro,
  .selected-bar {
    display: block;
  }

  .contact {
    justify-content: flex-start;
    margin-top: 12px;
  }

  main {
    padding: 20px;
  }

  h1 {
    font-size: 34px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

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

  .selected-actions {
    margin-top: 12px;
  }

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

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

  main {
    padding: 16px;
  }

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