/* ==========================================================================
   StoreVela — Shop window (visitors, before they sign in)
   Home (www/index.html) and Catalog (www/catalog.html), with their header,
   footer, product card and sign-in prompt (templates/includes/shop_*.html).
   Colours, fonts and sizes: ../theme.css. Buttons, chips, selects and
   pagination: ../components.css. The navy panels stay navy in both themes,
   like the sign-in page's cover (auth.css).
   ========================================================================== */

/* No elastic over-scroll: it showed a white strip under the dark footer
   (same as the landing page, landing/assets/css/home.css) */
html, body { overscroll-behavior-y: none; }

.shop-container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.shop-main { padding-bottom: 56px; }

/* ---------------------------------- */
/* Header                             */
/* ---------------------------------- */
.shop-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-navbar-bg-scrolled);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-line);
}
.shop-header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.shop-nav { display: flex; gap: 4px; }
.shop-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-nav);
  font-weight: 500;
  color: var(--color-text-secondary);
}
.shop-nav a:hover { color: var(--color-text); background: var(--color-hover-fill); }
.shop-nav a.active { color: var(--color-text); }

.shop-search {
  flex: 1;
  max-width: 380px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-field);
  color: var(--color-text-secondary);
}
.shop-search:focus-within { border-color: var(--color-warm); }
.shop-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 14px;
}
.shop-search input::placeholder { color: var(--color-placeholder); }
.shop-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------- */
/* Home: picture at the top           */
/* ---------------------------------- */
.shop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  margin-top: 28px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  /* A soft logo-orange glow behind the headline, over the navy */
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--brand-warm) 16%, transparent), transparent 55%),
    radial-gradient(80% 70% at 100% 100%, color-mix(in srgb, #3b6f88 35%, transparent), transparent 60%),
    var(--gradient-navy);
  /* Lifted off the page: a thin light top edge, then a close and a far shadow */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 4px color-mix(in srgb, var(--brand-navy) 12%, transparent),
    0 14px 28px -12px color-mix(in srgb, var(--brand-navy) 35%, transparent),
    0 40px 80px -30px color-mix(in srgb, var(--brand-navy) 55%, transparent);
}
.shop-hero-copy { padding: clamp(24px, 4vw, 44px) clamp(24px, 4vw, 52px); display: flex; flex-direction: column; gap: 16px; }
.shop-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #F4BE96; }
.shop-hero h1 { color: #FFFFFF; font-size: clamp(30px, 3vw + 14px, 48px); text-wrap: balance; }
.shop-hero p { color: rgba(255, 255, 255, 0.78); font-size: 16px; max-width: 46ch; }
.shop-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.shop-btn-on-dark { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.35); background: transparent; }
.shop-btn-on-dark:hover { border-color: #FFFFFF; transform: translateY(var(--lift-btn)); }
/* The business name, as big as the panel allows */
.shop-hero h1.shop-hero-name {
  font-size: clamp(48px, 5vw + 16px, 88px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.shop-hero-signin { font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.shop-hero-signin a { color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Home page logo (StoreVela Settings): on a black card tilted towards the
   text, lit from above, with a soft glow behind, floating gently. */
.shop-hero-logo {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(20px, 3vw, 36px);
  perspective: 1200px;
}
.shop-logo-glow {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, #E1261C 45%, transparent), transparent 65%);
  filter: blur(30px);
  opacity: 0.7;
}
.shop-logo-card {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 14%;
  border-radius: 28px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 38%),
    radial-gradient(120% 100% at 30% 0%, #2a2a2e, #0b0b0d 70%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 12px 24px -12px rgba(0, 0, 0, 0.5);
  transform: rotateY(-14deg) rotateX(6deg);
  transform-style: preserve-3d;
  animation: shop-logo-float 6s ease-in-out infinite;
}
.shop-logo-card img { width: 100%; height: auto; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5)); }
@keyframes shop-logo-float {
  0%, 100% { transform: rotateY(-14deg) rotateX(6deg) translateY(0); }
  50% { transform: rotateY(-10deg) rotateX(4deg) translateY(-10px); }
}

/* Under the picture: four cards with what the business offers */
.shop-highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; margin-top: 52px; }
.shop-highlight {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--color-card);
  border: 1px solid var(--color-warm-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm), 0 10px 24px -16px color-mix(in srgb, var(--brand-warm) 45%, transparent);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.shop-highlight:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm), 0 14px 28px -14px color-mix(in srgb, var(--brand-warm) 55%, transparent); }
.shop-highlight-icon {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-btn);
  background: var(--color-warm-50);
  border: 1px solid var(--color-warm-border);
  color: var(--color-warm);
}
.shop-highlight-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.shop-highlight strong { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }
.shop-highlight b { font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.shop-highlight-note { font-size: 12.5px; color: var(--color-text-secondary); }

/* The Wholesale card opens Register: an orange arrow that moves on hover */
.shop-highlight-link { color: inherit; }
.shop-highlight-arrow { flex: none; color: var(--color-warm); transition: transform var(--transition-fast); }
.shop-highlight-arrow svg { display: block; }
.shop-highlight-link:hover { border-color: var(--color-warm); }
.shop-highlight-link:hover .shop-highlight-arrow { transform: translateX(4px); }

/* Most in demand (and any row of cards that scrolls sideways) */
.shop-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 16px) / 4);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}
.shop-strip .shop-card { scroll-snap-align: start; }
/* Most in demand: the top 5 in one row, each with its rank on the photo */
.shop-top { grid-auto-columns: calc((100% - 4 * 16px) / 5); }
.shop-top-item { position: relative; display: grid; scroll-snap-align: start; }
.shop-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-warm);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow-cta);
  pointer-events: none;
}

