/* =============================================================
   Catalog product photos + product view — Rajasthan Marble World
   ============================================================= */

/* ===================== CARD ===================== */
button.stone-card-img {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
}

.stone-card-swatch {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
}
.stone-card-swatch img { width: 100%; height: 100%; object-fit: cover; }
.stone-card:hover .stone-card-swatch img { transform: none; }

.stone-card-name button {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.stone-card-name button:hover { color: var(--em-800); }

.stone-card-code { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ===================== PRODUCT VIEW ===================== */
.product-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;            /* the global reset zeroes <dialog>'s centring margin */
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.product-dialog::backdrop { background: rgba(1, 30, 18, 0.72); }

.product {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  padding: 28px;
}
.product > * { min-width: 0; }

.product-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.product-close:hover { border-color: var(--em-900); }

.product-stage {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--em-950);
}
.product-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-stage figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(1, 30, 18, 0.72);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
}

.product-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.product-thumbs button {
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--em-50);
  cursor: pointer;
}
.product-thumbs button[aria-current="true"] { border-color: var(--em-900); }
.product-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-info { padding-top: 8px; }
.product-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 10px;
}
.product-code {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--em-100);
  color: var(--em-900);
  font: 600 13px/1 ui-monospace, Menlo, monospace;
}
.product-price {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--em-900);
}
.product-price small { font-size: 14px; font-weight: 600; color: var(--muted); }

.product-specs { margin: 18px 0 22px; font-size: 14px; }
.product-specs div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.product-specs dt { color: var(--muted); }
.product-specs dd { margin: 0; }

.product-cta { width: 100%; justify-content: center; }
.product-more { margin-top: 16px; font-size: 14px; }
.product-note { margin-top: 12px; font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .product-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
    overflow-x: hidden;
  }
  .product { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px 16px 28px; }
  .product-close { top: 24px; right: 24px; background: rgba(255, 255, 255, 0.92); }
  .product-specs div { grid-template-columns: 84px minmax(0, 1fr); }
  .product-name { font-size: 26px; }
  .product-thumbs { gap: 6px; }
}
