﻿/* ==========================================================================
   Blissporium — Product Details Page
   Page-specific composition only. Buttons, cards, tabs, modal, dropdown,
   qty-stepper, rating-summary, and sticky-cart-bar all live in
   static/css/global/utilities.css as reusable components.
   ========================================================================== */

/* ==========================================================================
   LAYOUT — gallery + info
   ========================================================================== */

.pdp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-16);
}

/* Top breathing room now that the breadcrumb (previously responsible
   for this page's top spacing) is gone. */
.pdp-layout--top {
  padding-top: var(--space-8);
}

@media (min-width: 1024px) {
  .pdp-layout { grid-template-columns: 1.1fr 1fr; align-items: start; }
}

/* --------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------- */
.pdp-gallery {
  position: sticky;
  top: calc(80px + var(--space-6));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pdp-gallery__main {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(254, 232, 219, 0.5), transparent 60%),
    var(--color-surface-soft);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.pdp-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.pdp-gallery__thumb {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  background-color: var(--color-surface-soft);
  transition: var(--transition-fast);
}

.pdp-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-gallery__thumb:hover { border-color: var(--color-border-strong); }
.pdp-gallery__thumb.is-active { border-color: var(--color-accent); }

.pdp-gallery__thumb--video {
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
}

.pdp-gallery__thumb--video:disabled { cursor: not-allowed; opacity: 0.6; }

/* --------------------------------------------------------------------
   Product info panel
   -------------------------------------------------------------------- */
.pdp-info__title {
  font-size: var(--text-2xl);
  margin-block: var(--space-2) var(--space-3);
}

.pdp-info__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.pdp-info__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.pdp-info__desc {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-block: var(--space-4);
  max-width: 60ch;
}

.pdp-info__divider {
  height: 1px;
  background-color: var(--color-border);
  margin-block: var(--space-6);
}

.pdp-info__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.pdp-info__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

@media (min-width: 480px) {
  .pdp-info__cta { flex-direction: row; }
}

.pdp-delivery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .pdp-delivery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.pdp-delivery .info-card { padding: var(--space-4); gap: var(--space-3); }

/* ==========================================================================
   TABS SECTION
   ========================================================================== */

.pdp-tabs-section {
  padding-block: var(--space-10);
  border-top: 1px solid var(--color-border);
}

.pdp-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-5);
  list-style: disc;
}

.pdp-specs {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
}

.pdp-specs th,
.pdp-specs td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.pdp-specs th {
  width: 40%;
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

/* ==========================================================================
   SHARED SECTION HEADING (left-aligned — reviews / related products)
   ========================================================================== */

.section-heading-left {
  margin-bottom: var(--space-6);
}

/* ==========================================================================
   REVIEWS
   ========================================================================== */

.pdp-reviews {
  padding-block: var(--space-10);
  border-top: 1px solid var(--color-border);
}

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

.pdp-reviews__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

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

/* 2026-08-09, rev 2 — hardcoded to the literal #2A1912, not
   var(--color-ink). On this page --color-ink resolves to the ROOT
   token value (#1F1A17, set in global/variables.css), NOT #2A1912 —
   that hex only exists as a LOCAL override inside .page-home and
   .admin-body in home.css/admin.css, which this page is neither of.
   #1F1A17 is actually darker than #2A1912 (confirmed via computed
   style: rgb(31,26,23)), so the previous var(--color-ink) fix was not
   the "still light/faded" text — but it also wasn't literally the
   hex asked for, so removing the ambiguity outright. Replaces
   .text-secondary/.caption in this section (5.51:1 / 4.90:1 on white
   — both technically pass AA but the tokens are only ~5:1, not the
   deliberately unambiguous top of the scale). */
.pdp-body-text,
.pdp-caption-text {
  color: #2A1912;
}

.pdp-caption-text {
  font-size: var(--text-xs);
}

/* The big "0 ★★★★★" score readout — same washed-out complaint as the
   body/caption text above; scoped to this one spot rather than the
   sitewide .rating-stars (product cards elsewhere weren't flagged). */
.rating-summary .rating-stars {
  color: var(--color-ink);
}

/* ==========================================================================
   RELATED PRODUCTS / FREQUENTLY BOUGHT TOGETHER
   ========================================================================== */

.pdp-related {
  padding-block: var(--space-10);
  border-top: 1px solid var(--color-border);
}

.fbt-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-6);
  background-color: var(--color-surface-soft);
  border-radius: var(--radius-lg);
}

.fbt-row__items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.fbt-item img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}

.fbt-row__plus {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
}

.fbt-row__summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

@media (min-width: 768px) {
  .fbt-row { flex-direction: row; justify-content: space-between; }
  .fbt-row__summary { align-items: flex-end; text-align: right; }
}

/* ==========================================================================
   RESPONSIVE — mobile adjustments
   ========================================================================== */

@media (max-width: 1023px) {
  .pdp-gallery { position: static; }
}

