/* ============================================================
   MAISON — SINGLE PRODUCT PAGE
   Loaded only on is_product(). Versioned with filemtime() so the
   browser picks up every edit automatically; no manual bumping.

   Written against the parent theme's own custom properties
   (--clr-*, --sp-*, --ff-*, --header-h) so the palette and spacing
   rhythm stay in step with the homepage and shop if those change.

   font-family is deliberately NOT declared on the title or price.
   The site-wide Akira rule is `html body [class] [class] [class]
   [class]... { font-family: ... !important }` — specificity (0,6,2)
   plus !important. Matching the homepage means letting it win, so
   fighting it here would be both ugly and wrong.
   ============================================================ */

/* ---------- 1. HEADER CLEARANCE ---------------------------- */
/* The header is fixed and the theme only offset the product by
   margin-top: var(--header-h) — exactly the header height, so zero
   clearance, and .site-header::after (the comb strip) still hung over
   the content below it. Cart and checkout already use the calc()
   pattern below; this brings the product page in line. */
body.single-product main.woo-main {
  padding-top: calc(var(--header-h, 64px) + var(--sp-16, 4rem));
  padding-bottom: var(--sp-24, 6rem);
}
body.single-product .woocommerce div.product,
body.single-product div.product.mp-single {
  display: block;
  margin-top: 0;
  grid-template-columns: none;
}

/* ---------- 2. LAYOUT -------------------------------------- */
.mp-single__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: start;
  max-width: var(--max-width-wide, 1600px);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 4rem);
}

.mp-single__media {
  position: relative;
  min-width: 0;
}
.mp-single__media .woocommerce-product-gallery {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  opacity: 1 !important;
}
.mp-single__media img {
  width: 100%;
  height: auto;
  display: block;
}
/* gallery thumbnail strip */
.mp-single__media .flex-control-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-2, 0.5rem);
  margin: var(--sp-2, 0.5rem) 0 0;
  padding: 0;
  list-style: none;
}
.mp-single__media .flex-control-thumbs li {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
}
.mp-single__media .flex-control-thumbs img {
  opacity: 0.5;
  cursor: pointer;
  transition: opacity var(--t-base, 0.3s) var(--ease, ease);
}
.mp-single__media .flex-control-thumbs img.flex-active,
.mp-single__media .flex-control-thumbs img:hover {
  opacity: 1;
}

