/* =============================================================================
   PRODUCTS.CSS — Jaipur Stone Industries
   Products page: editorial hero + 2×3 category tile grid.
   ============================================================================= */


/* =============================================================================
   BREADCRUMB
   Minimal structural wayfinding. Used on category pages.
   Sits inside the hero section, above the split title row.
   Uppercase micro-text matches the overline/label typographic register.
   ============================================================================= */

.breadcrumb {
  margin-bottom: var(--space-8);
}

.breadcrumb__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Previous levels — clickable */
.breadcrumb__link {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-base);
}

.breadcrumb__link:hover {
  color: var(--color-text-primary);
}

/* "/" separator — almost invisible, structural not decorative */
.breadcrumb__sep {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  opacity: 0.5;
  user-select: none;
  aria-hidden: true;
}

/* Current page — inactive, muted */
.breadcrumb__current {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}


/* =============================================================================
   PRODUCTS PAGE HERO
   Full-width 16:9 image anchored immediately below the fixed header.
   Title, rule, and supporting line are overlaid and centered on the image.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Shell — zero padding; header is position:fixed + transparent, so it
   overlays the image naturally. The hero starts at y:0 of the page.
   ----------------------------------------------------------------------------- */
.products-hero {
  padding: 0;
  margin: 0;
  background-color: var(--color-bg-primary);
  line-height: 0; /* removes descender gap beneath the inline-block placeholder */
}


/* -----------------------------------------------------------------------------
   Hero image wrapper
   Inherits aspect-ratio: 16/9 from .placeholder--hero.
   position: relative (already on .placeholder) anchors the overlay.
   ----------------------------------------------------------------------------- */
.products-hero__image {
  /* no extra rules needed — placeholder + placeholder--hero + placeholder--dark
     already provide: display:block, width:100%, aspect-ratio:16/9, bg colour */
}


/* -----------------------------------------------------------------------------
   Centered overlay — title + rule + supporting line
   Explicit top/left/width/height instead of shorthand inset for maximum
   cross-browser reliability when the containing block size comes from
   aspect-ratio rather than an explicit height declaration.
   ----------------------------------------------------------------------------- */
.products-hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  z-index: 1;
  pointer-events: none;
  line-height: normal; /* restore line-height reset from parent section */
}


/* -----------------------------------------------------------------------------
   Page title — large, restrained, editorial
   ----------------------------------------------------------------------------- */
.products-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 6vw, var(--font-size-5xl));
  font-weight: var(--font-weight-regular);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--color-text-primary);
  margin: 0;
  text-align: center;
}


/* -----------------------------------------------------------------------------
   Gold accent rule — short horizontal bar beneath the title
   ----------------------------------------------------------------------------- */
.products-hero__rule {
  display: block;
  width: 36px;
  height: 1px;
  background-color: var(--color-accent);
  margin-top: var(--space-1);
}


/* -----------------------------------------------------------------------------
   Supporting line — single-line descriptor, muted
   ----------------------------------------------------------------------------- */
.products-hero__line {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.01em;
  color: rgba(234, 234, 234, 0.5);
  text-align: center;
  margin: 0;
}


/* =============================================================================
   COLLECTION HERO HEADING
   Two-line stacked heading for material collection pages:
   material name (large, uppercase) + "Collection" label (small, muted).
   Used inside .products-hero__overlay on Granite, Sandstone, Marble, etc.
   ============================================================================= */

.products-hero__collection-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.products-hero__collection-name {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, var(--font-size-5xl));
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  line-height: 1;
  color: var(--color-text-primary);
  text-align: center;
  margin: 0;
}

.products-hero__collection-sub {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  line-height: 1;
  color: rgba(234, 234, 234, 0.4);
  text-align: center;
  margin: 0;
}


/* =============================================================================
   CATEGORIES SECTION
   ============================================================================= */

.categories-section {
  background-color: var(--color-bg-secondary);
}


/* =============================================================================
   CATEGORY TILE GRID
   Same visual contract as the homepage .products-tile system.
   Defined here so products.css is fully self-contained.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   2 rows × 3 columns
   ----------------------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}


/* -----------------------------------------------------------------------------
   Tile wrapper (<a>)
   aspect-ratio: 4/3 on the tile; image fills absolutely inside it.
   overflow: hidden clips the zoom without affecting layout.
   No transition on the tile itself — only the inner image layer animates.
   ----------------------------------------------------------------------------- */
.category-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  text-decoration: none;
}


/* -----------------------------------------------------------------------------
   Image layer
   Fills the tile via position: absolute + inset: 0.
   Asymmetric zoom:
     base  → fast zoom-out  (280ms ease)
     hover → slow zoom-in   (680ms ease-out)
   ----------------------------------------------------------------------------- */
.category-tile__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(1);
  transition: transform 280ms ease;      /* fast zoom-out */
}

.category-tile:hover .category-tile__image {
  transform: scale(1.04);
  transition: transform 680ms ease-out;  /* slow zoom-in */
}


/* -----------------------------------------------------------------------------
   Gradient overlay — always visible, not a hover state
   Deep bottom gradient for legibility; fades out at 60%.
   pointer-events: none — overlay must not intercept tile clicks.
   ----------------------------------------------------------------------------- */
