:root {
  color-scheme: light;
  --bg: #fafaf7;
  --bg-strong: #ffffff;
  --panel: #eef5ec;
  --text: #14231c;
  --muted: #5b6b60;
  --primary: #16a34a;
  --primary-dark: #0f7a38;
  --primary-light: #4ade80;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --success: #15803d;
  --border: rgba(20, 35, 28, 0.08);
  --shadow: 0 18px 48px rgba(20, 40, 30, 0.1);
  --shadow-hover: 0 24px 60px rgba(15, 122, 56, 0.22);
  --footer-bg: var(--primary-dark);
  --footer-text: rgba(255, 255, 255, 0.85);
  --font-body: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

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

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

/* ---------- Theme banner (index.html, just below the nav) ---------- */

.theme-banner {
  background: var(--primary);
  padding: 2.25rem 0 3rem;
  /* Torn/perforated bottom edge, matching .receipt-card's motif. */
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 92%,
    95% 100%, 90% 92%, 85% 100%, 80% 92%, 75% 100%,
    70% 92%, 65% 100%, 60% 92%, 55% 100%, 50% 92%,
    45% 100%, 40% 92%, 35% 100%, 30% 92%, 25% 100%,
    20% 92%, 15% 100%, 10% 92%, 5% 100%, 0% 92%
  );
}

.theme-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.theme-banner-eyebrow {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
}

.theme-banner-text h2 {
  margin: 0;
  max-width: 30ch;
  color: #fff;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  line-height: 1.3;
}

.theme-banner-art {
  flex: none;
  width: 160px;
  height: auto;
}

.theme-banner-art .banner-handle {
  stroke: #ffffff;
}

.theme-banner-art .banner-basket {
  fill: var(--accent);
}

.theme-banner-art .banner-weave {
  stroke: var(--accent-dark);
}

.theme-banner-art .banner-fruit-1 {
  fill: var(--accent-dark);
}

.theme-banner-art .banner-fruit-2 {
  fill: var(--accent);
}

.theme-banner-art .banner-fruit-3 {
  fill: var(--primary-light);
}

.theme-banner-art .banner-leaf {
  fill: var(--primary-dark);
}

@media (max-width: 640px) {
  .theme-banner-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .theme-banner-text h2 {
    max-width: none;
  }
  .theme-banner-art {
    width: 130px;
    align-self: center;
  }
}

.order-card {
  background: var(--bg-strong);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.order-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.order-type {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.order-type.pickup {
  background: #e3f5e9;
  color: var(--primary-dark);
  border: 1px solid rgba(15, 122, 56, 0.25);
}

.order-type.delivery {
  background: #fdecd8;
  color: var(--accent-dark);
  border: 1px solid rgba(194, 65, 12, 0.25);
}

.order-body {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr);
  gap: 1.25rem;
}

.order-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.order-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.order-total strong,
.summary-row strong,
#cartTotal {
  font-family: var(--font-mono);
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 1.02rem;
}

.order-actions {
  margin-top: 1rem;
}

.order-actions button {
  margin-right: 0.5rem;
}