.shop-hero-art {
  min-height: 320px;
  background: right center / cover no-repeat;
  /* Fades into the navy on the left, so there is no hard line down the middle */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%);
  mask-image: linear-gradient(to right, transparent, #000 12%);
}
.shop-hero-art.has-photo { background-position: center; }

/* ---------------------------------- */
/* Sections                           */
/* ---------------------------------- */
.shop-section { margin-top: 56px; }
.shop-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.shop-section-head h2 { font-size: clamp(22px, 1vw + 16px, 28px); }
.shop-section-head p { color: var(--color-text-secondary); font-size: 14px; margin-top: 4px; }
.shop-more-link { color: var(--color-warm); font-weight: 600; font-size: 14px; }
.shop-more-link:hover { text-decoration: underline; }

/* Categories */
/* Categories: chips, the biggest first. Past data-shown they are hidden
   until "See all N categories" (public/js/shop.js). */
.shop-cats { display: flex; flex-wrap: wrap; gap: 10px; }
.shop-cat-chip { padding: 10px 16px; font-size: 0.9rem; }
.shop-cat-chip:hover { border-color: var(--color-warm); background: var(--color-warm-50); }
.shop-cat-chip .count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  text-align: center;
  font-variant-numeric: tabular-nums;
  opacity: 1;
  color: var(--color-text-secondary);
}
.shop-cat-chip.is-extra { display: none; }
.shop-cats.is-open .shop-cat-chip.is-extra { display: inline-flex; }
.shop-cats-toggle { margin-top: 14px; padding: 6px 0; font-weight: 600; font-size: 14px; color: var(--color-warm); }
.shop-cats-toggle:hover { text-decoration: underline; }

