/* Public storefront. Uses the same brand tokens as the admin (see app.css). */

.store-body { min-height: 100vh; display: flex; flex-direction: column; }
.store-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.store-main { flex: 1; padding-bottom: 3rem; }
.store-main:focus { outline: none; }

/* Header */
.store-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(var(--color-surface-rgb), .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.store-header-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.store-brand { text-decoration: none; color: var(--text); flex-shrink: 0; }
.store-brand .brand-logo { max-height: 40px; }
.store-search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.store-search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.store-search input {
  width: 100%; padding: .6rem 1rem .6rem 2.5rem; font: inherit; font-size: .93rem; color: var(--text);
  background: var(--hover); border: 1px solid transparent; border-radius: 999px; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.store-search input:focus { outline: none; background: var(--color-surface); border-color: var(--color-primary); box-shadow: var(--ring); }
.store-cats { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .75rem; scrollbar-width: none; }
.store-cats::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: .4rem .9rem; border-radius: 999px; font-size: .86rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; border: 1px solid var(--border-strong); background: var(--color-surface);
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-faint); }
.chip.is-active { background: var(--color-primary); color: var(--color-primary-contrast); border-color: var(--color-primary); }

/* Hero */
.store-hero {
  padding: 3.5rem 0 2.75rem; margin-bottom: .5rem;
  background:
    radial-gradient(800px 300px at 15% 0%, rgba(var(--color-primary-rgb), .14), transparent 70%),
    radial-gradient(700px 300px at 90% 10%, rgba(var(--color-secondary-rgb), .12), transparent 70%);
}
.store-hero h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: 1.12; max-width: 22ch; margin-bottom: .75rem; letter-spacing: -0.02em; }
.store-hero p { font-size: 1.08rem; color: var(--text-muted); max-width: 60ch; margin: 0; }

/* Toolbar */
.store-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 1.25rem; flex-wrap: wrap; }
.store-title { font-size: 1.6rem; margin-bottom: .25rem; }
.store-count { margin: 0; font-size: .9rem; }
.store-sort select { min-width: 200px; }

/* Product grid & card */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.product-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--color-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--hover); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product-card:hover .product-media img { transform: scale(1.04); }
.product-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-faint); }
.product-badge, .product-flag {
  position: absolute; top: .65rem; padding: .2rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700;
}
.product-badge { left: .65rem; background: var(--color-danger); color: var(--color-danger-contrast); }
.product-flag { right: .65rem; background: var(--color-accent); color: var(--color-accent-contrast); }
.product-body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.1rem 1.1rem; }
.product-merchant { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--text-muted); margin: 0 0 .3rem; }
.product-name { font-size: 1rem; margin: 0 0 .35rem; font-weight: 600; line-height: 1.35; }
.product-name a { color: var(--text); text-decoration: none; }
.product-name a:hover { color: var(--color-primary); }
.product-summary { font-size: .87rem; color: var(--text-muted); margin: 0 0 .75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.product-price { margin: 0; display: flex; align-items: baseline; gap: .45rem; }
.product-price strong { font-size: 1.1rem; }
.product-price s { color: var(--text-faint); font-size: .88rem; }
.product-cta { margin-left: auto; }

/* Product page */
.breadcrumbs { display: flex; gap: .5rem; font-size: .88rem; padding: 1.25rem 0; color: var(--text-faint); }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-primary); }
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.product-detail-media {
  position: sticky; top: 140px; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--hover); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.product-detail-media img { width: 100%; height: 100%; object-fit: contain; background: var(--color-surface); }
.product-detail-info h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: .75rem; }
.product-price-lg strong { font-size: 1.75rem; }
.product-price-lg s { font-size: 1.05rem; }
.product-badge-inline { font-size: .78rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: rgba(var(--color-danger-rgb), .12); color: var(--color-danger); }
.product-lead { font-size: 1.05rem; color: var(--text-muted); margin: 1rem 0 1.5rem; }
.product-buy { width: 100%; max-width: 420px; }
.buy-note { margin: .6rem 0 2rem; }
.product-description { border-top: 1px solid var(--border); padding-top: 1.5rem; line-height: 1.7; }
.related { margin-top: 3.5rem; }
.related h2 { font-size: 1.25rem; margin-bottom: 1rem; }

/* Empty state */
.store-empty { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.store-empty .icon { color: var(--text-faint); margin-bottom: .75rem; }
.store-empty h1, .store-empty h2 { color: var(--text); font-size: 1.35rem; }

/* Footer */
.store-footer { border-top: 1px solid var(--border); background: var(--color-surface); padding: 2rem 0; font-size: .87rem; }
.store-footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.store-footer-inner p { margin: .5rem 0 0; }
.store-footer-meta { max-width: 560px; }
.store-footer a { color: inherit; }
.disclosure { display: flex; gap: .45rem; align-items: flex-start; color: var(--text-muted); }
.disclosure .icon { margin-top: 3px; }

@media (max-width: 800px) {
  .product-detail { grid-template-columns: 1fr; gap: 1.5rem; }
  .product-detail-media { position: static; }
  .product-buy { max-width: none; }
}
@media (max-width: 640px) {
  .store-header-inner { height: auto; padding-top: .75rem; padding-bottom: .75rem; flex-wrap: wrap; gap: .75rem; }
  .store-search { max-width: none; flex-basis: 100%; }
  .store-hero { padding: 2rem 0 1.5rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .product-body { padding: .75rem; }
  .product-summary { display: none; }
  .product-cta { margin-left: 0; width: 100%; }
  .store-sort select { min-width: 0; }
}

/* Imported products: stock and price freshness */
.unavailable { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.as-of { display: block; flex-basis: 100%; font-size: .7rem; color: var(--text-faint); margin-top: -.15rem; }
.product-price { flex-wrap: wrap; }
.as-of-note { margin: -.25rem 0 1rem; max-width: 520px; }
