/* ============================================
   SHOP - shared base of the public shop pages
   ============================================
   My Gear hub, subcategory, product detail, brand page, cart and the
   post-purchase pages. Design system of the homepage/photoshoot redesign
   (docs/plans/photoshoot-redesign-plan.md § 2): Fraunces headings, Jost
   body, pill buttons, 18px cards, white photo plates.

   Every class is prefixed (.shop-, .gear-) so nothing collides with the
   generic .card/.name/.desc/.media rules of category.css or the block
   styles of blocks.css. Colours come from the theme tokens in common.css,
   so the same markup reads on theme-light (default) and theme-dark.
   ============================================ */

/* ============================================
   LAYOUT
   ============================================ */
.shop-wrap {
  max-width: 1248px;
  margin: 0 auto;
  padding: 0 20px;
}

.shop-wrap--narrow {
  max-width: 760px;
}

.shop-main {
  padding-bottom: 96px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.shop-eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-brand);
}

.shop-eyebrow a {
  color: inherit;
  text-decoration: none;
}

.shop-eyebrow a:hover {
  text-decoration: underline;
}

.shop-h1 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.5px;
  color: var(--color-text);
  text-wrap: balance;
}

.shop-h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.3px;
  color: var(--color-text);
}

.shop-lead {
  margin: 0;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-muted);
}

.shop-quote {
  margin: 0;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.5;
  color: var(--color-text);
}

.shop-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 18px;
}

.shop-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-brand);
  text-decoration: none;
  white-space: nowrap;
}

.shop-more:hover {
  text-decoration: underline;
}

/* ============================================
   PILL BUTTONS
   Same look as .btn-pill in blocks.css (not loaded on shop pages).
   ============================================ */
.shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  max-width: 100%;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  /* Long merchant names wrap instead of pushing the page wider. */
  white-space: normal;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.shop-btn--sm {
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

.shop-btn--primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.shop-btn--primary:hover {
  background: var(--color-brand-dark);
  color: var(--color-on-brand);
  text-decoration: none;
}

.shop-btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--btn-ghost-border);
}

.shop-btn--ghost:hover {
  background: rgba(var(--color-text-rgb), .06);
  color: var(--color-text);
  text-decoration: none;
}

.shop-btn:disabled,
.shop-btn[aria-disabled="true"] {
  background: var(--color-bg-alt);
  border-color: transparent;
  color: var(--color-muted);
  cursor: not-allowed;
}

/* Focus ring of the redesign (photoshoot plan R6) for every interactive
   element on shop pages. */
:is(.shop-main, .shop-wrap) :is(a, button, input, select, textarea, summary):focus-visible,
.gear-card__link:focus-visible {
  outline: 2px solid #E8A54A;
  outline-offset: 3px;
}

/* ============================================
   PANEL + PHOTO PLATE
   ============================================ */
.shop-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
}

/* White plate stays white in BOTH themes: product cutouts carry a baked-in
   white background, a cream plate would show white rectangles around them. */
.shop-plate {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
}

.shop-plate img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* No photo: neutral plate of the same ratio, card keeps its shape. */
.shop-plate--empty {
  background: var(--color-bg-alt);
}

/* Packshot (product_images.display_mode, docs/plans/archive/product-packshots.md): an official cutout
   on white, shown whole on the cream of the site in BOTH themes. multiply turns its white into
   the plate colour; isolation keeps the blend inside the plate, never with the page behind it.
   Same rules for the detail plate + thumbnails (product.css) and promo cards (blocks.css). */
.shop-plate.is-packshot {
  /* One 100% cell: with the default auto row a square image keeps its natural height and the
     plate's overflow clips its bottom, so the product would be neither whole nor centred. */
  grid-template: 100% / 100%;
  background: var(--color-bg-light);
  isolation: isolate;
}

.shop-plate.is-packshot img {
  padding: 9%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* ============================================
   CHIPS (subcategory navigation)
   ============================================ */
.shop-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.shop-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.shop-chip:hover {
  border-color: var(--color-text);
  text-decoration: none;
}

.shop-chip[aria-current="page"] {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

/* Phone: one row that scrolls inside its own box (never the page). */
@media (max-width: 767px) {
  .shop-chips {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin-inline: -20px;
    padding: 4px 20px;
  }

  .shop-chips::-webkit-scrollbar {
    display: none;
  }

  .shop-chip {
    flex: none;
  }
}

/* ============================================
   PRODUCT CARD GRID + CARD (partials/product-card.tpl)
   ============================================ */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (min-width: 1100px) {
  .gear-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .gear-grid {
    gap: 10px;
  }
}

.gear-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.gear-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(var(--color-text-rgb), .08);
}

/* Whole card is the link to the detail; buy form sits above it. */
.gear-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.gear-card__text {
  display: grid;
  gap: 4px;
  padding: 0 6px;
  min-width: 0;
}

.gear-card__brand {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-brand);
}

