/* Shark City Bites — Storefront */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:     #0ea5e9;
  --blue-dk:  #0369a1;
  --blue-bg:  #f0f9ff;
  --ink:      #0f172a;
  --muted:    #64748b;
  --surface:  #ffffff;
  --border:   #e2e8f0;
  --radius:   12px;
  --shadow:   0 2px 12px rgba(15,23,42,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  color: var(--ink);
  min-height: 100vh;
}

/* ── Header ──────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand img {
  max-height: 50px;
  width: auto;
  border-radius: 8px;
  display: block;
}

.shark-logo { width: 40px; height: 40px; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}

.brand-sub {
  font-size: .75rem;
  color: var(--blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Cart button ─────────────────────────── */
.cart-btn {
  position: relative;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  transition: border-color .15s, background .15s;
}

.cart-btn:hover { border-color: var(--blue); background: var(--blue-bg); }
.cart-btn svg { width: 20px; height: 20px; }

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--blue);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}

/* ── Wave ────────────────────────────────── */
.wave-strip {
  line-height: 0;
  background: var(--surface);
}

.wave-strip svg { width: 100%; height: 48px; display: block; }

/* ── Main ────────────────────────────────── */
.shop-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.shop-intro { margin-bottom: 28px; }

.shop-intro--with-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.shop-intro h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

.shop-intro p { color: var(--muted); font-size: .95rem; }

/* ── Search bar ──────────────────────────── */
.search-bar {
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  max-width: 480px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
}

.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.search-input::placeholder { color: #94a3b8; }

/* ── Sticky filter bar ───────────────────── */
.filter-bar-sticky {
  position: sticky;
  top: 0;
  z-index: 90;
  background: #f8fafc;
  padding: 10px 0 4px;
  /* Bleed to full width of the padded container so bg covers edges */
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  border-bottom: 1px solid transparent;
  transition: border-color .15s, box-shadow .15s;
}

/* Add visible border + shadow once user has scrolled past the intro */
.filter-bar-sticky.is-stuck {
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(15,23,42,.06);
}

/* ── Tabs ────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ── Filter meta row (count + clear) ─────── */
.filter-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 22px;
  margin-bottom: 12px;
}

.result-count {
  font-size: .8rem;
  color: var(--muted);
}

.clear-filters {
  font-size: .8rem;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.clear-filters:hover { text-decoration: underline; }

/* ── Empty state ─────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state p {
  font-size: .95rem;
  margin-bottom: 16px;
}

.empty-clear-btn {
  padding: 10px 22px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.empty-clear-btn:hover { background: var(--blue-dk); }

.tab {
  padding: 8px 18px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}

.tab:hover { border-color: var(--blue); color: var(--blue); }
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Product grid ────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
}

.product-img { position: relative; height: 140px; overflow: hidden; }

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

.img-placeholder {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-icon { font-size: 3rem; line-height: 1; }

.product-info {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.category-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 99px;
  width: fit-content;
  margin-bottom: 2px;
}

.badge-candy  { background: #fef3c7; color: #92400e; }
.badge-chips  { background: #fef9c3; color: #713f12; }
.badge-soda   { background: #dbeafe; color: #1e40af; }
.badge-energy { background: #dcfce7; color: #166534; }
.badge-rte    { background: #fce7f3; color: #9d174d; }

.product-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.product-brand { font-size: .78rem; color: var(--muted); }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.add-btn {
  padding: 7px 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.add-btn:hover { background: var(--blue-dk); }
.add-btn:active { transform: scale(.96); }

.add-btn.added {
  background: #10b981;
  transform: scale(.96);
}

/* ── Cart drawer ─────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 200;
}

.cart-overlay.open { display: block; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--surface);
  z-index: 201;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(15,23,42,.12);
}

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

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

.cart-header h2 { font-size: 1.1rem; font-weight: 700; }

.cart-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .1s;
}

.cart-close:hover { background: #f1f5f9; color: var(--ink); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty { color: var(--muted); font-size: .9rem; text-align: center; padding: 32px 0; }

.cart-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.cart-item-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cart-item-name { font-size: .88rem; font-weight: 600; }
.cart-item-price { font-size: .88rem; font-weight: 700; color: var(--blue-dk); }

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .1s;
}

.qty-btn:hover { border-color: var(--blue); color: var(--blue); }
.qty-val { font-size: .9rem; font-weight: 600; min-width: 20px; text-align: center; }

.cart-footer {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
}

.cart-total {
  font-size: .95rem;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.cart-total strong { font-size: 1.1rem; }

.checkout-btn {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.checkout-btn:hover { background: var(--blue-dk); }

/* ── Floating cart pill (site-wide) ─────── */
/* Used on /, /shop, /host-a-machine, /checkout.
   On /shop it triggers the cart drawer; on other pages it links to /cart. */
#floatingCart {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  display: none;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(14,165,233,.5);
  transition: background .15s, transform .12s;
  text-decoration: none;
  font-family: inherit;
}

#floatingCart.visible { display: flex; }
#floatingCart:hover { background: #0369a1; transform: translateY(-2px); }
#floatingCart svg { width: 18px; height: 18px; flex-shrink: 0; }

#floatingCartCount {
  background: #fff;
  color: #0ea5e9;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  padding: 2px 7px;
  line-height: 1.3;
  min-width: 18px;
  text-align: center;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .shop-main { padding: 24px 16px 64px; }
  .shop-intro h1 { font-size: 1.4rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .img-placeholder { height: 110px; }
  .cart-drawer { width: 100%; }

  /* Search full-width on mobile */
  .search-input { max-width: 100%; }

  /* Filter bar bleeds to screen edges on mobile */
  .filter-bar-sticky {
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Filters horizontally scrollable on mobile, no wrap */
  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .filter-tabs::-webkit-scrollbar { display: none; }

  /* Floating cart pill — thumb-reachable, doesn't overlap content */
  #floatingCart { bottom: 16px; right: 16px; padding: 11px 16px; font-size: .85rem; }
}
