/* Template: single-product.php — mockup EXALCO-Products › detail view ("Product detail").
   Blocks: .ex-product-single (page), .ex-viewer-3d (3D box), .ex-viewer-3d-modal (3D dialog).
   Buttons, eyebrow, titles, link-arrow and the project tiles come from base.css / components.
   ========================================================================== */

.ex-product-single { padding-block: clamp(34px, 4vw, 56px); background: var(--ex-white); color: var(--ex-ink); }

/* 1. Hero: gallery left, summary right
   ========================================================================== */
.ex-product-single__hero { display: grid; grid-template-columns: minmax(300px, .75fr) 1.25fr; gap: clamp(24px, 3vw, 48px); align-items: start; }
.ex-product-single__hero > :only-child { grid-column: 1 / -1; }
.ex-product-single__gallery { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ex-product-single__image,
.ex-product-single__thumb { border: var(--ex-border-w) solid var(--ex-line); background: var(--ex-white); transition: border-color var(--ex-t-base); }
.ex-product-single__image:hover,
.ex-product-single__image:focus-visible,
.ex-product-single__thumb:hover,
.ex-product-single__thumb:focus-visible { border-color: var(--ex-ink); }
.ex-product-single__thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ex-product-single__thumbs-item { flex: none; width: clamp(64px, 6vw, 92px); }

.ex-product-single__summary { min-width: 0; }
.ex-product-single__badge { display: inline-block; margin: 0; padding: 6.5px 11px; background: var(--ex-red); color: var(--ex-white); font-size: 10.5px; font-weight: 700; line-height: normal; letter-spacing: .08em; }
.ex-product-single__badge--without { padding: 5px 11px; border: var(--ex-border-w) solid var(--ex-ink); background: var(--ex-white); color: var(--ex-ink); }
.ex-product-single__title { margin: 10px 0 14px; font-size: clamp(34px, 3.2vw, 54px); font-weight: var(--ex-fw-title); line-height: .98; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ex-product-single__badge + .ex-product-single__title { margin-top: 10px; }
.ex-product-single__title:first-child { margin-top: 0; }
.ex-product-single__description { margin: 0 0 14px; font-size: var(--ex-fs-rich); line-height: 1.65; }
.ex-product-single__description > p { margin: 0; }
.ex-product-single__apps { margin: 0 0 22px; font-size: var(--ex-fs-body-sm); line-height: 1.6; }
.ex-product-single__apps-label { font-weight: 700; }
.ex-product-single__actions { gap: 12px; margin-bottom: 26px; }
/* Mockup: both hero buttons are 46px high (15px 24px; outline 13px 22px + 2px border), letter-spacing .07em */
.ex-product-single__actions .ex-btn { --ex-btn-px: 24px; padding-block: 15px; letter-spacing: .07em; }
.ex-product-single__actions .ex-btn--outline { --ex-btn-px: 22px; padding-block: 13px; }
.ex-product-single__catalogue { gap: 10px; }
.ex-product-single__catalogue-icon { flex: none; }

/* 2. 3D viewer box
   ========================================================================== */
.ex-viewer-3d { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 22px 24px; background: var(--ex-dark); color: var(--ex-white); }
.ex-viewer-3d__icon { display: flex; flex: none; align-items: center; justify-content: center; width: 52px; height: 52px; border: var(--ex-border-w) solid rgba(255, 255, 255, .35); }
.ex-viewer-3d__body { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.ex-viewer-3d__title { margin: 0; font-size: 14px; font-weight: 800; line-height: normal; letter-spacing: .05em; color: var(--ex-white); }
.ex-viewer-3d__text { margin: 0; font-size: 12px; line-height: normal; color: var(--ex-white); }
.ex-viewer-3d__button {
  flex: none;
  margin: 0;
  padding: 11px 16px;
  border: var(--ex-border-w) solid rgba(255, 255, 255, .6);
  border-radius: var(--ex-radius);
  background: transparent;
  color: var(--ex-white);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: normal;
  letter-spacing: .1em;
  cursor: pointer;
  transition: background-color var(--ex-t-base), color var(--ex-t-base);
}
.ex-viewer-3d__button:hover,
.ex-viewer-3d__button:focus-visible { background: var(--ex-white); color: var(--ex-dark); }

/* 3. Details: technical characteristics left, certificates + downloads right
   ========================================================================== */
.ex-product-single__details { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 3.4vw, 56px); align-items: start; margin-top: clamp(24px, 2.8vw, 40px); }
.ex-product-single__details > :only-child { grid-column: 1 / -1; }
.ex-product-single__details--no-specs { grid-template-columns: minmax(0, 1fr); }
.ex-product-single__specs { min-width: 0; }
.ex-product-single__heading { margin: 0 0 18px; font-size: 15px; font-weight: 800; line-height: normal; letter-spacing: .12em; color: var(--ex-ink); }
.ex-product-single__heading--tight { margin-bottom: 16px; }

.ex-product-single__spec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(20px, 2.4vw, 44px); margin: 0; }
.ex-product-single__spec { padding: 13px 12px; border-bottom: 1px solid var(--ex-red-line); background: var(--ex-white); break-inside: avoid; }
/* Zebra per visual row (two cells per row) */
.ex-product-single__spec:nth-child(4n + 1),
.ex-product-single__spec:nth-child(4n + 2) { background: var(--ex-red-tint); }
.ex-product-single__spec-label { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 13px; font-weight: 700; line-height: normal; }
.ex-product-single__spec-label::before { content: ''; flex: none; width: 7px; height: 7px; background: var(--ex-red); }
.ex-product-single__spec-value { margin: 5px 0 0; font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; }

.ex-product-single__aside { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.ex-product-single__certs-box { padding: 18px 20px; border: 1px solid var(--ex-red-line); background: var(--ex-red-tint); font-size: 12.5px; line-height: 1.65; }
.ex-product-single__certs-box > * { margin: 0; }
.ex-product-single__certs-box > * + * { margin-top: 10px; }
.ex-product-single__certs-box a { border-bottom: 1px solid var(--ex-red); font-weight: 700; color: var(--ex-red); text-decoration: none; }
.ex-product-single__certs-box a:hover,
.ex-product-single__certs-box a:focus-visible { border-bottom-color: var(--ex-ink); color: var(--ex-ink); }

.ex-product-single__download-list { display: flex; flex-direction: column; gap: 26px; margin: 0; padding: 0; list-style: none; }
.ex-product-single__download { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--ex-blue-line); background: var(--ex-blue); }
.ex-product-single__download--bim { border: 1px dashed #C9D0CF; background: var(--ex-tint); }
.ex-product-single__download-type { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 52px; background: var(--ex-red); color: var(--ex-white); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.ex-product-single__download-type--bim { background: var(--ex-ink); letter-spacing: .04em; }
.ex-product-single__download-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.ex-product-single__download-link { align-items: center; padding-bottom: 3px; font-size: 11.5px; white-space: nowrap; }
.ex-product-single__lock { flex: none; }
.ex-product-single__download-note { flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: var(--ex-text-muted); }

/* 4. Related projects band
   ========================================================================== */
.ex-product-single__projects { margin-top: clamp(24px, 2.8vw, 40px); padding: clamp(22px, 2.6vw, 36px) clamp(20px, 2.6vw, 36px); border-top: 3px solid var(--ex-red); background: var(--ex-blue); }
.ex-product-single__projects .ex-eyebrow { margin-bottom: 6px; }
.ex-product-single__projects-title { margin: 0 0 18px; }
.ex-product-single__projects-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--ex-space-4); margin: 0; padding: 0; list-style: none; }
.ex-product-single__projects-item { display: flex; min-width: 0; }
.ex-product-single__projects-item .ex-project-card { height: 220px; }
/* Band-specific tile type scale (mockup: 17px title, 20/16px inset) */
.ex-product-single__projects-item .ex-tile__body { left: 20px; right: 20px; bottom: 16px; }
.ex-product-single__projects-item .ex-project-card .ex-tile__kicker { line-height: normal; color: var(--ex-white); }
.ex-product-single__projects-item .ex-project-card .ex-tile__title { margin-top: 5px; font-size: 17px; line-height: normal; letter-spacing: 0; }
.ex-product-single__projects-item .ex-project-card .ex-tile__sub { margin-top: 0; font-size: 12.5px; line-height: normal; color: var(--ex-white); }

/* 5. 3D dialog (closed = [hidden]; JS removes it and adds .is-open)
   ========================================================================== */
.ex-viewer-3d-modal { position: fixed; inset: 0; z-index: var(--ex-z-modal); display: flex; align-items: center; justify-content: center; padding: clamp(12px, 3vw, 48px); }
.ex-viewer-3d-modal[hidden] { display: none; }
.ex-viewer-3d-modal__backdrop { position: absolute; inset: 0; background: rgba(35, 31, 32, .6); }
.ex-viewer-3d-modal__dialog { position: relative; display: flex; flex-direction: column; width: min(1200px, 100%); height: min(760px, 100%); background: var(--ex-dark); color: var(--ex-white); box-shadow: var(--ex-shadow-drawer); }
.ex-viewer-3d-modal.is-open .ex-viewer-3d-modal__dialog { animation: ex-viewer-3d-in var(--ex-t-slow) var(--ex-ease-out) both; }
.ex-viewer-3d-modal__bar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 14px 14px 24px; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.ex-viewer-3d-modal__title { margin: 0; min-width: 0; font-size: 14px; font-weight: 800; line-height: 1.3; letter-spacing: .05em; color: var(--ex-white); }
.ex-viewer-3d-modal__close { display: flex; flex: none; align-items: center; justify-content: center; width: var(--ex-touch); height: var(--ex-touch); margin: 0; padding: 0; border: var(--ex-border-w) solid rgba(255, 255, 255, .35); border-radius: var(--ex-radius); background: transparent; color: var(--ex-white); cursor: pointer; transition: background-color var(--ex-t-base), color var(--ex-t-base); }
.ex-viewer-3d-modal__close:hover,
.ex-viewer-3d-modal__close:focus-visible { background: var(--ex-white); color: var(--ex-dark); }
.ex-viewer-3d-modal__close:focus-visible,
.ex-viewer-3d__button:focus-visible { outline: 2px solid var(--ex-white); outline-offset: 3px; }
.ex-viewer-3d-modal__frame { position: relative; flex: 1; min-height: 0; background: var(--ex-ink); }
.ex-viewer-3d-modal__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@keyframes ex-viewer-3d-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* 6. Responsive (not designed — proposal)
   ========================================================================== */
@media (max-width: 1439px) {
  .ex-product-single__hero { grid-template-columns: minmax(280px, .85fr) 1.15fr; }
  .ex-product-single__details { grid-template-columns: 1.25fr 1fr; }
}

@media (max-width: 1199px) {
  .ex-product-single__hero { grid-template-columns: minmax(0, 1fr); }
  .ex-product-single__gallery { max-width: 560px; }
  .ex-product-single__details { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 899px) {
  .ex-product-single__title { font-size: clamp(30px, 7vw, 44px); }
  .ex-product-single__thumbs-item { width: 72px; }
  /* 44px hit area for the inline R&D address; the text and its underline do not move */
  .ex-product-single__certs-box a { position: relative; }
  .ex-product-single__certs-box a::after { content: ''; position: absolute; inset: -14px -6px; }
  .ex-viewer-3d__button { min-height: var(--ex-touch); }
  .ex-product-single__download-link { min-height: var(--ex-touch); }
  .ex-product-single__download-list,
  .ex-product-single__aside { gap: 18px; }
  .ex-viewer-3d-modal { padding: 0; }
  .ex-viewer-3d-modal__dialog { width: 100%; height: 100%; }
}

@media (max-width: 599px) {
  .ex-product-single__gallery { max-width: none; }
  .ex-product-single__spec-list { grid-template-columns: minmax(0, 1fr); }
  /* One cell per row: plain alternate zebra */
  .ex-product-single__spec:nth-child(n) { background: var(--ex-white); }
  .ex-product-single__spec:nth-child(odd) { background: var(--ex-red-tint); }
  .ex-product-single__actions { flex-direction: column; align-items: stretch; }
  .ex-viewer-3d { padding: 18px; }
  .ex-viewer-3d__body { flex-basis: calc(100% - 70px); }
  .ex-viewer-3d__button { width: 100%; }
  .ex-product-single__download { padding: 16px; }
  .ex-product-single__download-title { flex-basis: calc(100% - 60px); }
  .ex-product-single__projects { margin-inline: calc(-1 * var(--ex-gutter)); padding-inline: var(--ex-gutter); }
  .ex-product-single__projects-list { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ex-product-single__image,
  .ex-product-single__thumb,
  .ex-viewer-3d__button,
  .ex-viewer-3d-modal__close { transition: none; }
  .ex-viewer-3d-modal.is-open .ex-viewer-3d-modal__dialog { animation: none; }
}
