/* Ferroluce shares the established Luna Luce dark product language without
   changing product data, shop logic, or the Siru / NUME presentation layers. */
body.llfa-ferroluce-product,
body.llfa-ferroluce-product .wp-site-blocks,
body.llfa-ferroluce-product main.wp-block-group,
body.llfa-ferroluce-product .woocommerce,
body.llfa-ferroluce-product .summary,
body.llfa-ferroluce-product .woocommerce-tabs,
body.llfa-ferroluce-product .related {
  background:#181715 !important;
  color:#eee6db;
}

body.llfa-ferroluce-product main.wp-block-group {
  max-width:none !important;
  padding-top:clamp(26px,4vw,54px) !important;
}

body.llfa-ferroluce-product .wp-block-post-title,
body.llfa-ferroluce-product .product_title,
body.llfa-ferroluce-product .price,
body.llfa-ferroluce-product .woocommerce-tabs .panel,
body.llfa-ferroluce-product .woocommerce-tabs ul.tabs li a,
body.llfa-ferroluce-product .woocommerce-product-details__short-description,
body.llfa-ferroluce-product .llfa-story,
body.llfa-ferroluce-product .llfa-story>p:not(.llfa-story__label),
body.llfa-ferroluce-product .llfa-collection-story p {
  color:#eee6db !important;
}

body.llfa-ferroluce-product .wp-block-post-excerpt,
body.llfa-ferroluce-product .woocommerce-product-details__short-description,
body.llfa-ferroluce-product .woocommerce-tabs .panel {
  color:rgba(238,230,219,.77) !important;
}

body.llfa-ferroluce-product .woocommerce-product-gallery__wrapper,
body.llfa-ferroluce-product .woocommerce-product-gallery__image>a,
body.llfa-ferroluce-product .woocommerce-product-gallery__image img {
  background:#26221d !important;
}

body.llfa-ferroluce-product .woocommerce-product-gallery__image>a {
  cursor:zoom-in !important;
}

body.llfa-ferroluce-product .llfa-atelier {
  --llfa-paper:#201d18;
  --llfa-ink:#f1e9dc;
  --llfa-line:rgba(229,218,195,.19);
  --llfa-gold:#c9a565;
  max-width:1240px;
  margin-top:clamp(30px,5vw,58px);
  background:#201d18 !important;
  color:#f1e9dc !important;
}

body.llfa-ferroluce-product .llfa-atelier__header span,
body.llfa-ferroluce-product .llfa-summary small {
  color:rgba(238,230,219,.7) !important;
}

body.llfa-ferroluce-product .llfa-choice legend,
body.llfa-ferroluce-product .llfa-summary [data-llfa-summary],
body.llfa-ferroluce-product .llfa-summary a,
body.llfa-ferroluce-product .llfa-specs span {
  color:#f1e9dc !important;
}

body.llfa-ferroluce-product .llfa-swatch {
  background:#302b24;
  border-color:rgba(229,218,195,.28);
}

/* Short official codes remain visible under every finish and pattern sample. */
body.llfa-ferroluce-product .llfa-atelier .llffs-choice .llfa-swatch span {
  color:#e5dbce !important;
  text-shadow:0 1px 5px rgba(0,0,0,.72);
}
body.llfa-ferroluce-product .llfa-atelier .llffs-choice .llfa-swatch:hover span,
body.llfa-ferroluce-product .llfa-atelier .llffs-choice .llfa-swatch:focus-visible span,
body.llfa-ferroluce-product .llfa-atelier .llffs-choice .llfa-swatch.is-selected span {
  color:#d7b76f !important;
}

/* The technical data use one quiet, inset panel instead of edge-aligned
   columns, matching the spatial rhythm of the other catalogue families. */
body.llfa-ferroluce-product .llfa-specs {
  width:min(100%,940px);
  margin:clamp(34px,5vw,58px) auto 0 !important;
  padding:24px 28px 0;
  border:1px solid rgba(229,218,195,.18);
  background:#191713;
  grid-template-columns:repeat(4,minmax(0,1fr));
}

body.llfa-ferroluce-product .llfa-specs dt {
  grid-column:1/-1;
  padding:0 0 20px;
  color:#c9a565 !important;
  border-bottom:1px solid rgba(229,218,195,.18);
}

body.llfa-ferroluce-product .llfa-specs div {
  min-height:82px;
  padding:19px 18px 18px !important;
  border-left:1px solid rgba(229,218,195,.18) !important;
}
body.llfa-ferroluce-product .llfa-specs div:first-of-type { border-left:0 !important; }

body.llfa-ferroluce-product .llfa-specs dd {
  color:#c9a565 !important;
}

/* Canonical product details: the verified Ferroluce data are moved out of the
   optional-finish studio and use the exact Luna Luce details hierarchy used by
   the Siru and NUME product pages. */
body.llfa-ferroluce-product .llpe-technical--ferroluce { display:block !important; }
body.llfa-ferroluce-product .llfa-specs[hidden] { display:none !important; }

/* Decorations and rim finishes are genuinely optional: a clear action makes
   that choice explicit without touching the required metal finish. */