/* ---------------------------------- */
/* Product cards                      */
/* ---------------------------------- */
.shop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.shop-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
/* Same picture shape as the signed-in catalog's cards (.pcard-img) */
.shop-card-img { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-bg-alt); }
.shop-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-med); }
.shop-card:hover .shop-card-img img { transform: scale(1.05); }
.shop-card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.shop-card-cat { font-size: 12px; color: var(--color-text-secondary); }
.shop-card-title { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.shop-card-lock {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  font-size: 12.5px;
}
/* Shaped like a price, never readable: always "00,00" under the blur */
.shop-card-blur {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.shop-card-lock-note { display: flex; align-items: center; gap: 6px; }
.shop-card-lock svg { flex: none; }
.shop-card .btn { margin-top: 6px; }

.shop-explore { display: flex; justify-content: center; margin-top: 28px; }

/* ---------------------------------- */
/* Ready to order? band               */
/* ---------------------------------- */
.shop-join {
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: var(--pad-card);
  border-radius: var(--radius-xl);
  background: var(--color-warm-50);
  border: 1px solid var(--color-warm-border);
}
.shop-join h2 { font-size: clamp(22px, 1vw + 16px, 28px); }
.shop-steps { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 12px; font-size: 14px; }
.shop-steps li { display: flex; align-items: center; gap: 8px; }
.shop-steps span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-warm);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
}
.shop-join-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------- */
/* Catalog page                       */
/* ---------------------------------- */
.shop-crumbs { margin-top: 20px; font-size: 13px; color: var(--color-text-secondary); }
.shop-crumbs a:hover { color: var(--color-text); }
.shop-crumbs span { color: var(--color-text); font-weight: 500; }