.status {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  text-transform: capitalize;
}
.status.pending { background: #d97706; color: white; }
.status.confirmed { background: var(--primary); color: white; }
.status.preparing { background: #d97706; color: white; }
.status.ready { background: var(--accent); color: white; }
.status.out_for_delivery { background: var(--accent-dark); color: white; }
.status.completed { background: var(--primary-dark); color: white; }
.status.cancelled { background: #b91c1c; color: white; }

.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.orders-toolbar select,
.orders-toolbar input[type="search"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
}

.order-status-update {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.order-status-update select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.order-history {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* Orders live refresh (staff orders page) */
.orders-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  background: #e3f5e9;
  color: var(--primary-dark);
  border: 1px solid rgba(15, 122, 56, 0.25);
  border-radius: 10px;
}

.orders-banner[hidden] {
  display: none;
}

.orders-banner-action {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.orders-banner-action:hover,
.orders-banner-action:focus-visible {
  text-decoration: underline;
}

.orders-banner-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.orders-poll-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.orders-updated {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.orders-reconnecting {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #fdecd8;
  color: var(--accent-dark);
  border: 1px solid rgba(194, 65, 12, 0.25);
  animation: ordersPulse 1.4s ease-in-out infinite;
}

.orders-reconnecting[hidden],
.orders-paused-btn[hidden] {
  display: none;
}

@keyframes ordersPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.orders-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.order-card.order-card-new {
  animation: orderCardFlash 6s ease-out 1;
}

@keyframes orderCardFlash {
  0% {
    background: #e3f5e9;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.45), var(--shadow);
  }
  100% {
    background: var(--bg-strong);
    box-shadow: var(--shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orders-reconnecting,
  .order-card.order-card-new {
    animation: none;
  }
  .order-card.order-card-new {
    border-left: 4px solid var(--primary);
  }
}

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

.site-header {
  /* Stays pinned at every width - the site's only header bar. */
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

.brand-dot {
  color: var(--accent);
}

.site-nav {
  justify-self: center;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.site-nav a {
  position: relative;
  padding-bottom: 4px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-nav a:hover {
  color: var(--primary);
}

.site-nav a.active {
  color: var(--text);
}

.site-nav a.active::after,
.site-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
}

.nav-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--panel);
  color: var(--primary-dark);
  padding: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-menu-button:hover {
  background: var(--primary);
  color: white;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-input {
  width: 0;
  min-width: 0;
  opacity: 0;
  padding: 0;
  margin-left: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--text);
  transition: width 0.2s ease, opacity 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}

.header-search.open .header-search-input {
  width: 180px;
  opacity: 1;
  margin-left: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-strong);
}

.header-search.open .header-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.profile-menu {
  position: relative;
}

.profile-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem 0.25rem;
}

.profile-caret {
  transition: transform 0.18s ease;
}

.profile-menu-trigger[aria-expanded="true"] .profile-caret {
  transform: rotate(180deg);
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 190px;
  background: var(--bg-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  gap: 0.2rem;
  z-index: 90;
}

.profile-menu-panel:not([hidden]) {
  display: grid;
}

.profile-menu-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--text);
  transition: background 0.15s ease;
}

.profile-menu-item:hover {
  background: var(--panel);
}

.profile-menu-signout {
  color: var(--accent-dark);
}

.auth-modal-panel {
  width: min(420px, calc(100% - 2rem));
  background: var(--bg-strong);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 600;
}

.auth-field input,
.auth-field select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.auth-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.auth-error {
  min-height: 1.2rem;
  margin: 0;
  color: #b42318;
  font-size: 0.92rem;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-actions .signed-in {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.account-actions .signed-in span {
  color: var(--text);
  font-size: 0.95rem;
}

.account-actions .button-secondary {
  padding: 0.65rem 1rem;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--panel);
  color: var(--primary-dark);
  padding: 0;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.cart-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--accent);
  color: white;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.9rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary-dark);
  background: var(--panel);
  border: 1px dashed var(--primary);
  border-radius: 4px;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 1.05;
}

.hero p {
  margin: 0 0 1.5rem;
  max-width: 55ch;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.4rem;
  text-decoration: none;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 55%, var(--primary-dark) 100%);
  box-shadow: 0 10px 24px rgba(15, 122, 56, 0.28);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.button-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(15, 122, 56, 0.28);
}

.button-secondary {
  background: var(--bg-strong);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button-secondary:active {
  transform: translateY(0);
}

.hero-visual {
  display: grid;
  place-items: center;
}

.receipt-card {
  position: relative;
  width: 100%;
  background: #ffffff;
  padding: 1.75rem 1.75rem 2.5rem;
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  border-top: none;
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 95%,
    95% 100%, 90% 95%, 85% 100%, 80% 95%, 75% 100%,
    70% 95%, 65% 100%, 60% 95%, 55% 100%, 50% 95%,
    45% 100%, 40% 95%, 35% 100%, 30% 95%, 25% 100%,
    20% 95%, 15% 100%, 10% 95%, 5% 100%, 0% 95%
  );
}

.receipt-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-image: radial-gradient(circle, var(--bg) 2.5px, transparent 2.6px);
  background-size: 16px 4px;
  background-repeat: repeat-x;
}

.receipt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}

.receipt-store-name {
  font-weight: 700;
  font-size: 0.98rem;
}

.receipt-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.receipt-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.95rem;
}

.receipt-item-price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.receipt-card-footer {
  margin-top: 1.35rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.category-row-wrap {
  margin-bottom: 1.25rem;
}

.category-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* old Edge */
}

.category-row::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.category-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  background: none;
  border: none;
  padding: 0.25rem;
  font-family: inherit;
  cursor: pointer;
}

