/* Layout: storefront — loaded after style.css only while this layout is active
   (see inc/layouts.php and rtsb_theme_scripts()). Scoped via body.layout-storefront. */

/* =========================================================================
   Layout — Storefront
   Personality: boutique / retail tag.
   Warm off-white hero with a swatch-dot row, bold uppercase display title.
   Showcase cards become product tiles: each opens with a tinted swatch
   header (rotating brand-derived hue per card), a "Nº 0X" price-tag, and
   a serif-free body. Metric badge-circles become "shop seal" stamps with
   a thick ring and a mono caption. Plus Jakarta Sans + DM Mono.
   Scoped via body.layout-storefront.
   ========================================================================= */
body.layout-storefront {
  --sf-display: 'Plus Jakarta Sans', var(--font-display);
  --sf-body: 'Plus Jakarta Sans', var(--font-body);
  --sf-mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sf-paper: #faf7f2;
  --sf-paper-2: #ffffff;
  --sf-ink: #1c1a17;
  --sf-muted: rgba(28, 26, 23, 0.62);
  --sf-rule: rgba(28, 26, 23, 0.1);
  --sf-shelf-top: color-mix(in srgb, var(--sf-ink) 11%, var(--sf-paper));
  --sf-shelf-front: color-mix(in srgb, var(--sf-ink) 22%, var(--sf-paper));
  --sf-tint-1: color-mix(in srgb, var(--accent-color) 22%, var(--sf-paper));
  --sf-tint-2: color-mix(in srgb, var(--primary-color) 18%, var(--sf-paper));
  --sf-tint-3: color-mix(in srgb, var(--secondary-color) 22%, var(--sf-paper));
  --page-display: var(--sf-display);
  --page-body: var(--sf-body);
  --page-mono: var(--sf-mono);
  --page-ink: var(--sf-ink);
  --page-paper: var(--sf-paper);
  --page-muted: var(--sf-muted);
  --page-accent: var(--accent-color);
  --page-rule: var(--sf-rule);
  background: var(--sf-paper);
  color: var(--sf-ink);
}

/* --- Hero --- */
body.layout-storefront .hero-section.hero-storefront {
  background: var(--sf-paper);
  min-height: auto;
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.5rem, 6vw, 4rem) clamp(3rem, 6vw, 5rem);
  margin: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  color: var(--sf-ink);
}

/* Soften the existing diagonal stripes — they fight a quiet boutique mood. */
body.layout-storefront .hero-storefront .storefront-stripes {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 56px,
    rgba(28, 26, 23, 0.025) 56px,
    rgba(28, 26, 23, 0.025) 112px
  );
}

body.layout-storefront .hero-storefront .hero-content {
  position: relative;
  z-index: 1;
  max-width: 52rem;
  margin: 0 auto;
}

body.layout-storefront .hero-storefront .storefront-eyebrow.hero-badge--cart {
  background: transparent;
  border: 1px solid var(--sf-ink);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-family: var(--sf-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sf-ink);
  margin-bottom: 1.25rem;
}

body.layout-storefront .storefront-swatches {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

body.layout-storefront .storefront-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(28, 26, 23, 0.15);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.6) inset;
}

body.layout-storefront .storefront-swatch--1 { background: var(--accent-color); }

body.layout-storefront .storefront-swatch--2 { background: var(--primary-color); }

body.layout-storefront .storefront-swatch--3 { background: var(--secondary-color); }

body.layout-storefront .storefront-swatch--4 { background: var(--sf-ink); }

body.layout-storefront .hero-storefront .hero-title.hero-title--bold-upper {
  font-family: var(--sf-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--sf-ink);
  margin: 0 0 1rem;
  text-shadow: none;
}

body.layout-storefront .hero-storefront .hero-subtitle {
  font-family: var(--sf-body);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: color-mix(in srgb, var(--sf-ink) 85%, transparent);
  margin: 0 auto 2rem;
  max-width: 36rem;
  text-shadow: none;
  font-weight: 500;
}