body.llfa-ferroluce-product .llfpu-clear-choice {
  display:inline-flex;
  align-items:center;
  margin:30px 0 2px;
  padding:0;
  border:0;
  background:transparent;
  color:#e5dbce;
  cursor:pointer;
  font:.68rem/1.2 var(--llpe-sans,Arial,sans-serif);
  letter-spacing:.1em;
  text-decoration:underline;
  text-underline-offset:4px;
}
body.llfa-ferroluce-product .llfpu-clear-choice:hover,
body.llfa-ferroluce-product .llfpu-clear-choice:focus-visible { color:#d7b76f; }

/* These two presentation fixes are shared by all product families. */
body.single-product .woocommerce-product-gallery__wrapper { min-height:0 !important; }
body.single-product .llfpu-delivery-title,
body.single-product .llfpu-delivery-title strong {
  color:#f3eadc !important;
  font-family:var(--llpe-serif,Georgia,serif) !important;
}

/* The selected swatch already receives a generous preview at right. It is a
   read-only visual aid, not a second lightbox interaction. */
body.llfa-ferroluce-product .llffs-preview {
  max-width:330px;
  cursor:default !important;
}
body.llfa-ferroluce-product .llffs-preview:focus { outline:0 !important; }
body.llfa-ferroluce-product .llffs-preview__caption > span:last-child { display:none !important; }

/* A restrained lightbox for the actual product image. */
/* Every product uses the same direct, image-first zoom interaction. */
body.single-product .woocommerce-product-gallery__image > a { cursor:zoom-in !important; }
body.single-product .woocommerce-product-gallery__image > a,
body.single-product .woocommerce-product-gallery__image > a img { pointer-events:auto !important; }
/* A portrait aspect ratio on an image inside a square gallery was forcing
   the image below its clipping frame. The frame owns the dimensions. */
body.llfa-ferroluce-product .woocommerce-product-gallery .woocommerce-product-gallery__image > a > img:not(.zoomImg) {
  width:100% !important;
  height:100% !important;
  min-width:0;
  min-height:0;
  max-height:100%;
  aspect-ratio:auto !important;
  object-fit:contain !important;
  transform:none !important;
}
.llfpu-image-lightbox {
  position:fixed;
  z-index:999999;
  inset:0;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  box-sizing:border-box;
  margin:0;
  border:0;
  display:grid;
  place-items:center;
  padding:16px;
  background:rgba(0,0,0,.78);
  opacity:0;
  transition:opacity .2s ease;
}
.llfpu-image-lightbox::backdrop { background:transparent; }
.llfpu-image-lightbox.is-open { opacity:1; }
.llfpu-image-lightbox__surface {
  width:min(1100px,calc(100vw - 32px));
  max-height:calc(100vh - 32px);
  position:relative;
  padding:0;
  overflow:hidden;
  border:1px solid rgba(229,218,195,.34);
  background:#181715;
  box-shadow:0 28px 90px rgba(0,0,0,.64);
}
.llfpu-image-lightbox img {
  display:block;
  width:100%;
  max-height:calc(100vh - 32px);
  object-fit:contain;
  background:#26221d;
}
.llfpu-image-lightbox button {
  position:absolute;
  top:12px;
  right:12px;
  width:42px;
  height:42px;
  border:1px solid rgba(229,218,195,.6);
  border-radius:50%;
  background:#181715;
  color:#f5eee4;
  cursor:pointer;
  font:400 1.7rem/1 Georgia,serif;
}

/* Related products rely on WooCommerce's category/tag relation; no more than
   four are output and all cards retain a stable editorial rhythm. */
body.llfa-ferroluce-product .related ul.products li.product:nth-child(n+5) { display:none !important; }
body.llfa-ferroluce-product .related ul.products {
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
}

@media (max-width:820px) {
  body.llfa-ferroluce-product main.wp-block-group { padding-top:20px !important; }
  body.llfa-ferroluce-product .llfa-atelier { margin-left:18px; margin-right:18px; padding:25px 20px; }
  body.llfa-ferroluce-product .llfa-specs {
    grid-template-columns:1fr 1fr;
    padding:20px 18px 4px;
  }
  body.llfa-ferroluce-product .llfa-specs dt { grid-column:1/-1; }
  body.llfa-ferroluce-product .llfa-specs div { border-top:1px solid rgba(229,218,195,.18) !important; }
  body.llfa-ferroluce-product .related ul.products { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width:480px) {
  body.llfa-ferroluce-product .llfa-specs { grid-template-columns:1fr; }
  body.llfa-ferroluce-product .llfa-specs div { border-left:0 !important; }
  body.llfa-ferroluce-product .related ul.products { grid-template-columns:1fr !important; }
}

/* Shared gallery navigation: real, uncropped image sources are assigned by
   refineGalleryMedia. Compact thumbnails never stretch to quarter-width tiles. */
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
  display:grid !important;
  grid-template-columns:repeat(auto-fill, minmax(56px,72px));
  gap:10px;
  justify-content:start;
  margin:12px 0 0 !important;
  padding:0 !important;
  max-width:100%;
  list-style:none;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
  float:none !important;
  width:100% !important;
  min-width:0;
  margin:0 !important;
  padding:0 !important;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
  box-sizing:border-box;
  display:block;
  width:100% !important;
  height:72px !important;
  aspect-ratio:1 !important;
  object-fit:contain !important;
  object-position:center;
  transform:none !important;
  border:1px solid rgba(229,218,195,.28);
  background:#26221d !important;
  opacity:.72;
  cursor:pointer;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs img:is(.flex-active,:hover) {
  border-color:#d7b76f;
  opacity:1;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs img:focus-visible {
  outline:2px solid #ead4a4;
  outline-offset:3px;
}

body.single-product .woocommerce-Tabs-panel--description > h2,
body.single-product .related > h2,
body.single-product .wp-block-woocommerce-product-collection[data-collection="woocommerce/product-collection/related"] > .wp-block-heading {
  color:#f4eee3 !important;
  font-family:"Cormorant Garamond",Georgia,serif !important;
  font-size:clamp(1.75rem,2.6vw,2.25rem) !important;
  font-weight:500 !important;
  line-height:1.2 !important;
  letter-spacing:0 !important;
  text-transform:none !important;
}
