/* PGR "noir" theme: near-black ground (#FFFFFF) with metallic gold (#8A6508 / #C59B27).
   Loaded last on every page. It re-points the colour variables the older stylesheets use,
   then fixes the places where they hard-code light colours. */
html body {
  --noir: #FFFFFF !important;
  --noir-raised: #FFFFFF !important;
  --noir-deep: #FFFFFF !important;
  --noir-line: #E6DEC8 !important;
  --noir-text: #141619 !important;
  --noir-muted: #4A5568 !important;
  --noir-gold: #8A6508 !important;
  --noir-gold-soft: #C59B27 !important;

  --bg: var(--noir) !important; --ivory: var(--noir) !important; --cream: var(--noir) !important; --pine: var(--noir) !important;
  --surface: var(--noir-raised) !important; --panel: var(--noir-raised) !important; --paper: var(--noir-raised) !important;
  --panel-deep: var(--noir-deep) !important; --sand: var(--noir-deep) !important;
  --ink: var(--noir-text) !important; --charcoal: var(--noir-text) !important;
  --muted: var(--noir-muted) !important; --soft-text: var(--noir-muted) !important;
  --line: var(--noir-line) !important; --soft-line: var(--noir-line) !important;
  --gold: var(--noir-gold) !important; --gold-text: var(--noir-gold) !important; --antique-gold: var(--noir-gold) !important;
  --gold-ink: var(--noir) !important;
  --accent: linear-gradient(115deg, #C59B27, #8A6508) !important;
  --gold-fill: linear-gradient(115deg, #C59B27, #8A6508) !important;
  --shadow: 0 16px 36px #00000066 !important;

  color-scheme: dark !important;
  background: var(--noir) !important;
  color: var(--noir-text) !important;
  font-family: Tajawal, system-ui, Tahoma, Arial, sans-serif;
}
html { background: #FFFFFF; }
html body :is(h1, h2, h3, h4) { color: #ffffff; }
html body a { color: var(--noir-gold-soft); }
html body a:hover { color: #ffffff; }
html body :is(input, select, textarea) {
  background: var(--noir); color: #ffffff; border-color: #6b6450;
}
html body ::placeholder { color: #8f8974; }
html body :focus-visible { outline: 3px solid var(--noir-gold-soft); outline-offset: 2px; }

/* ---- Surfaces that older stylesheets paint with fixed light colours ---- */
html body :is(.card, .step, details, .spot-strip, .spot-tile, .brand-tile, .how, .quote-request, .panel,
  .metal-pending, .price-box, .summary, .details, .catalog-placeholder, .card-art, .faq, .refinery-nav,
  .institutional-why, .institutional-manufacturers, .metal-categories, .product-estimate, .pgr-policy,
  dialog, .pgr-analytics-consent, table, th, td, .filters, .catalog-specs, .specs, .quantity, .gallery, figure) {
  background-color: var(--noir-raised) !important;
  color: var(--noir-text) !important;
  border-color: var(--noir-line) !important;
  box-shadow: none !important;
}
html body :is(.how, .quote-request, .faq, .refinery-nav, .institutional-why, .institutional-manufacturers,
  .metal-categories, .pgr-policy, .filters, .catalog-specs, .specs, .quantity, .summary, .details, .gallery,
  .product-estimate, figure, th, td, table) {
  background-color: transparent !important;
}
html body :is(.spot-strip, section.how) { background-color: var(--noir-raised) !important; }
html body :is(.card, .step, details, .spot-tile, .brand-tile, .panel, .price-box, dialog) { border-radius: 20px; }
html body :is(p, li, dd, dt, small, label, span, time, summary, figcaption, legend, th, td, bdi, strong, em) { color: inherit; }
html body :is(.estimate-note, .estimate-iraq, .spot-time, small, .pgr-verify-note, dt, figcaption) { color: var(--noir-muted) !important; }
html body :is(.spot-value, .estimate-value, .price) { color: var(--noir-gold) !important; }
html body :is(h1, h2, h3, h4, summary, legend, .estimate-label) { color: #ffffff !important; }

/* ---- Links, chips and status pills ---- */
html body :is(a.source-link, .card-image-action, .tags span, .catalog-source, .quote-link, .catalog-detail) {
  background-color: transparent !important;
  color: var(--noir-gold-soft) !important;
  border-color: var(--noir-line) !important;
}
html body .spot-status { background-color: transparent !important; color: var(--noir-muted) !important; border-color: var(--noir-line) !important; }
html body .spot-status[data-status="live"] { color: #7fd3a4 !important; }
html body .spot-status[data-status="stale"], html body .spot-status[data-status="unavailable"] { color: #f0b36a !important; }
html body a.skip-link { background: var(--noir-gold) !important; color: var(--noir) !important; }

/* ---- Buttons: gold pill as the primary action, outline for the rest ---- */
html body :is(button, .button, a.button, input[type="submit"]) {
  background: var(--noir-gold) !important;
  color: var(--noir) !important;
  border: 1px solid var(--noir-gold) !important;
  border-radius: 999px !important;
  font-family: inherit;
  font-weight: 700;
}
html body :is(button, .button, a.button):hover { background: var(--noir-gold-soft) !important; border-color: var(--noir-gold-soft) !important; }
html body :is(.secondary, button.secondary, a.secondary, .pgr-catalog-add, .pgr-menu-toggle, #open-cart, .pgr-analytics-settings,
  .pgr-analytics-consent button:not(:first-of-type), [aria-pressed="false"]) {
  background: transparent !important;
  color: var(--noir-gold) !important;
  border: 1px solid var(--noir-gold) !important;
}

/* ---- Form fields ---- */
html body :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="submit"]) {
  background-color: var(--noir) !important;
  color: #ffffff !important;
  border: 1px solid #6b6450 !important;
  border-radius: 12px;
}

/* ---- Muted text that older sheets colour for a light page ---- */
html body :is(.spec, .showcase-brand, .subtle, .spot-note, .tags, .catalog-specs dt, .specs dt, .card p, .step p, details p,
  .pgr-footer-note, .estimate-note) { color: var(--noir-muted) !important; }
html body :is(.card, .step, details, .panel, .price-box) :is(strong, dd, bdi) { color: var(--noir-text) !important; }
html body :is(.spot-value, .estimate-value) bdi, html body .estimate-value { color: var(--noir-gold) !important; }

/* ---- Product photos: many are shot on white, so they sit in a deliberate light tile ---- */
html body :is(.card-art, .photo, .gallery, figure) img { background: #ffffff; border-radius: 14px; }
html body :is(.card-art, .photo) { background-color: var(--noir-raised) !important; }

/* ---- Consent banner ---- */
html body .pgr-analytics-consent :is(p, span, a) { color: var(--noir-text) !important; }
html body .pgr-analytics-consent { border: 1px solid var(--noir-line) !important; }

/* ---- Catalogue grid, product spec rows, strips ---- */
html body :is(.grid > article, #catalog > article, article, aside, .preview-strip, .institutional-trust, dl.specs > div, dl.catalog-specs > div) {
  background-color: var(--noir-raised) !important;
  color: var(--noir-text) !important;
  border-color: var(--noir-line) !important;
  box-shadow: none !important;
}
html body :is(dl.specs > div, dl.catalog-specs > div) { background-color: transparent !important; }
html body :is(.grid > article, #catalog > article) { border-radius: 20px; overflow: hidden; }
html body article :is(h2, h3), html body article :is(h2, h3) a { color: #ffffff !important; }
html body :is(dl.specs, dl.catalog-specs) dt { color: var(--noir-muted) !important; }
html body :is(dl.specs, dl.catalog-specs) dd, html body :is(dl.specs, dl.catalog-specs) dd bdi { color: var(--noir-text) !important; }
html body :is(.tags span, .institutional-trust :is(span, bdi), .price-box p, .links small, .body > p) { color: var(--noir-muted) !important; }
html body div.price { color: var(--noir-muted) !important; background: transparent !important; }

/* ---- Text links styled as light buttons in the older sheets ---- */
html body :is(.links > a, .refinery-nav nav a, .pgr-analytics-actions a, .subtle a, .metal-categories a, .brand-tile) {
  background-color: transparent !important;
  color: var(--noir-gold-soft) !important;
  border: 1px solid var(--noir-line) !important;
}
html body .refinery-nav nav a { border-radius: 999px; }
html body .refinery-nav nav a:hover, html body .links > a:hover { border-color: var(--noir-gold) !important; color: #ffffff !important; }
html body .pgr-catalog-add { color: var(--noir-gold) !important; }
html body .metal-categories { background-color: var(--noir-raised) !important; border: 1px solid var(--noir-line) !important; border-radius: 16px; }

/* ---- Verify page: result boxes keep their own light, colour-coded look ---- */
html body .pgr-verify-result :is(h2, p, dt, dd, a, bdi) { color: inherit !important; }
html body .pgr-verify-result dl > * { background: transparent !important; }

/* ---- Homepage 3D hero (assets/hero3d.js). The static scene shows until the canvas has drawn. ---- */
html body.edition-home section.pgr-scene-hero,
html body.edition-home > header.pgr-store-header,
html body.edition-home .pgr-store-header nav { background: #FFFFFF !important; }
.pgr-bullion-scene { position: relative; }
.pgr-bullion-scene .pgr-3d { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.9s ease; }
.pgr-bullion-scene .pgr-3d.is-ready { opacity: 1; pointer-events: auto; }
.pgr-bullion-scene.has-3d { min-height: clamp(360px, 42vw, 540px); }
.pgr-bullion-scene.has-3d > .pgr-scene-brand { display: none !important; }
.pgr-3d canvas { display: block; width: 100%; height: 100%; border-radius: 24px; touch-action: pan-y; }
.pgr-3d-picker { position: absolute; inset-inline: 0; bottom: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
html body .pgr-3d-picker button {
  min-height: 44px; padding: 8px 18px; font-size: 13px; letter-spacing: 0.08em;
  background: rgba(11, 13, 16, 0.55) !important; color: #C59B27 !important; border: 1px solid rgba(212, 175, 55, 0.45) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer;
}
html body .pgr-3d-picker button[aria-pressed="true"] { background: #8A6508 !important; color: #FFFFFF !important; border-color: #8A6508 !important; }
.pgr-3d-card {
  position: absolute; top: 16px; inset-inline-start: 16px; width: min(290px, calc(100% - 32px)); box-sizing: border-box;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; text-align: start;
  background: rgba(20, 17, 10, 0.58); border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 20px;
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); color: #141619;
}
.pgr-3d-card[hidden] { display: none; }
.pgr-3d-card[dir], .pgr-bullion-scene[dir="ltr"] .pgr-3d-card { direction: inherit; }
.pgr-3d-brand { color: #4A5568; font-size: 13px; letter-spacing: 0.06em; }
.pgr-3d-name { color: #ffffff; font-size: 18px; line-height: 1.4; }
.pgr-3d-card dl { margin: 4px 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 14px; }
.pgr-3d-card dt { color: #4A5568; }
.pgr-3d-card dd { margin: 0; font-weight: 700; color: #141619; }
.pgr-3d-price-label { color: #4A5568; font-size: 13px; }
.pgr-3d-price { color: #8A6508; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pgr-3d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; }
html body .pgr-3d-actions :is(.pgr-catalog-add, .pgr-3d-primary) {
  min-height: 44px; padding: 9px 18px; display: inline-flex; align-items: center; border-radius: 999px; text-decoration: none; font-weight: 800; cursor: pointer;
  background: #8A6508 !important; color: #FFFFFF !important; border: 1px solid #8A6508 !important;
}
html body .pgr-3d-link { color: #C59B27 !important; padding: 10px 0; font-size: 14px; }
@media (max-width: 760px) {
  .pgr-bullion-scene.has-3d { min-height: 420px; }
  .pgr-3d-card { top: 10px; inset-inline-start: 10px; width: min(250px, calc(100% - 20px)); padding: 14px 16px; }
  .pgr-3d-price { font-size: 20px; }
}

/* ---- Homepage hero: real product photographs in a simple row ---- */
.pgr-real-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.pgr-real-photos .pgr-scene-brand { position: relative; display: block; border-radius: 18px; overflow: hidden; background: #ffffff; border: 1px solid #E6DEC8; aspect-ratio: 4 / 5; }
.pgr-real-photos .pgr-scene-brand img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 10px; box-sizing: border-box; }
.pgr-real-photos .pgr-scene-label { position: absolute; inset-inline: 0; bottom: 0; padding: 10px 12px; background: rgba(11,13,16,0.82); color: #C59B27; font-size: 14px; text-align: center; }
.pgr-real-photos .pgr-scene-brand:nth-child(2) { transform: translateY(-18px); }
@media (max-width: 640px) { .pgr-real-photos { grid-template-columns: 1fr; } .pgr-real-photos .pgr-scene-brand:nth-child(2) { transform: none; } }

/* ---- Real-photo hero: drop the old stage backdrop, show the three bars large ---- */
.pgr-real-photos { background: none !important; min-height: 0 !important; height: auto !important; padding: 0 !important; }
.pgr-real-photos .pgr-scene-brand { aspect-ratio: 1 / 1; border-radius: 22px; }
.pgr-real-photos .pgr-scene-brand img { padding: 18px; }
.pgr-real-photos .pgr-scene-label { font-size: 15px; padding: 12px; }
.pgr-real-photos .pgr-scene-brand:nth-child(2) { transform: none; }
html body.edition-home section.pgr-scene-hero .wrap { min-height: 0 !important; }

/* ---- Homepage banner (approved): one full-width image, no duplicate copy ---- */
html body .hero-banner { padding: 24px 0 8px; border: 0; background: #05070b; }
html body .hero-banner .wrap { max-width: 1280px; padding: 0 16px; }
html body .hero-banner img { width: 100%; height: auto; display: block; border-radius: 18px; }
