:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --radius: 14px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 10px;
  object-fit: cover;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  position: static;
  top: 0.75rem;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.1);
}

.topbar-links {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 0.35rem;
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-count {
  min-width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.btn {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 150ms ease, background 120ms ease, color 120ms ease;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

.btn:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.26);
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
  box-shadow: none;
}

.btn.tiny {
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}

.btn.full {
  width: 100%;
  justify-content: center;
}

.hero {
  background: radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.1), transparent 40%), radial-gradient(circle at 80% 0%, rgba(99, 102, 241, 0.16), transparent 40%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  margin: 1.25rem 0 1.5rem;
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-strong);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.12);
}

.hero h1 {
  margin: 0.6rem 0 0.25rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

#categories
{
  position: sticky;
  top: calc(-1.6*clamp(1.7rem, 4vw, 2.4rem) + 1.5rem);
  z-index: 4;
}

#category-list-wrapper
{
  flex-wrap: nowrap;
  overflow-x: auto;
}


.category {
  margin: 1.5rem 0;
  scroll-margin-top: 10rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.category h2 {
  margin: 0;
  font-size: 1.35rem;
}

.category-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.item-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.85rem;
  align-items: stretch;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.05);
}

.item-media {
  position: relative;
  height: 100%;
  min-height: 110px;
  overflow: hidden;
  border-radius: 12px;
}

.item-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent-strong);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stock {
  color: #0f5132;
  background: #e8f5e9;
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-weight: 600;
}

.stock.low {
  color: #92390e;
  background: #fff8b2;
}
.stock.none
{
  color: #920e0e;
  background: #f0c0c0;
}

.discount
{
  color:#0f5132;
  background: #b5ffba;
}

.pill.out-of-stock
{
  color: #7f1d1d;
  background: #fecaca;
}

.btn.add-btn.unavailable {
  background: #d1d5db;
  color: #6b7280;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.item-card.out-of-stock {
  filter: contrast(0.85);
}

.item-card.out-of-stock .item-media img {
  filter: blur(2px);
}

.item-body h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.item-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.price {
  font-weight: 800;
  font-size: 1.05rem;
}

.price-strike {
  text-decoration: line-through;
  color: var(--muted);
  margin-right: 0.35rem;
  font-weight: 600;
}

.price-new {
  font-weight: 800;
}

.item-qty-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.item-qty-wrapper [data-qty-controls] {
  display: none;
}

.add-btn {
  flex-shrink: 0;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.4rem;
  box-shadow: 0 6px 12px rgba(17, 24, 39, 0.05);
}

.qty-btn {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  transition: background 120ms ease, color 120ms ease;
}

.qty-btn:hover {
  background: #f3f4f6;
}

.qty-count {
  min-width: 1.8rem;
  text-align: center;
  font-weight: 700;
}

.footer {
  margin-top: 2rem;
  padding: 1.4rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 20;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  width: min(420px, 100%);
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms ease;
}

.cart-overlay.open .cart-panel {
  transform: translateX(0);
}

.cart-header {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cart-label {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
}

.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease;
}

.icon-btn:hover {
  background: #f3f4f6;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-empty {
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-weight: 600;
  display: none;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cart-item img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
}

.cart-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cart-item-name {
  font-weight: 700;
}

.cart-item-price {
  font-weight: 700;
}

.cart-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-meta {
  background: #f3f4f6;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.cart-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
  align-items: center;
}

.cart-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.cart-chip:hover {
  background: #f3f4f6;
}

.cart-count-chip {
  font-weight: 800;
  min-width: 2.2rem;
  justify-content: center;
}

.cart-chip.danger {
  color: #b91c1c;
  border-color: #fecdd3;
  background: #fff1f2;
}

.cart-summary {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: linear-gradient(180deg, #fff, #f9fafb);
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.summary-line.total {
  font-size: 1.05rem;
}

.dropoff-help {
  margin: 0.2rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

#dropoff-map.dropoff-map {
  height: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.cart-note {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.cart-note textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
  max-height: 8rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
}

@media (min-width: 640px) {
  .hero {
    padding: 2.1rem;
  }

  .items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .page {
    padding: 2rem 1.5rem 3rem;
  }

  .hero {
    padding: 2.35rem;
  }

  .items-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .item-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .item-media {
    height: 180px;
  }
}