.gear-card__name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.gear-card__desc {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-muted);
}

.gear-card__foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: auto;
  padding: 0 6px 6px;
}

.gear-card__text + .gear-card__foot {
  padding-top: 2px;
}

.gear-card__text:last-child {
  padding-bottom: 6px;
}

.gear-card__price {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.gear-card__foot form {
  margin: 0;
}

/* Discount as plain text (the code itself lives on the detail page). */
.gear-perk {
  justify-self: start;
  display: inline-flex;
  margin: 6px 0 0;
  padding: 4px 12px;
  border: 1px dashed currentColor;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-brand);
}

@media (max-width: 767px) {
  .gear-card {
    gap: 10px;
    padding: 8px;
  }

  .gear-card__text {
    padding: 0 4px;
  }

  .gear-card__foot {
    padding: 0 4px 4px;
  }

  .gear-card__desc {
    font-size: 14px;
  }

  .gear-card__foot .shop-btn--sm {
    width: 100%;
    padding: 0 12px;
  }
}

/* ============================================
   CATEGORY PAGES (category.tpl): hub + subcategory
   ============================================ */
.gear-body {
  padding-top: 40px;
}

/* Subcategory header: clears the fixed nav, centred like the old one. */
/* main already starts below the fixed nav: same ~40px top spacing as the
   detail and cart headers. Two classes so .shop-wrap's mobile padding
   shorthand cannot reset it. */
.gear-subhead.shop-wrap {
  padding-top: 40px;
  padding-bottom: 8px;
  text-align: center;
}

.gear-subhead .shop-lead {
  margin: 0 auto;
}

.gear-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 6px;
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--color-muted);
}

.gear-breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-muted);
  text-decoration: none;
}

.gear-breadcrumb a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* --- Hub top: one top card + up to 3 "new in my bag" rows --- */
.gear-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 0 0 48px;
  /* Drop the common.css section padding so it lines up with the catalogue. */
  padding: 0;
  max-width: none;
}

@media (min-width: 1100px) {
  .gear-top {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .gear-top--solo {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gear-spot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* Whole card links to the detail (.gear-card__link overlay), same hover as .gear-card. */
.gear-spot:hover {
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(var(--color-text-rgb), .08);
}

@media (min-width: 768px) {
  .gear-spot {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
  }

  .gear-spot__plate {
    aspect-ratio: 4 / 5;
  }

  .gear-top--solo .gear-spot__plate {
    aspect-ratio: 4 / 3;
  }
}

.gear-spot__text {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 4px 10px 10px;
  min-width: 0;
}

.gear-spot__text .shop-eyebrow {
  margin-bottom: 4px;
}

.gear-spot__name {
  margin: 2px 0 8px;
  font-family: var(--font-heading);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.gear-spot__quote {
  margin-bottom: 4px;
}

.gear-spot__actions {
  position: relative;
  z-index: 2; /* above the card overlay link */
  margin-top: 14px;
}

.gear-new {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.gear-new__title {
  margin: 2px 0 4px;
}

.gear-new__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gear-mini {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 8px;
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .2s ease;
}

.gear-mini:hover {
  border-color: var(--border-strong);
}

.gear-mini__text {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-width: 0;
}

.gear-mini__date {
  font-size: 13px;
  color: var(--color-muted);
}

.gear-mini__name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.gear-mini .gear-perk {
  margin-top: 4px;
}

/* --- Catalogue --- */
.gear-chips-nav {
  margin: 0 0 8px;
}

.gear-section {
  margin: 0 0 56px;
  padding: 0;
  max-width: none;
  /* Anchor target of the chips: clear the fixed nav. */
  scroll-margin-top: 96px;
}

.gear-empty {
  margin: 24px 0;
  padding: 0;
  text-align: center;
}

.gear-empty .shop-lead {
  margin: 12px auto 0;
}

p.gear-empty {
  margin-inline: auto;
}

@media (max-width: 767px) {
  .gear-body {
    padding-top: 28px;
  }

  /* Photo hero (category-hero): keep the content off the dark hero edge. */
  .hero-split + .gear-body {
    padding-top: 32px;
  }

  .gear-top {
    margin-bottom: 36px;
  }

  .gear-mini {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
  }

  .gear-section {
    margin-bottom: 40px;
  }
}

/* ============================================
   DISCLOSURE (transparency note)
   ============================================ */
.shop-note {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-muted);
}

.shop-note strong {
  color: var(--color-text);
  font-weight: 500;
}

@media (max-width: 767px) {
  .shop-wrap {
    padding: 0 16px;
  }

  .shop-eyebrow {
    font-size: 11px;
    letter-spacing: 2.5px;
  }

  .shop-chips {
    margin-inline: -16px;
    padding-inline: 16px;
  }
}

@media print {
  .gear-card {
    break-inside: avoid;
  }
}