@media (max-width: 767px) {
  .pdp-gallery__thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pdp-tabs-section .tabs__list { overflow-x: auto; flex-wrap: nowrap; }

  /* The sticky cart bar is position:fixed and can appear while scrolling
     through ANY section below the main CTA (tabs, reviews, related) —
     reserve room for it across the whole page, not just the last block. */
  body.page-product { padding-bottom: 72px; }
}

/* ==========================================================================
   VARIANT SELECTORS (2026-08)
   One control per option. Style is driven by the option's own
   input_style, so shades get swatches and sizes get pills — never a row
   of dropdowns unless the values genuinely warrant one.
   ========================================================================== */

.pdp-variants {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.pdp-variant__label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text);
}

/* The chosen value echoes next to the option name, the way a beauty
   counter would name the shade back to you. */
.pdp-variant__chosen {
  font-weight: var(--weight-regular);
  color: var(--color-text-secondary);
}

.pdp-variant__choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.pdp-swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: transform var(--duration-base) var(--ease-spring);
}

.pdp-swatch:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-full); }

/* --- Pills (sizes, volumes, cup sizes, custom options) --------------- */
.pdp-swatch--pill {
  min-width: 52px;
  height: 46px;
  padding-inline: var(--space-4);
  justify-content: center;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  background-color: var(--color-surface);
  transition: border-color var(--duration-base) var(--ease-out),
              background-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-spring);
}

.pdp-swatch--pill:hover:not(.is-unavailable) {
  border-color: var(--color-text);
  transform: translateY(-2px);
}

.pdp-swatch--pill.is-selected {
  background-color: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-text-inverse);
}

/* --- Swatches (colour / shade) --------------------------------------- */
.pdp-swatch--swatch { flex-direction: column; gap: var(--space-2); }

.pdp-swatch__chip {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-strong);
  box-shadow: inset 0 2px 6px rgba(31, 26, 23, 0.12);
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease-out);
}

.pdp-swatch--swatch:hover:not(.is-unavailable) .pdp-swatch__chip { transform: scale(1.08); }

/* A ring OUTSIDE the chip, so the selected state never covers any of the
   colour the shopper is actually trying to judge. */
.pdp-swatch--swatch.is-selected .pdp-swatch__chip {
  box-shadow: inset 0 2px 6px rgba(31, 26, 23, 0.12),
              0 0 0 2px var(--color-surface),
              0 0 0 4px var(--color-ink);
}

.pdp-swatch--swatch .pdp-swatch__label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  max-width: 76px;
  text-align: center;
  line-height: var(--leading-snug);
}

.pdp-swatch--swatch.is-selected .pdp-swatch__label {
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}

/* --- Unavailable -----------------------------------------------------
   Struck through rather than hidden: knowing a shade exists but is sold
   out is useful information, and hiding it makes the range look smaller
   than it is. */
.pdp-swatch.is-unavailable {
  cursor: not-allowed;
  opacity: 0.4;
}

.pdp-swatch.is-unavailable::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 1px;
  background-color: var(--color-text-secondary);
  transform: rotate(-18deg);
  pointer-events: none;
}

.pdp-swatch--swatch.is-unavailable::after { top: 23px; right: auto; width: 52px; }

.pdp-variant__select { max-width: 340px; }

.pdp-variants__hint {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.pdp-variants__hint.is-error {
  color: var(--color-danger);
  font-weight: var(--weight-medium);
}

/* Image cross-fade while a variant's photo decodes. */
[data-gallery-image].is-swapping { opacity: 0.35; transition: opacity var(--duration-fast) var(--ease-out); }

@media (max-width: 480px) {
  .pdp-swatch--pill { min-width: 46px; height: 42px; padding-inline: var(--space-3); }
  .pdp-swatch__chip { width: 40px; height: 40px; }
  .pdp-swatch--swatch.is-unavailable::after { top: 20px; width: 46px; }
}


/* --------------------------------------------------------------------
   PDP gallery thumbnails (multi-image products)
   -------------------------------------------------------------------- */
.pdp-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* The JS-managed rail (variant products) toggles the `hidden` attribute
   when it merges down to a single thumbnail. Without this, the earlier
   `display: flex`/`display: grid` rules above — equal specificity to the
   [hidden] attribute selector — would win the cascade and the attribute
   would silently do nothing. */
.pdp-gallery__thumbs[hidden] { display: none; }

.pdp-gallery__thumb {
  width: 74px;
  height: 74px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-surface-soft);
  cursor: pointer;
  transition: border-color var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease-out);
}

.pdp-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

.pdp-gallery__thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Two cues, not one: the active thumbnail is both ringed and fully
   opaque, so the state survives for anyone who cannot separate the
   border colour from the surrounding hairlines. */
.pdp-gallery__thumb.is-active {
  border-color: var(--color-ink);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-ink);
}

.pdp-gallery__thumb:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

@media (max-width: 480px) {
  .pdp-gallery__thumb { width: 60px; height: 60px; }
}