.shop-catalog { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; margin-top: 18px; }
.shop-side { display: flex; flex-direction: column; gap: 2px; align-self: start; position: sticky; top: 88px; }
.shop-side-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.shop-side-link {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-nav);
  font-size: 14px;
}
.shop-side-link span { color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.shop-side-link:hover { background: var(--color-hover-fill); }
.shop-side-link.active { background: var(--color-warm-50); box-shadow: inset 3px 0 0 var(--color-warm); font-weight: 600; }
.shop-side-cta {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--gradient-navy);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.shop-side-cta b { color: #FFFFFF; font-size: 15px; }
.shop-side-cta .btn { margin-top: 4px; }

.shop-chips { display: none; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 8px; }
.shop-chips .category-chip { white-space: nowrap; }
.shop-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.shop-toolbar h1 { font-size: var(--fs-page-title); }
.shop-count { color: var(--color-text-secondary); font-size: 14px; }
.shop-toolbar .select-control { width: auto; }
.shop-catalog .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.shop-empty {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.shop-empty p { color: var(--color-text-secondary); margin-bottom: 8px; }

/* Stays at the bottom of the screen while the catalog scrolls */
.shop-sticky {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  margin-top: 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 10px 10px 20px;
  border-radius: var(--radius-md);
  background: var(--gradient-navy);
  box-shadow: var(--shadow-lg);
}
.shop-sticky p { flex: 1; min-width: 200px; font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.shop-sticky b { color: #FFFFFF; }
.shop-btn-light { background: #FFFFFF; color: var(--brand-navy); }
.shop-btn-light:hover { transform: translateY(var(--lift-btn)); }

/* ---------------------------------- */
/* Footer                             */
/* ---------------------------------- */
.shop-footer { background: var(--color-footer-bg); color: var(--color-footer-text); }
.shop-footer-inner { display: flex; flex-direction: column; gap: 10px; padding-top: 32px; padding-bottom: 32px; font-size: 14px; }
.shop-footer-inner p { max-width: 72ch; }
.shop-footer-logo { color: var(--color-footer-heading); font-size: 16px; }
.shop-footer-logo .nav-logo-mark { width: 30px; height: 30px; }
.shop-footer-small { font-size: 12px; color: var(--color-footer-dim); }
.shop-footer-small a:hover { color: var(--color-footer-heading); }

/* ---------------------------------- */
/* Sign-in prompt (public/js/shop.js) */
/* ---------------------------------- */
.shop-sheet {
  width: min(440px, calc(100% - 32px));
  margin: auto;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
}
.shop-sheet[open] { display: flex; flex-direction: column; gap: 12px; }
.shop-sheet::backdrop { background: color-mix(in srgb, var(--brand-navy) 60%, transparent); }
.shop-sheet-item { display: flex; align-items: center; gap: 14px; }
.shop-sheet-item img { width: 64px; height: 64px; flex: none; border-radius: var(--radius-sm); object-fit: contain; background: var(--color-surface-alt); }
.shop-sheet-item div { display: flex; flex-direction: column; min-width: 0; }
.shop-sheet h2 { font-size: 20px; margin-top: 6px; }
.shop-sheet p { color: var(--color-text-secondary); font-size: 14px; margin-bottom: 4px; }
/* Sign in: solid navy, second only to the orange Register */
.shop-btn-navy { background: var(--brand-navy); color: #FFFFFF; border-color: rgba(255, 255, 255, 0.14); box-shadow: var(--shadow-navy); }
.shop-btn-navy:hover { transform: translateY(var(--lift-btn)); color: #FFFFFF; }
.shop-sheet .shop-sheet-note { margin: 0; text-align: center; font-size: 13px; }

/* ---------------------------------- */
/* Smaller screens                    */
/* ---------------------------------- */
@media (max-width: 1024px) {
  .shop-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-strip { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
  .shop-top { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-catalog { grid-template-columns: minmax(0, 1fr); }
  .shop-side { display: none; }
  .shop-chips { display: flex; }
}
@media (max-width: 860px) {
  .shop-header-inner { flex-wrap: wrap; gap: 10px 16px; padding-top: 10px; padding-bottom: 10px; }
  .shop-nav { display: none; }
  .shop-actions { margin-left: auto; }
  .shop-search { order: 5; flex-basis: 100%; max-width: none; margin-left: 0; }
  .shop-hero { grid-template-columns: minmax(0, 1fr); }
  .shop-hero-logo { order: -1; padding-bottom: 0; }
  .shop-logo-card { width: min(220px, 70%); }
  .shop-hero-art { min-height: 180px; order: -1; -webkit-mask-image: linear-gradient(to top, transparent, #000 35%); mask-image: linear-gradient(to top, transparent, #000 35%); }
  .shop-grid, .shop-catalog .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-join { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  /* First screen on a phone shows the hero and the four cards together. */
  .shop-hero { margin-top: 16px; }
  .shop-hero-copy { padding: 22px 20px; gap: 12px; }
  .shop-hero h1.shop-hero-name { font-size: 46px; }
  .shop-hero.has-logo h1.shop-hero-name { padding-right: 96px; }
  .shop-hero p { font-size: 14.5px; line-height: 1.5; }
  .shop-hero-ctas { flex-wrap: nowrap; gap: 8px; }
  .shop-hero-ctas .btn { flex: 1; min-height: 46px; padding: 0 10px; font-size: 14px; white-space: normal; text-align: center; }
  .shop-hero-ctas .btn svg { display: none; }
  .shop-hero-signin { font-size: 13px; }
  .shop-hero-logo { position: absolute; top: 18px; right: 16px; padding: 0; z-index: 1; }
  .shop-hero-logo .shop-logo-glow { width: 120px; }
  .shop-hero .shop-logo-card { width: 84px; border-radius: 16px; padding: 10%; }
  .shop-highlights { gap: 8px; margin-top: 28px; }
  .shop-highlight { gap: 10px; padding: 10px 12px; }
  .shop-highlight-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); }
  .shop-highlight-icon svg { width: 18px; height: 18px; }
  .shop-highlight strong { font-size: 16px; }
  .shop-highlight b { font-size: 12px; }
  .shop-highlight-note { display: none; }
  .shop-highlight-arrow svg { width: 18px; height: 18px; }
  .shop-strip, .shop-top { grid-auto-columns: 46%; gap: 10px; }
  .shop-header { position: static; }
  .shop-signin-btn { display: none; }
  .shop-cat-chip { padding: 7px 12px; font-size: 0.82rem; }
  .shop-grid, .shop-catalog .shop-grid { gap: 10px; }
  .shop-card-body { padding: 10px; }
  .shop-card-lock { font-size: 11.5px; }
  .shop-card-blur { font-size: 16px; }
  .shop-sticky { padding: 12px; }
  .shop-sticky p { flex-basis: 100%; }
  .shop-sticky .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-logo-card { animation: none; }
  .shop-highlight:hover { transform: none; }
  .shop-highlight-link:hover .shop-highlight-arrow { transform: none; }
  .shop-card:hover .shop-card-img img { transition: none; transform: none; }
}