body.layout-storefront .hero-storefront .hero-subtitle a.hero-subtitle-link {
  color: var(--sf-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

body.layout-storefront .storefront-hero-cta {
  margin-top: 0.25rem;
  gap: 0.75rem;
}

body.layout-storefront .storefront-hero-cta .cta-button {
  font-family: var(--sf-body);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 1rem 1.85rem;
  border-radius: 999px;
  min-width: 0;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

body.layout-storefront .storefront-hero-cta .cta-button.cta-primary {
  background: var(--sf-ink);
  color: var(--sf-paper);
  border-color: var(--sf-ink);
  box-shadow: 0 10px 28px -16px rgba(28, 26, 23, 0.55);
}

body.layout-storefront .storefront-hero-cta .cta-button.cta-primary:hover {
  background: color-mix(in srgb, var(--sf-ink) 85%, var(--accent-color));
  border-color: transparent;
  transform: translateY(-1px);
}

body.layout-storefront .storefront-hero-cta .cta-button.cta-secondary {
  background: transparent;
  color: var(--sf-ink);
  border-color: var(--sf-ink);
  backdrop-filter: none;
}

body.layout-storefront .storefront-hero-cta .cta-button.cta-secondary:hover {
  background: var(--sf-ink);
  color: var(--sf-paper);
  transform: translateY(-1px);
}

/* --- Divider — single brand-tint rule --- */
body.layout-storefront .divider-angle {
  display: none;
}

/* --- Showcase grid — product tiles --- */
body.layout-storefront .content-section.storefront-content {
  background: transparent;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1.5rem, 6vw, 4rem) clamp(3rem, 6vw, 5rem);
}

body.layout-storefront .storefront-content .storefront-grid {
  max-width: 78rem;
  margin: 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

body.layout-storefront .showcase-card {
  background: var(--sf-paper-2);
  border: 1px solid var(--sf-rule);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 0 0 rgba(28, 26, 23, 0.04), 0 18px 40px -28px rgba(28, 26, 23, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.layout-storefront .showcase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 0 0 rgba(28, 26, 23, 0.06), 0 28px 56px -28px rgba(28, 26, 23, 0.35);
}

body.layout-storefront .showcase-card .showcase-card__header {
  background: var(--sf-tint-1);
  color: var(--sf-ink);
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.25rem);
  min-height: clamp(8rem, 14vw, 11rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

body.layout-storefront .showcase-card--2 .showcase-card__header { background: var(--sf-tint-2); }

body.layout-storefront .showcase-card--3 .showcase-card__header { background: var(--sf-tint-3); }

body.layout-storefront .showcase-card .storefront-tag {
  display: inline-block;
  font-family: var(--sf-body);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #1c1a17;
  color: #faf7f2;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

body.layout-storefront .showcase-card .showcase-card__header h3 {
  font-family: var(--sf-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--sf-ink);
  margin: 0;
  text-transform: none;
}

body.layout-storefront .showcase-card .showcase-card__body {
  padding: clamp(1.5rem, 3vw, 2rem);
  border-bottom: 0;
  background: var(--sf-paper-2);
}

body.layout-storefront .showcase-card .showcase-card__body > div,
body.layout-storefront .showcase-card .showcase-card__body > div p {
  font-family: var(--sf-body);
  font-size: clamp(0.98rem, 1.15vw, 1.05rem);
  line-height: 1.6;
  color: var(--sf-muted);
}

body.layout-storefront .showcase-card .showcase-card__body > div p {
  margin: 0 0 0.75rem;
}

/* --- Product sections — WooCommerce-driven storefront --- */
body.layout-storefront .storefront-products {
  max-width: 84rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

body.layout-storefront .storefront-products .storefront-product-section {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

body.layout-storefront .storefront-products .showcase-card .showcase-card__header {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  min-height: auto;
}

body.layout-storefront .storefront-products .showcase-card .showcase-card__header h3 {
  flex: 1 1 auto;
}

body.layout-storefront .storefront-products .showcase-card .showcase-card__header .storefront-tag--accent {
  background: var(--accent-color, #c2410c);
  color: #fff;
}

body.layout-storefront .storefront-shop-all {
  font-family: var(--sf-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sf-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--sf-ink);
  padding-bottom: 2px;
  transition: opacity 0.2s ease;
}

body.layout-storefront .storefront-shop-all:hover {
  opacity: 0.65;
}

/* Display shelf: products STAND on a real board instead of floating in boxes.
   --sf-shelf-col-gap is the row gutter; each image's ::after board bleeds half
   that gutter left/right so the boards of one row meet into a single continuous
   shelf spanning the full width. The tall row-gap leaves air for the next shelf. */
body.layout-storefront ul.products.storefront-product-grid {
  --sf-shelf-col-gap: clamp(1.25rem, 2.4vw, 2rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--sf-shelf-col-gap);
  row-gap: clamp(2.75rem, 4.5vw, 4.25rem);
  align-items: start;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Customizer-only placeholder shown when a section has no products (empty,
   disabled, or an unselected category/tag) so the live edit pencil on the
   product slot stays reachable. Emits nothing on the front-end. */
body.layout-storefront .storefront-products-empty {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px dashed var(--page-rule, var(--border-color));
  border-radius: var(--radius-lg, 0.75rem);
  text-align: center;
  color: var(--page-muted, var(--text-secondary));
  font-family: var(--page-body, var(--font-body));
}

/* No box: the product stands free on the shelf, label beneath. The base
   .rtsb-product-card padding/overflow/box are all stripped so the shelf board
   can bleed past the card edges without being clipped. */
body.layout-storefront .storefront-product-card {
  position: relative;
  margin: 0;
  width: auto;
  height: auto;
  float: none;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  transform: none;
}

body.layout-storefront .storefront-product-card:hover {
  transform: none;
  box-shadow: none;
}

body.layout-storefront .storefront-product-card .rtsb-product-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  text-decoration: none;
  color: inherit;
}

/* The standing item. Fixed ratio + equal columns => every image is the same
   height, so all feet (and therefore all shelf boards) land on one line. The
   board is the ::after; overflow stays visible so it can bleed past the sides. */
body.layout-storefront .storefront-product-card .rtsb-product-image {
  order: -1;
  position: relative;
  overflow: visible;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  background: transparent;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.22s ease;
}

body.layout-storefront .storefront-product-card:hover .rtsb-product-image {
  transform: translateY(-5px);
}

body.layout-storefront .storefront-product-card .rtsb-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px 10px 3px 3px;
  /* contact shadow the item casts down onto the shelf */
  box-shadow: 0 12px 18px -12px rgba(28, 26, 23, 0.5);
}

/* The shelf board. Bleeds half the column-gap each side so neighbouring boards
   in a row touch into one continuous ledge; the darker strip is the front lip. */
body.layout-storefront .storefront-product-card .rtsb-product-image::after {
  content: "";
  position: absolute;
  left: calc(var(--sf-shelf-col-gap) / -2);
  right: calc(var(--sf-shelf-col-gap) / -2);
  bottom: -0.6rem;
  height: 10px;
  background: linear-gradient(180deg, var(--sf-shelf-top) 0 3px, var(--sf-shelf-front) 3px 100%);
  border-radius: 1px;
  box-shadow: 0 7px 12px -7px rgba(28, 26, 23, 0.4);
}

/* Label sits on the shelf face below the board. */
body.layout-storefront .storefront-product-card .rtsb-product-title {
  font-family: var(--sf-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--sf-ink);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* reserve two lines so every price in a row aligns under the shelf */
  min-height: 2.6em;
}

body.layout-storefront .storefront-product-card .rtsb-product-price {
  font-family: var(--sf-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--sf-ink);
}

body.layout-storefront .storefront-product-card .rtsb-product-price del {
  opacity: 0.5;
  margin-right: 0.4rem;
  font-weight: 500;
}

body.layout-storefront .storefront-product-card .rtsb-product-price ins {
  background: none;
  text-decoration: none;
  color: var(--accent-color, #c2410c);
}

body.layout-storefront .storefront-sale-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  background: var(--accent-color, #c2410c);
  color: #fff;
  font-family: var(--sf-body);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

@media (max-width: 1024px) {
  body.layout-storefront ul.products.storefront-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  body.layout-storefront ul.products.storefront-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  body.layout-storefront .storefront-product-header h2 {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  body.layout-storefront ul.products.storefront-product-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Metrics — shop seals --- */
body.layout-storefront .metrics-section.metrics-storefront {
  background: transparent;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 6vw, 4rem) clamp(3rem, 6vw, 5rem);
}

body.layout-storefront .metrics-storefront .metrics-container {
  max-width: 78rem;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 3vw, 3rem);
}

body.layout-storefront .metrics-storefront .storefront-badge-circle {
  width: clamp(150px, 16vw, 200px);
  height: clamp(150px, 16vw, 200px);
  background: transparent;
  color: var(--sf-ink);
  border: 2px solid var(--sf-ink);
  position: relative;
  padding: 1rem;
}

body.layout-storefront .metrics-storefront .storefront-badge-circle::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid var(--sf-ink);
  opacity: 0.4;
  pointer-events: none;
}

body.layout-storefront .metrics-storefront .storefront-badge-circle .metric-number {
  font-family: var(--sf-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 3vw, 2.5rem);
  line-height: 1;
  color: var(--sf-ink);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  margin-bottom: 0.5rem;
}

body.layout-storefront .metrics-storefront .storefront-badge-circle .metric-label {
  font-family: var(--sf-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--sf-ink) 75%, transparent);
  text-align: center;
  line-height: 1.4;
  padding: 0;
}

/* --- Dark mode --- */
@media (prefers-color-scheme: dark) {
  body.layout-storefront {
    --sf-paper: #1a1815;
    --sf-paper-2: #221f1a;
    --sf-ink: #f7f2ea;
    --sf-muted: rgba(247, 242, 234, 0.65);
    --sf-rule: rgba(247, 242, 234, 0.14);
    --sf-tint-1: color-mix(in srgb, var(--accent-color) 30%, var(--sf-paper));
    --sf-tint-2: color-mix(in srgb, var(--primary-color) 28%, var(--sf-paper));
    --sf-tint-3: color-mix(in srgb, var(--secondary-color) 30%, var(--sf-paper));
  }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  body.layout-storefront .storefront-content .storefront-grid {
    grid-template-columns: 1fr;
  }
  body.layout-storefront .storefront-hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  body.layout-storefront .metrics-storefront .storefront-badge-circle {
    width: 140px;
    height: 140px;
    /* The generic mobile rule reshapes the badge into a row pill (row
       direction, auto size, square radius) while only width/height were
       re-pinned here — the badge ended up a 140px rounded box with the
       display-size number and letter-spaced label flowing in a ROW and
       overflowing both edges. Restore the circle motif wholesale. */
    flex-direction: column;
    border-radius: 50%;
    padding: 0.75rem;
    gap: 0;
  }
  body.layout-storefront .metrics-storefront .storefront-badge-circle .metric-number {
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
  }
  body.layout-storefront .metrics-storefront .storefront-badge-circle .metric-label {
    font-size: 0.58rem;
    letter-spacing: 0.12em;
  }
}
