/* ==========================================================================
   M R Dental — Products page and product pages (rendered by scripts/build-site.mjs)
   Builds on the tokens and components in main.css; nothing here restyles the homepage.
   ========================================================================== */

/* Header on pages without a dark hero band: solid from the start */
body.page--products:not(:has([data-hero])) .site-header,
.site-header.site-header--static {
  color: var(--ink-strong); --logo-icon: var(--teal); --logo-word: var(--teal); height: 72px;
}
body.page--products:not(:has([data-hero])) .site-header::before,
.site-header.site-header--static::before { opacity: 0; }
/* the frosted white bar itself lives on ::after (see main.css: never on the header) */
body.page--products:not(:has([data-hero])) .site-header::after,
.site-header.site-header--static::after { opacity: 1; }
body.page--products:not(:has([data-hero])) .site-header .site-nav .btn--primary,
.site-header--static .site-nav .btn--primary { background: var(--teal); color: var(--white); border-color: var(--teal); }
/* Phone menu: the open menu is white on deep teal here too, as on every other page. */
@media (max-width: 860px) {
  body.page--products:not(:has([data-hero])) .site-header.is-open,
  .site-header.site-header--static.is-open { color: var(--white); --logo-icon: var(--white); --logo-word: var(--white); }
  body.page--products:not(:has([data-hero])) .site-header .site-nav .btn--primary,
  .site-header--static .site-nav .btn--primary { background: var(--white); color: var(--teal-deep); border-color: var(--white); }
}

/* ---------- Products page head ---------- */
.pr-head { background: var(--teal-deep); color: var(--white); padding: calc(var(--header-h) + 48px) 0 44px; }
.pr-head__title { color: var(--white); font-size: var(--text-display); letter-spacing: -0.015em; margin-bottom: 0.3em; }
.pr-head__lead { max-width: 58ch; font-size: var(--text-lg); line-height: 1.55; color: rgba(255,255,255,.9); margin-bottom: 28px; }
.pr-head__nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.pr-head__nav a { color: var(--white); text-decoration: none; font-weight: 600; font-size: var(--text-sm); padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.35); transition: border-color .2s; }
.pr-head__nav a:hover { border-bottom-color: var(--white); color: var(--white); }

/* ---------- Chapters ---------- */
/* 72px = the solid header's height. With the taller transparent header's 84px, the first chapter landed exactly on
   the header's switch-over point: the header stayed transparent and the group links above showed through it. */
.pr-chapter { padding-block: clamp(56px, 7vw, 104px); scroll-margin-top: 72px; }
.pr-chapter + .pr-chapter { border-top: 1px solid var(--rule); }
.pr-chapter__head { max-width: 760px; margin-bottom: 36px; }
.pr-chapter__head .lead { color: var(--ink); }
.pr-sub { font-family: var(--font-head); font-weight: 500; font-size: var(--text-h3); color: var(--teal-deep); margin: 36px 0 16px; }
.pr-sub:first-of-type { margin-top: 0; }