.category-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.64) 0%,
    rgba(0, 0, 0, 0.22) 36%,
    transparent 60%
  );
  display: flex;
  align-items: flex-end;
  padding: var(--space-5) var(--space-6);
  pointer-events: none;
}


/* -----------------------------------------------------------------------------
   Category name
   Inter Tight Medium, uppercase micro-label.
   Matches homepage .products-tile__name exactly for visual system consistency.
   ----------------------------------------------------------------------------- */
.category-tile__name {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  color: rgba(234, 234, 234, 0.92);
  line-height: 1;
}


/* =============================================================================
   PRODUCT DETAIL PAGE
   Template for all product detail pages (granite, sandstone, marble, etc.)
   Sections: hero (via .products-hero) → slab+info → related products
   ============================================================================= */


/* =============================================================================
   SLAB + PRODUCT INFORMATION SECTION
   Two-column editorial layout.
   Left: 1:1 slab image (in-flow placeholder). Right: structured spec list.

   IMPORTANT: Do NOT use placeholder--fill (position:absolute) for image
   containers that rely on aspect-ratio to determine height — causes collapse
   in Safari when no in-flow children exist. Use placeholder--slab (in-flow)
   directly inside overflow:hidden containers instead.
   ============================================================================= */

.pd-slab-section {
  background-color: var(--color-bg-primary);
}


/* ── Two-column layout — slab image left, product info right ─────── */
/*
   Flex instead of grid — more predictable cross-browser behaviour for
   a two-column layout with an image on the left and text on the right.
*/
.pd-layout {
  display: flex;
  gap: var(--inner-spacing);
  align-items: flex-start;
}


/* ── Left column — slab image wrapper ────────────────────────────── */
/*
   flex: 0 0 44% — reduced from 58% to ~75% of original for a more
   balanced, restrained composition alongside the spec block.
   overflow:hidden clips the zoom transform on the child placeholder.
   line-height:0 removes the descender gap below the in-flow placeholder.
   The placeholder--slab child is in-flow, so it provides the height
   through its own aspect-ratio: 1/1 — no absolute positioning needed.
*/
.pd-slab {
  flex: 0 0 44%;
  max-width: 44%;
  overflow: hidden;
  line-height: 0;
}


/* ── Right column — product information ───────────────────────────── */
.pd-info {
  flex: 1;
  min-width: 0;
  padding-top: var(--space-4);
}

/* Product title — primary anchor for the information block */
.pd-product-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-snug);
  line-height: 1.1;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-8) 0;
}

/* Material classification — muted uppercase overline (retained for other uses) */
.pd-classification {
  display: block;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

/* Spec list — bordered rows */
.pd-spec-list {
  border-top: 1px solid var(--color-border);
}

/*
   Each spec row is a flex container.
   Using flex (not grid) with dt/dd to avoid Safari rendering quirks
   where display:grid on a div inside dl can be unreliable.
*/
.pd-spec-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-6);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

/* Label — fixed width, uppercase micro-text */
.pd-spec-label {
  flex: 0 0 9rem;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: var(--line-height-base);
}

/* Value — remaining width, secondary body text */
.pd-spec-value {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0; /* reset browser dd margin */
}


/* =============================================================================
   RELATED PRODUCTS SECTION
   Four-column slab tile grid. Each tile is a navigation link; the slab
   image inside is independently modal-enabled.
   ============================================================================= */

.pd-related {
  background-color: var(--color-bg-secondary);
}


/* ── Section header ───────────────────────────────────────────────── */
.pd-related__header {
  margin-bottom: var(--inner-spacing);
}

.pd-related__overline {
  display: block;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/*
   Use section + element chain (.pd-related h2) to guarantee higher
   specificity than the global h2 { font-size: var(--font-size-4xl) } rule.
*/
.pd-related h2 {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-snug);
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.2;
}


/* ── 4-column related grid ────────────────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}


/* ── Related tile — <a> link wrapper ─────────────────────────────── */
.related-tile {
  display: block;
  text-decoration: none;
  color: inherit;
}

/*
   Image container — clips the zoom transform.
   line-height:0 removes descender gap under the in-flow placeholder.
   The placeholder--slab child is in-flow, giving this container its height.
*/
.related-tile__image {
  overflow: hidden;
  line-height: 0;
  margin-bottom: var(--space-4);
}

/*
   Asymmetric zoom — fast zoom-out (280ms), slow zoom-in (680ms ease-out).
   Placeholder is kept in normal flow; transform clips inside overflow:hidden.
   Matches .category-tile__image timing for system consistency.
*/
.related-tile__image .placeholder {
  display: block;
  transform: scale(1);
  transition: transform 280ms ease;
}

.related-tile:hover .related-tile__image .placeholder {
  transform: scale(1.04);
  transition: transform 680ms ease-out;
}

/* Product name label */
.related-tile__name {
  display: block;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
  transition: color var(--transition-fast);
}

.related-tile:hover .related-tile__name {
  color: var(--color-text-primary);
}