.category-avatar {
  height: 44px;
  padding: 0 1.1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: var(--bg-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, color 0.15s ease;
}

.category-card:hover .category-avatar,
.category-card:focus-visible .category-avatar {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.category-card.selected .category-avatar {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.category-card .category-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.category-card.selected .category-count {
  color: var(--primary);
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  justify-content: start;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.product-card {
  background: var(--bg-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(22, 163, 74, 0.3);
}

.product-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-card:hover .product-image img {
  transform: scale(1.06);
}

.product-image {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #edf8f0 0%, #ffffff 100%);
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--muted);
  overflow: hidden;
}

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

.item-thumb {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 0.75rem;
  font-size: 0.85rem;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
}

.product-content {
  padding: 1.25rem;
}

.product-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.product-content p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
}

.product-card button {
  width: 100%;
  margin-top: 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 55%, var(--primary-dark) 100%);
  color: white;
  padding: 0.9rem;
  border: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.product-card button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 122, 56, 0.3);
}

.product-card button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.features {
  padding: 3rem 0;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-list article {
  background: var(--bg-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.feature-list h3 {
  margin: 0 0 0.75rem;
}

.contact-section {
  padding: 3rem 0 4rem;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  background: var(--bg-strong);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.contact-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-details {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.contact-details li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-details svg {
  flex: none;
  color: var(--primary);
}

.contact-details a {
  color: var(--text);
  text-decoration: none;
}

.contact-details a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.contact-label {
  font-weight: 600;
  color: var(--text);
}

.site-footer {
  position: relative;
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 1.75rem 0;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-image: radial-gradient(circle, var(--bg) 2.5px, transparent 2.6px);
  background-size: 16px 4px;
  background-repeat: repeat-x;
}

.site-footer p {
  color: var(--footer-text);
}

.footer-address {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  opacity: 0.85;
}

.footer-address a {
  color: var(--footer-text);
  text-decoration: underline;
}

.footer-address a:hover {
  color: var(--accent);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  background: white;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.12);
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

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

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 28, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 55;
}

.drawer-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

.cart-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.cart-items {
  padding: 1.5rem;
  overflow-y: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.cart-item .item-thumb {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 0.75rem;
  font-size: 0.85rem;
}

.cart-item-details {
  display: grid;
  gap: 0.35rem;
}

.cart-item-details h4 {
  margin: 0;
  font-size: 0.95rem;
}

.cart-item-details .item-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.quantity-controls {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.quantity-controls button {
  min-width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 0 0.65rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.cart-summary {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem; /* allow breathing room when content is tall */
  overflow: auto; /* allow the modal container to scroll on small viewports */
  -webkit-overflow-scrolling: touch;
  background: rgba(20, 35, 28, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 70;
}

.modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: min(520px, calc(100% - 2rem));
  background: white;
  border-radius: 28px;
  padding: 2rem;
  max-height: calc(100vh - 3rem); /* prevent content from overflowing the viewport */
  overflow: auto; /* make the modal content itself scrollable */
  -webkit-overflow-scrolling: touch;
  position: relative;
  box-shadow: var(--shadow);
}

.checkout-form {
  display: grid;
  gap: 1rem;
}

.checkout-fields {
  display: grid;
  gap: 0.85rem;
}

.checkout-field {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

.checkout-field input,
.checkout-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.checkout-field input:focus,
.checkout-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.form-error {
  color: #d13838;
  font-size: 0.95rem;
  min-height: 1.2rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.order-summary {
  margin: 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}

.order-type-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.order-type-actions .button {
  flex: 1 1 180px;
}

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

@media (max-width: 860px) {
  .hero-content,
  .contact-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .nav-menu-button {
    display: inline-flex;
  }
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
  }
  .account-actions {
    margin-left: auto;
  }
  .site-nav {
    display: none;
    justify-self: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
    background: var(--bg-strong);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    padding: 0.85rem 1.5rem;
  }
  .site-nav a.active::after,
  .site-nav a:hover::after {
    display: none;
  }
  .site-nav a.active {
    background: var(--panel);
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2.5rem;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
  .product-content {
    padding: 0.85rem;
  }
  .product-content h3 {
    font-size: 0.95rem;
  }
  .product-content p {
    font-size: 0.85rem;
  }
  .product-meta {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
}

@media (max-width: 420px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
}

/* -----------------------------
   Product detail: layout + quantity stepper
   ----------------------------- */

.product-card.detail {
  grid-template-rows: auto auto;
  max-width: 640px;
  margin: 0 auto;
}

.product-card.detail .product-image {
  aspect-ratio: 1 / 1;
}

@media (min-width: 480px) {
  .product-card.detail {
    grid-template-columns: minmax(160px, 240px) 1fr;
    grid-template-rows: none;
  }
}

.product-card.detail .product-content {
  padding: 1.25rem;
  display: grid;
  gap: 0.25rem;
  align-content: start;
}

.product-card.detail .product-category {
  margin: 0 0 0.35rem;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-card.detail h2 {
  margin: 0 0 0.5rem;
}

.product-card.detail .product-meta {
  position: relative;
  margin: 1rem 0;
  padding: 0.9rem 1rem 0.9rem 1.75rem;
  background: var(--panel);
  clip-path: polygon(14px 0%, 100% 0%, 100% 100%, 14px 100%, 0% 50%);
}

.product-card.detail .product-meta::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bg-strong);
  transform: translateY(-50%);
}

.product-card.detail .product-meta .price {
  font-size: 1.3rem;
}

.product-card.detail .actions {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}

.quantity-field {
  display: grid;
  gap: 0.5rem;
}

.quantity-label {
  font-weight: 600;
  color: var(--text);
}

.weight-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.weight-preset-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.weight-preset-btn:hover {
  border-color: var(--primary);
}

.weight-preset-btn[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.quantity-stepper {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-strong);
  padding: 0.3rem;
  gap: 0.3rem;
}

.qty-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: none;
  background: var(--panel);
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.qty-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quantity-stepper input#quantity {
  width: 3.2rem;
  height: 2.4rem;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  -moz-appearance: textfield;
}

.quantity-stepper input#quantity::-webkit-outer-spin-button,
.quantity-stepper input#quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity-stepper input#quantity:focus {
  outline: none;
}

.add-to-cart-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 1rem;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 55%, var(--primary-dark) 100%);
  box-shadow: 0 10px 24px rgba(15, 122, 56, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.add-to-cart-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.add-to-cart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* -----------------------------
   Product detail: related products (other sizes / similar products)
   ----------------------------- */

.related-products {
  margin-top: 2.5rem;
}

.related-products h3 {
  margin-bottom: 1rem;
}

.related-products .product-grid {
  margin: 0;
}

.category-scroller { position: relative; }

.cat-arrow {
  display: none;
  position: absolute;
  top: -48px;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-strong);
  box-shadow: var(--shadow);
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.cat-arrow:hover { background: var(--panel); }
.cat-arrow:disabled {
  opacity: 0.5;
  cursor: default;
}
.cat-arrow:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.cat-arrow-left { right: 52px; }
.cat-arrow-right { right: 0; }

/* Mouse controls; touch devices keep native swiping. */
@media (hover: hover) and (pointer: fine) {
  .cat-arrow.is-visible { display: flex; }
}