:root {
  color-scheme: light;
  --ink: #121212;
  --soft-ink: #343434;
  --muted: #757575;
  --line: #e6e1d8;
  --paper: #faf9f6;
  --surface: #ffffff;
  --accent: #9f8552;
  --shadow: 0 18px 50px rgba(18, 18, 18, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16px;
  font-weight: 600;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 23px;
  font-weight: 600;
  line-height: 1;
}

.brand-copy small,
.eyebrow,
.header-actions a,
#resultCount,
.brand-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions a {
  color: var(--soft-ink);
  text-decoration: none;
}

.cart-toggle,
.primary-button,
.secondary-button,
.add-button {
  min-height: 42px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.cart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
}

.cart-toggle span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.hero {
  display: grid;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(58px, 10vw, 124px) clamp(18px, 4vw, 58px) clamp(40px, 7vw, 76px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1;
}

h1 {
  max-width: 850px;
  font-size: clamp(52px, 8vw, 112px);
}

.hero-subtitle {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px);
  gap: 12px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 58px);
}

.search-field,
.select-field,
.order-form input,
.order-form textarea {
  border: 1px solid var(--line);
  background: var(--surface);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 0 16px;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.search-field svg {
  color: var(--muted);
  flex: 0 0 auto;
}

.search-field input,
.select-field select,
.order-form input,
.order-form textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.select-field {
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 8px 14px;
}

.select-field label,
.order-form label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.select-field select {
  appearance: none;
  font-weight: 700;
}

.catalog-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 58px) 78px;
}

.section-heading,
.brand-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  margin-bottom: 34px;
}

h2 {
  margin-top: 8px;
  font-size: clamp(42px, 6vw, 72px);
}

.catalog-groups {
  display: grid;
  gap: 48px;
}

.brand-group {
  display: grid;
  gap: 18px;
}

.brand-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.brand-heading h3 {
  font-size: clamp(30px, 4vw, 46px);
}

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

.product-card {
  display: grid;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #cfc6b6;
  box-shadow: var(--shadow);
}

.product-photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 1 / 1;
  background: #efebe3;
}

.product-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.new-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-info {
  display: grid;
  gap: 15px;
  padding: 16px;
}

.product-title p {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-title h3 {
  overflow-wrap: anywhere;
  font-size: 25px;
}

.spec-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.spec-row dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.spec-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 650;
}

.add-button {
  width: 100%;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-button {
  min-width: 0;
}

.add-button:hover,
.primary-button:hover,
.cart-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.empty-state {
  padding: 46px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.empty-state h3 {
  font-size: 32px;
}

.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: min(440px, 100vw);
  height: 100vh;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -24px 0 60px rgba(18, 18, 18, 0.12);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.cart-panel.is-open {
  transform: translateX(0);
}

.cart-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.cart-panel h2 {
  font-size: 44px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.order-form {
  display: grid;
  gap: 12px;
}

.order-form label {
  display: grid;
  gap: 7px;
}

.order-form input,
.order-form textarea {
  min-height: 42px;
  padding: 10px 12px;
}

.order-form textarea {
  resize: vertical;
}

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

.cart-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
}

.cart-thumb {
  width: 74px;
  height: 74px;
  object-fit: cover;
  background: var(--paper);
}

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

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

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

.quantity-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  min-height: 38px;
  border: 1px solid var(--line);
}

.quantity-control button,
.quantity-control input {
  min-width: 0;
  border: 0;
  background: var(--paper);
  text-align: center;
}

.quantity-control input {
  background: var(--surface);
  border-inline: 1px solid var(--line);
  outline: 0;
}

.cart-empty {
  padding: 16px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin-top: auto;
}

.secondary-button {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(18, 18, 18, 0.24);
}

.product-preview {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: none;
  overflow: auto;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(18, 18, 18, 0.38);
}

.product-preview.is-open {
  display: grid;
  place-items: center;
}

.preview-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  width: min(1120px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.preview-gallery {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  min-height: 640px;
  background: #efebe3;
}

.preview-main {
  min-height: 0;
}

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

.preview-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.preview-thumbs button {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}

.preview-thumbs button.is-active {
  border-color: var(--ink);
}

.preview-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: clamp(24px, 5vw, 54px);
}

.preview-details h2 {
  margin: 0;
  font-size: clamp(42px, 5vw, 76px);
}

.preview-details h3 {
  color: var(--soft-ink);
  font-size: clamp(28px, 3vw, 42px);
}

.admin-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(18, 18, 18, 0.38);
}

.admin-shell.is-open {
  display: block;
}

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