.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: 24px; }
.pr-grid--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.pr-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--white); transition: border-color .25s, box-shadow .25s; }
.pr-card:hover { border-color: var(--teal); box-shadow: 0 10px 30px rgba(20,127,107,.10); color: inherit; }
.pr-card:focus-visible { outline-offset: 2px; }
.pr-card__media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--paper-soft); overflow: hidden; }
.pr-card__media img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; transition: transform .5s var(--ease-out); }
.pr-card:hover .pr-card__media img { transform: scale(1.035); }
.pr-card__media--placeholder { background: repeating-linear-gradient(135deg, var(--paper-soft) 0 12px, #eaf2ef 12px 13px); }
.pr-card__pending { position: absolute; left: 12px; bottom: 12px; font-size: var(--text-xs); color: var(--ink-soft); background: var(--white); border: 1px solid var(--rule); padding: 4px 10px; border-radius: 999px; }
.pr-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.pr-card__name { font-family: var(--font-head); font-weight: 500; font-size: var(--text-lg); color: var(--ink-strong); line-height: 1.2; }
.pr-card__tag { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.45; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.pr-chips > * { font-size: 0.78rem; line-height: 1; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); white-space: nowrap; }
.pr-chips--opts > * { background: var(--paper-soft); border-color: transparent; }

/* Comparison strip (acrylic teeth) */
.pr-compare { overflow-x: auto; margin: 0 0 32px; border: 1px solid var(--rule); border-radius: var(--radius); }
.pr-compare table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: var(--text-sm); }
.pr-compare th, .pr-compare td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.pr-compare thead th { font-family: var(--font-head); font-weight: 500; font-size: var(--text-md); color: var(--teal-deep); background: var(--paper-soft); }
.pr-compare thead th a { text-decoration: none; }
.pr-compare thead th a:hover { text-decoration: underline; }
.pr-compare tbody th { font-weight: 600; color: var(--ink-soft); width: 20%; }
.pr-compare tbody td { font-variant-numeric: tabular-nums; }
.pr-compare tr:last-child th, .pr-compare tr:last-child td { border-bottom: 0; }

/* Order band */
.pr-order { background: var(--paper-soft); border-top: 1px solid var(--rule); padding-block: clamp(48px, 6vw, 80px); }
.pr-order__inner { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; align-items: center; }
.pr-order__inner p { max-width: 56ch; }
.pr-order__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
@media (max-width: 760px) { .pr-order__inner { grid-template-columns: 1fr; } .pr-order__actions { justify-content: flex-start; } }

/* ---------- Product page ---------- */
.pd { padding: calc(72px + 28px) 0 clamp(56px, 7vw, 96px); }
.pd-crumbs { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--text-xs); color: var(--ink-soft); margin-bottom: 28px; }
.pd-crumbs a { color: var(--ink-soft); text-decoration: none; }
.pd-crumbs a:hover { color: var(--teal-deep); text-decoration: underline; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.pd-gallery__main { position: relative; aspect-ratio: 4 / 3; background: var(--paper-soft); border-radius: var(--radius); overflow: hidden; }
.pd-gallery__main img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; }
.pd-gallery--placeholder .pd-gallery__main { background: repeating-linear-gradient(135deg, var(--paper-soft) 0 12px, #eaf2ef 12px 13px); }
.pd-gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.pd-thumb { width: 76px; height: 60px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-soft); padding: 6px; transition: border-color .2s; }
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb:hover, .pd-thumb.is-active { border-color: var(--teal); }
.pd-title { font-size: var(--text-h2); letter-spacing: -0.01em; margin-bottom: 0.3em; text-wrap: balance; }
.pd-tagline { font-family: var(--font-head); font-weight: 400; font-size: var(--text-lg); color: var(--teal-deep); margin-bottom: 1.2em; }
.pd-desc p { max-width: 58ch; }
.pd-highlights { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.pd-highlights li { position: relative; padding-left: 26px; font-size: var(--text-sm); }
.pd-highlights li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 14px; height: 2px; background: var(--teal); }
.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.pd-specs { margin: 0; display: grid; border-top: 1px solid var(--rule); }
.pd-specs div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: var(--text-sm); }
.pd-specs dt { color: var(--ink-soft); font-weight: 600; }
.pd-specs dd { margin: 0; }
.pd-section { margin-top: clamp(40px, 5vw, 64px); }
.pd-section h2 { font-family: var(--font-head); font-weight: 500; font-size: var(--text-h3); margin-bottom: 14px; color: var(--ink-strong); }
.pd-section > p { max-width: 60ch; }
.pd-options, .pd-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 40px; }
.pd-option h3 { font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); color: var(--ink-soft); margin-bottom: 8px; }
.pd-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
.pd-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 480px; }
.pd-table th, .pd-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.pd-table thead th { background: var(--paper-soft); font-weight: 600; color: var(--ink-soft); }
.pd-table tbody th { font-weight: 600; color: var(--ink-strong); }
.pd-table tr:last-child th, .pd-table tr:last-child td { border-bottom: 0; }
.pd-table td a { font-weight: 600; text-decoration: none; }
.pd-table td a:hover { text-decoration: underline; }
.pd-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pd-related { background: var(--paper-soft); border-top: 1px solid var(--rule); padding-block: clamp(48px, 6vw, 88px); }
.pd-related .section__heading { max-width: none; margin-bottom: 28px; }

@media (max-width: 860px) {
  .pr-head { padding-top: calc(var(--header-h) + 24px); }
  .pd { padding-top: calc(72px + 20px); }
  .pd-grid { grid-template-columns: 1fr; }
  .pd-specs div { grid-template-columns: 7.5rem 1fr; }
}
