:root {
  --bg: #fbf9f7;
  --surface: #ffffff;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --ink-muted: #8a827c;
  --line: #e7e2dd;
  --accent: #c2410c;
  --accent-soft: #fff1e8;
  --accent-ink: #9a3412;
  --green: #15803d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 8px 24px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 24px 64px rgba(28, 25, 23, 0.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

a {
  color: inherit;
}

/* ---------------- Top utility bar ---------------- */

.topbar {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 7px clamp(16px, 4vw, 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
}

.topbar-sep {
  opacity: 0.4;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 32px);
  padding: 12px clamp(16px, 4vw, 40px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  flex: 0 0 auto;
}

.brand-mark {
  font-size: 1.4rem;
  line-height: 1;
}

/* Header search — the primary marketplace affordance. */
.header-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 720px;
  padding: 4px 4px 4px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.1);
}

.header-search-icon {
  font-size: 0.9rem;
  opacity: 0.55;
  flex: 0 0 auto;
}

.header-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 8px 0;
}

.header-search-input::placeholder {
  color: var(--ink-muted);
}

.header-search-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.header-search-btn:hover {
  background: #a83a0a;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---------------- Hero ---------------- */

.hero {
  padding: clamp(36px, 6vw, 72px) clamp(16px, 4vw, 40px) clamp(32px, 5vw, 56px);
  background:
    radial-gradient(900px 420px at 8% -20%, #ffe9d9 0%, transparent 62%),
    radial-gradient(760px 400px at 96% -10%, #e6efff 0%, transparent 58%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

.hero-copy {
  text-align: left;
}

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

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.hero-card-emoji {
  font-size: 1.9rem;
  line-height: 1;
}

.hero-card-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.hero-card-a {
  background: linear-gradient(150deg, #fff4ec, #ffe3d1);
}

.hero-card-b {
  background: linear-gradient(150deg, #eef4ff, #dbe7ff);
  transform: translateY(18px);
}

.hero-card-c {
  grid-column: 1 / -1;
  min-height: 96px;
  background: linear-gradient(150deg, #f0fbf3, #dcf5e4);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero-sub {
  margin: 0 auto 28px;
  max-width: 560px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: center;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.hero-points li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  margin-right: 7px;
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(194, 65, 12, 0.28);
}

.btn-primary:hover {
  background: #a83a0a;
}

.btn-primary:disabled {
  background: #d6cfc9;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  background: #f6f2ee;
}

.btn-block {
  width: 100%;
}

/* ---------------- How it works ---------------- */

.how {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 48px);
}

.how h2 {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.025em;
  margin: 0 0 32px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  margin-bottom: 12px;
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---------------- Catalog ---------------- */

.catalog {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) clamp(16px, 4vw, 40px) 80px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(18px, 2.5vw, 32px);
  align-items: start;
}

/* ---------------- Category rail ---------------- */

.category-rail {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: var(--shadow-sm);
}

.rail-title {
  margin: 0 0 10px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.category-item:hover {
  background: #f6f2ee;
  color: var(--ink);
}

.category-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.category-emoji {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.85;
}

.category-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- Results ---------------- */

.catalog-main {
  min-width: 0;
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.results-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.025em;
}

.section-sub {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.results-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.sort-select {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  outline: none;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}

/* Active filter chips */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.filter-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #f0ece8;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.filter-chip button:hover {
  background: #e2dbd4;
  color: var(--ink);
}

.filter-clear {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: underline;
  padding: 6px 4px;
}

.catalog-status {
  color: var(--ink-muted);
  font-size: 0.86rem;
  margin-bottom: 14px;
  min-height: 1.2em;
}

.catalog-status.error {
  color: #b91c1c;
}

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

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
}

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

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f4f1ee;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-card:hover .product-media img {
  transform: scale(1.045);
}

/* Small badge pinned to the top-left of the image. */
.product-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.product-badge.badge-soft {
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-ink);
}

.product-brand {
  position: absolute;
  left: 9px;
  bottom: 9px;
  max-width: calc(100% - 18px);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 13px 14px;
  flex: 1;
}

.product-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.product-price {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.product-price small {
  font-weight: 500;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

/* Quick "add" affordance revealed on hover. */
.product-quick-add {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.product-card:hover .product-quick-add,
.product-quick-add:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.product-quick-add:hover {
  background: var(--accent);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ---------------- Skeleton ---------------- */

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, #f0ece8 30%, #f8f5f2 50%, #f0ece8 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  aspect-ratio: 3 / 4;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------------- Modal ---------------- */

/* The `hidden` attribute must always win over component display rules
   (e.g. `.modal { display: grid }`), otherwise overlays render on load. */
[hidden] {
  display: none !important;
}

.modal,
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop,
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  width: min(880px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
}

.modal-close:hover {
  background: #f4f1ee;
}

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

.modal-gallery {
  background: #f4f1ee;
  padding: 20px;
}

.modal-gallery img {
  width: 100%;
  border-radius: var(--radius-sm);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.modal-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.modal-thumbs img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  object-fit: cover;
}

.modal-thumbs img.active {
  border-color: var(--accent);
}

.modal-detail {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-brand {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.modal-detail h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.modal-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-height: 180px;
  overflow: auto;
}

.modal-price {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-price small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.variant-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variant-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.variant-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.modal-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  padding-top: 8px;
}

/* ---------------- Drawer ---------------- */

.drawer {
  place-items: stretch end;
  padding: 0;
}

.drawer-panel {
  position: relative;
  width: min(460px, 100%);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.24s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.drawer-head .modal-close {
  position: static;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 20px 22px 28px;
}

/* ---------------- Pending payment ---------------- */

.pending-payment {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 40px 16px;
}

.pending-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent, #6d5efc);
  animation: pendingSpin 0.9s linear infinite;
}

@keyframes pendingSpin {
  to {
    transform: rotate(360deg);
  }
}

.pending-payment h3 {
  margin: 0;
  font-size: 1.15rem;
}

.pending-payment p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 34ch;
}

.pending-amount {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pending-reference {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  padding: 4px 10px;
  border-radius: 999px;
}

.pending-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  margin-top: 6px;
}

.pending-actions .btn {
  width: 100%;
}

.pending-note {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ---------------- Cart items ---------------- */

.cart-empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 48px 12px;
}

.cart-empty .big {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 10px;
}

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

.cart-item img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #f4f1ee;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 2px;
}

.cart-item-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.cart-item-price {
  font-weight: 700;
  font-size: 0.9rem;
  text-align: right;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--ink-soft);
}

.qty-btn:hover {
  background: #f4f1ee;
}

.remove-btn {
  border: none;
  background: none;
  color: var(--ink-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.remove-btn:hover {
  color: #b91c1c;
}

/* ---------------- Checkout form ---------------- */

.checkout {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint {
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.summary {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
}

.summary-row.total {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.84rem;
}

.form-error ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* ---------------- Success ---------------- */

.success {
  text-align: center;
  padding: 24px 4px;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.success h3 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.success p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 18px;
}

.gift-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.gift-link-box input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  background: #faf8f6;
  color: var(--ink-soft);
  outline: none;
}

.gift-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-bottom: 18px;
}

.gift-link-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #faf8f6;
}

.gift-link-item .who {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 26px clamp(16px, 4vw, 40px);
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.footer-note {
  margin: 0;
}

/* ---------------- Responsive ---------------- */

/* Tablet: collapse the hero into one column and shrink the rail. */
@media (max-width: 1080px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-cards {
    display: none;
  }

  .catalog-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .site-nav {
    margin-left: auto;
  }

  .nav-link {
    display: none;
  }

  /* Category rail becomes a horizontal scroller above the results. */
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .category-rail {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 10px;
  }

  .rail-title {
    display: none;
  }

  .category-list {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .category-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 13px;
  }

  .category-item.active {
    border-color: var(--accent);
  }

  .category-name {
    max-width: 160px;
  }
}

@media (max-width: 720px) {
  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-gallery {
    padding: 14px;
  }

  .modal-detail {
    padding: 22px 20px 26px;
  }

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

  .product-info {
    padding: 10px 12px 12px;
  }

  .product-name {
    font-size: 0.84rem;
  }

  .product-quick-add {
    display: none;
  }

  .topbar-inner {
    font-size: 0.7rem;
  }

  .header-search-btn {
    padding: 9px 14px;
  }

  .results-head {
    align-items: flex-start;
  }
}