.admin-login-panel {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-login-panel h2 {
  font-size: 42px;
}

.admin-login-panel label,
.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-login-panel input,
.admin-form input,
.admin-form textarea {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

.admin-form textarea {
  resize: vertical;
}

.admin-error {
  margin: 0;
  color: #9d1d1d;
  font-size: 13px;
  font-weight: 700;
}

.admin-panel {
  position: fixed;
  inset: 18px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 18px;
  overflow: auto;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.admin-panel-header h2 {
  font-size: 48px;
}

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

.admin-form label:nth-of-type(6),
.admin-form label:nth-of-type(7),
.admin-form .admin-actions,
.admin-note,
.admin-table {
  grid-column: 1 / -1;
}

.admin-check {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
}

.admin-check input {
  width: 18px;
  min-height: 18px;
}

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

.admin-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-table {
  display: grid;
  gap: 10px;
}

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

.admin-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: var(--paper);
}

.admin-row strong,
.admin-row span,
.admin-row small {
  display: block;
}

.admin-row strong {
  font-size: 14px;
}

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

.admin-row button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 58px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1080px) {
  .site-header {
    min-height: 66px;
    padding-inline: 24px;
  }

  .hero,
  .toolbar,
  .catalog-section {
    padding-inline: 24px;
  }

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

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

@media (max-width: 820px) {
  body {
    -webkit-text-size-adjust: 100%;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .site-header {
    gap: 14px;
  }

  .brand-copy strong {
    font-size: 21px;
  }

  .hero {
    gap: 16px;
    padding-top: 48px;
    padding-bottom: 34px;
  }

  h1 {
    font-size: clamp(44px, 10vw, 72px);
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    padding-top: 18px;
    padding-bottom: 18px;
  }

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

  .product-info {
    padding: 14px;
  }

  .product-title h3 {
    font-size: 23px;
  }

  .cart-panel {
    width: min(460px, 92vw);
  }

  .product-preview {
    padding: 0;
  }

  .preview-panel {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100dvh;
    max-height: none;
  }

  .preview-gallery {
    min-height: 54dvh;
    grid-template-rows: minmax(300px, 1fr) auto;
  }

  .preview-details {
    padding: 24px;
  }

  .admin-panel {
    inset: 12px;
    grid-template-rows: auto auto auto auto 1fr;
    padding: 20px;
  }

  .admin-row {
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
  }

  .admin-row img {
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 580px) {
  .site-header {
    min-height: 62px;
    padding-inline: 14px;
  }

  .brand-copy small,
  .header-actions a {
    display: none;
  }

  .cart-toggle {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .hero {
    padding-top: 44px;
    padding-inline: 16px;
  }

  .toolbar,
  .catalog-section {
    padding-inline: 16px;
  }

  .catalog-section {
    padding-bottom: 54px;
  }

  h2 {
    font-size: 40px;
  }

  .catalog-groups {
    gap: 34px;
  }

  .brand-heading h3 {
    font-size: 34px;
  }

  .section-heading,
  .brand-heading,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }

  .search-field,
  .select-field,
  .cart-toggle,
  .primary-button,
  .secondary-button,
  .add-button {
    min-height: 46px;
  }

  .product-grid,
  .product-actions,
  .cart-actions,
  .admin-form,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .product-photo {
    aspect-ratio: 4 / 3;
  }

  .product-title h3 {
    font-size: 25px;
  }

  .cart-panel {
    width: 100vw;
    padding: 18px;
  }

  .cart-panel h2 {
    font-size: 38px;
  }

  .cart-item {
    grid-template-columns: 68px minmax(0, 1fr);
    padding: 12px;
  }

  .cart-thumb {
    width: 68px;
    height: 68px;
  }

  .preview-close {
    top: 10px;
    right: 10px;
  }

  .preview-gallery {
    min-height: 48dvh;
    grid-template-rows: minmax(260px, 1fr) auto;
  }

  .preview-thumbs {
    gap: 8px;
    padding: 10px;
  }

  .preview-thumbs button {
    width: 64px;
    height: 64px;
  }

  .preview-details {
    gap: 16px;
    padding: 22px 16px 28px;
  }

  .preview-details h2 {
    font-size: 42px;
  }

  .preview-details h3 {
    font-size: 30px;
  }

  .admin-panel {
    inset: 0;
    min-height: 100dvh;
    padding: 16px;
  }

  .admin-panel-header {
    align-items: center;
  }

  .admin-panel-header h2,
  .admin-login-panel h2 {
    font-size: 38px;
  }

  .admin-login {
    align-items: stretch;
    padding: 12px;
  }

  .admin-login-panel {
    align-self: center;
    padding: 22px 18px;
  }

  .admin-row {
    gap: 10px;
  }

  .admin-row img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .site-footer {
    padding-inline: 16px;
  }
}

@media (max-width: 380px) {
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  h1 {
    font-size: 42px;
  }

  .product-info {
    padding: 13px;
  }
}