/* info column tracks the image on long pages */
.mp-single__info {
  position: sticky;
  top: calc(var(--header-h, 64px) + var(--sp-8, 2rem));
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- 3. TYPOGRAPHY & HIERARCHY ---------------------- */
/* eyebrow — same treatment as .luxury-item-cat on the shop cards */
.mp-single__eyebrow {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clr-accent, #009933);
  text-decoration: none;
  margin: 0 0 var(--sp-4, 1rem);
}
.mp-single__eyebrow:hover { color: var(--clr-white, #fff); }

.mp-single__title.product_title {
  font-size: clamp(2.1rem, 4.4vw, 3.9rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--clr-white, #fff);
  margin: 0 0 var(--sp-4, 1rem);
}

.mp-single__price {
  font-size: clamp(1.3rem, 2.1vw, 1.9rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--clr-white, #fff);
  margin: 0 0 var(--sp-6, 1.5rem);
  padding: 0 0 var(--sp-6, 1.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.mp-single__price .woocommerce-Price-amount { color: inherit; }
.mp-single__price del { opacity: 0.45; margin-right: var(--sp-2, 0.5rem); }
.mp-single__price ins { text-decoration: none; }
/* quote-only products show a label instead of a figure */
.mp-single__price .maison-quote-price {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
}

/* description keeps the .woocommerce-product-details__short-description
   class so the ConsolaMono secondary-font rule still matches it */
.mp-single__desc {
  color: rgba(255, 255, 255, 0.72);
  max-width: 48ch;
  margin: 0 0 var(--sp-8, 2rem);
}
.mp-single__desc p {
  font-size: 0.9rem;
  line-height: 1.9;
  margin: 0 0 var(--sp-4, 1rem);
}
.mp-single__desc p:last-child { margin-bottom: 0; }

/* ---------- 4. QUANTITY + ADD TO CART ---------------------- */
.mp-single__buy { margin: 0 0 var(--sp-4, 1rem); }

.mp-single__buy form.cart {
  display: flex;
  align-items: stretch;
  gap: var(--sp-3, 0.75rem);
  flex-wrap: wrap;
  margin: 0;
}

/* the stepper wrapper is injected by single-product.js */
.mp-single__buy .quantity,
.mp-single__buy .mp-qty {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  height: 56px;
}
.mp-single__buy .quantity label { display: none; }

.mp-single__buy .mp-qty__btn {
  width: 42px;
  border: 0;
  background: transparent;
  color: var(--clr-white, #fff);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-base, 0.3s) var(--ease, ease);
}
.mp-single__buy .mp-qty__btn:hover { background: rgba(255, 255, 255, 0.1); }

.mp-single__buy input.qty {
  width: 56px;
  height: 100%;
  background: transparent;
  border: 0;
  color: var(--clr-white, #fff);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.mp-single__buy input.qty::-webkit-outer-spin-button,
.mp-single__buy input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* filled accent button — the strongest CTA on the page.
   The parent sets .luxury-product-page .single_add_to_cart_button.button
   (height 50px etc), so these need !important to land. */
body.single-product .mp-single__buy .single_add_to_cart_button.button,
body.single-product .mp-single__buy button[type="submit"],
body.single-product .mp-single__quote {
  flex: 1 1 220px;
  max-width: 340px;
  height: 56px !important;
  line-height: 56px !important;
  padding: 0 var(--sp-8, 2rem) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--clr-accent, #009933) !important;
  color: var(--clr-white, #fff) !important;
  border: 1px solid var(--clr-accent, #009933) !important;
  border-radius: 0 !important;
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: background var(--t-base, 0.3s) var(--ease, ease),
              color var(--t-base, 0.3s) var(--ease, ease) !important;
}
body.single-product .mp-single__buy .single_add_to_cart_button.button:hover,
body.single-product .mp-single__buy button[type="submit"]:hover,
body.single-product .mp-single__quote:hover {
  background: transparent !important;
  color: var(--clr-white, #fff) !important;
}

/* ---------- 5. WISHLIST + META ----------------------------- */
.mp-single__wishlist { margin: 0 0 var(--sp-6, 1.5rem); }
.mp-single__wishlist .yith-wcwl-add-to-wishlist { margin: 0 !important; }
.mp-single__wishlist a {
  font-size: 0.6rem !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.7) !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 2px;
  transition: color var(--t-base, 0.3s) var(--ease, ease);
}
.mp-single__wishlist a:hover { color: var(--clr-accent, #009933) !important; }

.mp-single__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2, 0.5rem) var(--sp-6, 1.5rem);
  margin: 0;
  padding: var(--sp-6, 1.5rem) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.mp-single__meta dt {
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}
.mp-single__meta dd {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}
.mp-single__meta dd a { color: inherit; text-decoration: none; }
.mp-single__meta dd a:hover { color: var(--clr-accent, #009933); }

/* ---------- 6. RELATED PRODUCTS ---------------------------- */
/* Scoped to .mp-related, not to a body class, so it can never be
   defeated by the luxury-shop-page / luxury-product-page mismatch. */
.mp-related {
  max-width: var(--max-width-wide, 1600px);
  margin: clamp(4rem, 9vw, 9rem) auto 0;
  padding: clamp(3rem, 6vw, 6rem) clamp(1.25rem, 4vw, 4rem) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  clear: both;
}
.mp-related__title {
  font-size: clamp(1.1rem, 1.9vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clr-white, #fff);
  margin: 0 0 clamp(1.75rem, 3.5vw, 3rem);
}
.mp-related__grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(1.5rem, 2.5vw, 2.5rem) !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  float: none !important;
}
/* WooCommerce injects clearfix pseudo-elements on ul.products; inside a
   grid container they become stray grid items and shift every card. */
.mp-related__grid::before,
.mp-related__grid::after {
  content: none !important;
  display: none !important;
}
.mp-related__grid > * {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  clear: none !important;
  overflow: visible !important;
}
/* the card fills its cell so rows line up regardless of copy length */
.mp-related__grid .luxury-catalog-item,
.mp-related__grid .luxury-item-inner,
.mp-related__grid .luxury-item-image-area {
  height: 100%;
}
.mp-related__grid .luxury-item-img-wrap { aspect-ratio: 4 / 3; }
.mp-related__grid .luxury-item-img { height: 100%; }

/* ---------- 7. RESPONSIVE ---------------------------------- */
@media (max-width: 1024px) {
  .mp-single__inner {
    grid-template-columns: 1fr;
    gap: var(--sp-8, 2rem);
  }
  .mp-single__info { position: static; }
  .mp-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
  body.single-product main.woo-main {
    padding-top: calc(var(--header-h, 64px) + var(--sp-8, 2rem));
  }
  .mp-single__buy form.cart { gap: var(--sp-2, 0.5rem); }
  body.single-product .mp-single__buy .single_add_to_cart_button.button { flex-basis: 100%; max-width: none; }
  .mp-related__grid { grid-template-columns: 1fr !important; }
}
