:root {
  color-scheme: light;
  --ruby: #b2193a;
  --ruby-dark: #7d1129;
  --ruby-soft: #fff1f4;
  --ink: #15191d;
  --muted: #66717c;
  --line: #e4e7eb;
  --paper: #f7f7f8;
  --panel: #ffffff;
  --charcoal: #24282d;
  --green: #27755f;
  --shadow: 0 16px 40px rgba(21, 25, 29, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, auto) 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 12px clamp(16px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  aspect-ratio: 1;
  background: var(--ruby);
  color: white;
  font-weight: 900;
  border-radius: 8px;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.14);
}

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

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav a,
.cart-button,
.icon-button,
.secondary-action {
  min-height: 40px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 800;
}

.nav a:hover,
.cart-button:hover,
.icon-button:hover,
.secondary-action:hover {
  background: var(--ruby-soft);
  color: var(--ruby-dark);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-color: var(--line);
  background: var(--panel);
}

.cart-button span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--ruby);
  color: white;
  border-radius: 999px;
  font-size: 0.78rem;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 44px) 58px;
}

.storefront {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: clamp(22px, 5vw, 72px);
  align-items: end;
  padding: clamp(34px, 6vw, 74px) 0 24px;
}

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

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 0.96;
}

.intro {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.storefront-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.storefront-panel div {
  min-height: 118px;
  padding: 20px;
}

.storefront-panel div + div {
  border-left: 1px solid var(--line);
}

.storefront-panel span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.storefront-panel small {
  color: var(--muted);
  font-weight: 700;
}

.toolbar {
  position: sticky;
  top: 70px;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 230px 190px;
  gap: 12px;
  align-items: end;
  margin: 10px 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(21, 25, 29, 0.07);
  backdrop-filter: blur(16px);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}

.search-wrap input {
  min-height: 52px;
  border-color: #d5d9de;
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(178, 25, 58, 0.16);
  border-color: var(--ruby);
}

.category-section,
.catalog-heading,
.pickup {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section-heading,
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2,
.catalog-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

.secondary-action {
  border-color: var(--line);
  background: var(--panel);
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 10px;
}

.category-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas:
    "glyph name"
    "glyph count";
  gap: 3px 10px;
  align-items: center;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.category-card:hover {
  border-color: rgba(178, 25, 58, 0.55);
  box-shadow: 0 8px 18px rgba(21, 25, 29, 0.08);
}

.category-card[aria-pressed="true"] {
  border-color: var(--ruby);
  background: var(--ruby-soft);
}

.category-glyph {
  grid-area: glyph;
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--charcoal);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
}

.category-card[aria-pressed="true"] .category-glyph {
  background: var(--ruby);
}

.category-name {
  grid-area: name;
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  grid-area: count;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.catalog-status {
  margin: 0 0 2px;
  color: var(--muted);
  font-weight: 800;
}

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

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.product-card:hover {
  border-color: #cfd4da;
  box-shadow: 0 10px 26px rgba(21, 25, 29, 0.1);
}

.product-open {
  display: grid;
  grid-template-rows: auto 1fr;
  color: inherit;
  outline: none;
}

.product-open:focus-visible {
  outline: 3px solid rgba(178, 25, 58, 0.22);
  outline-offset: -3px;
}

.product-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 0.86;
  background: #f0f1f3;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  mix-blend-mode: multiply;
}

.badge {
  position: absolute;
  top: 9px;
  left: 9px;
  max-width: calc(100% - 18px);
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ruby-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.product-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.product-actions-body {
  padding-top: 0;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price {
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 950;
}

.retail {
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: line-through;
}

.product-title {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  font-size: 0.96rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-kicker {
  overflow: hidden;
  color: var(--ruby);
  font-size: 0.76rem;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 23px;
  color: var(--muted);
  font-size: 0.8rem;
}

.product-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-description {
  display: -webkit-box;
  min-height: 40px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 4px;
}

.primary-action,
.add-button {
  min-height: 42px;
  border: 1px solid var(--ruby);
  border-radius: 8px;
  background: var(--ruby);
  color: white;
  font-weight: 900;
  padding: 10px 12px;
}

.primary-action:hover,
.add-button:hover {
  background: var(--ruby-dark);
}

.details-button {
  min-width: 44px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.details-button:hover {
  border-color: var(--ruby);
  color: var(--ruby);
}

.pickup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 24px;
}

.pickup h2 {
  margin: 0 0 8px;
}

.pickup p {
  margin: 0;
  color: var(--muted);
}

.pickup-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pickup-steps span {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: center;
  font-weight: 900;
}

.cart-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
  width: min(460px, 100vw);
  transform: translateX(105%);
  transition: transform 180ms ease;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  pointer-events: none;
}

.product-modal.open {
  display: flex;
  pointer-events: auto;
}

.modal-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 32px));
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 80px rgba(21, 25, 29, 0.28);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-weight: 900;
}

.modal-gallery {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 12px;
  padding: 18px;
  background: #f3f4f6;
}

.modal-main-image {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: 8px;
  background: white;
}

.modal-main-image img {
  width: 100%;
  max-height: min(560px, 64vh);
  object-fit: contain;
  padding: 14px;
}

.modal-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.thumbnail-button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  background: white;
  padding: 4px;
}

.thumbnail-button[aria-pressed="true"] {
  border-color: var(--ruby);
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-details {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 30px 26px 26px 0;
}

.modal-category {
  margin: 0;
  color: var(--ruby);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-details h2 {
  margin: 0;
  padding-right: 42px;
  font-size: clamp(1.35rem, 2.3vw, 2.1rem);
  line-height: 1.12;
}

.modal-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.modal-price-row span {
  font-size: 2rem;
  font-weight: 950;
}

.modal-price-row small {
  color: var(--muted);
  font-weight: 800;
}

#modalDescription {
  margin: 0;
  color: var(--muted);
}

.modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.modal-specs div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.modal-specs dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-specs dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

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

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2,
.drawer-header p,
.checkout h3 {
  margin: 0;
}

.drawer-header p {
  color: var(--muted);
}

.cart-items {
  overflow: auto;
  padding: 10px 20px;
}

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

.cart-line img {
  width: 72px;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f0f1f3;
  border-radius: 8px;
}

.cart-line h4 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  line-height: 1.25;
}

.cart-line small {
  color: var(--muted);
}

.remove-button {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.checkout {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
}

.checkout-message {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-weight: 900;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(21, 25, 29, 0.32);
}

.scrim.open {
  display: block;
}

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

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .toolbar {
    top: 112px;
  }

  .modal-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal-gallery {
    grid-template-rows: minmax(280px, auto) auto;
  }

  .modal-main-image {
    min-height: 280px;
  }

  .modal-details {
    padding: 20px;
  }
}

@media (max-width: 560px) {
  main {
    padding-inline: 12px;
  }

  .topbar {
    padding-inline: 12px;
  }

  .brand small {
    display: none;
  }

  .storefront-panel,
  .pickup-steps {
    grid-template-columns: 1fr;
  }

  .storefront-panel div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .category-tabs {
    grid-template-columns: 1fr;
  }

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

  .product-body {
    padding: 10px;
  }

  .product-description,
  .product-meta {
    display: none;
  }

  .add-button {
    min-height: 40px;
    padding-inline: 8px;
  }

  .product-modal {
    padding: 0;
  }

  .modal-shell {
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .modal-gallery {
    padding: 12px;
  }

  .modal-thumbnails {
    grid-template-columns: repeat(4, 1fr);
  }

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