/* One product-photo format for the home storefront, catalog and collections. */
:root { --product-photo-ratio: 3 / 4; --product-photo-ground: #ebe8df; }
#products .product-grid,
.catalog-section .product-grid { width: 100%; max-width: 1240px; margin-inline: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
#products .product-card__media,
.product-grid .product-card__image,
.product-grid .product-card__media-shell {
  width: 100%; height: auto; min-height: 0; aspect-ratio: var(--product-photo-ratio);
  overflow: hidden; background: var(--product-photo-ground); border-radius: 16px;
}
#products .product-card__media img,
.product-grid .product-card__image img {
  display: block; width: 100%; height: 100%; object-fit: cover; padding: 0;
  transform: none; background: var(--product-photo-ground);
}
.product-grid [data-card-gallery] { position: relative; touch-action: pan-y; }
#products .product-card__photo { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; color: inherit; }
.product-grid .product-card__media-shell .product-card__image { height: 100%; }
.product-grid .product-card__photo-dots { position: absolute; z-index: 2; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; width: max-content; max-width: calc(100% - 8px); overflow-x: auto; padding: 0 3px; border-radius: 99px; background: rgb(255 253 248 / 90%); scrollbar-width: none; }
.product-grid .product-card__photo-dots::-webkit-scrollbar { display: none; }
.product-grid .product-card__photo-dot { display: grid; place-items: center; flex: 0 0 28px; width: 28px; min-width: 24px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.product-grid .product-card__photo-dot span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; }
.product-grid .product-card__photo-dot[aria-pressed="true"] span { width: 7px; height: 7px; opacity: 1; }
.product-grid .product-card__photo-dot:hover span { opacity: .75; }
.product-grid .product-card__photo-dot:focus-visible, #products .product-card__photo:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.product-grid .product-card__photo-count { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#products .product-card__media::after { display: none; }
#products .product-card:hover .product-card__media img,
.product-grid .product-card:hover .product-card__image img { transform: none; }
/* Search-engine product URLs remain useful, with the same restrained photo scale. */
.product-hero .product-hero__visual { min-height: 0; align-self: start; padding: 24px; background: var(--product-photo-ground); }
.product-hero .product-hero__visual img { position: static; width: min(100%, 360px); height: auto; aspect-ratio: var(--product-photo-ratio); margin-inline: auto; object-fit: cover; }
.product-viewer {
  width: min(1020px, calc(100vw - 40px)); max-width: none;
  height: min(760px, calc(100svh - 48px)); max-height: calc(100svh - 48px);
  padding: 0; overflow: hidden; color: var(--ink); background: var(--porcelain);
  border: 0; border-radius: 28px; box-shadow: var(--shadow);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}
.product-viewer[open] { display: flex; flex-direction: column; animation: none; }
.product-viewer::backdrop { background: rgb(24 31 22 / 58%); backdrop-filter: blur(8px); }
.product-viewer button { cursor: pointer; color: inherit; font: inherit; }
.product-viewer :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.product-viewer ::selection { color: var(--ink); background: var(--sage, #b8c58f); }
.product-viewer .cpt-close {
  position: absolute; z-index: 3; top: 14px; right: 14px;
  width: 44px; height: 44px; display: grid; place-items: center;
  padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--paper);
}
.product-viewer .cpt-close svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.product-viewer .cpt-close:hover { background: var(--product-photo-ground); }
.product-viewer .cpt-scroll { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--ink-soft) var(--porcelain); scrollbar-width: thin; }
.product-viewer .cpt-layout { display: grid; grid-template-columns: 44% minmax(0, 1fr); min-height: 100%; }
.product-viewer .cpt-gallery { position: sticky; align-self: start; top: 0; min-width: 0; padding: 32px 24px 24px; }
.product-viewer .cpt-photo { position: relative; width: min(360px, 100%); aspect-ratio: var(--product-photo-ratio); margin-inline: auto; overflow: hidden; border-radius: 16px; background: var(--product-photo-ground); touch-action: pan-y; }
.product-viewer .cpt-photo img { display: block; width: 100%; height: 100%; object-fit: cover; padding: 0; user-select: none; }
.product-viewer .cpt-photo-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; padding: 24px; text-align: center; color: var(--ink); }
.product-viewer .cpt-photo-empty strong { font-size: 18px; line-height: 1.3; }
.product-viewer .cpt-photo-empty span { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.product-viewer .cpt-gallery-count { position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 12px; color: var(--ink); background: rgb(255 253 248 / 94%); font-size: 12px; line-height: 1.5; font-weight: 600; }
.product-viewer .cpt-thumbs { display: flex; gap: 8px; max-width: 360px; margin: 12px auto 0; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
.product-viewer .cpt-thumbs:empty { display: none; }
.product-viewer .cpt-thumbs button { flex: 0 0 48px; width: 48px; height: 64px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--product-photo-ground); }
.product-viewer .cpt-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-viewer .cpt-thumbs button[aria-pressed="true"] { border: 2px solid var(--ink); }
.product-viewer .cpt-content { min-width: 0; padding: 56px 36px 20px; }
.product-viewer .cpt-category { margin: 0 0 18px; color: var(--ink-soft); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.product-viewer .cpt-content h2 { margin: 0 0 12px; font-family: inherit; font-size: clamp(32px, 3vw, 44px); line-height: 1.04; letter-spacing: -.035em; font-weight: 400; overflow-wrap: anywhere; }
.product-viewer .cpt-price { margin: 16px 0 22px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.product-viewer .cpt-dimensions { display: flex; flex-wrap: wrap; gap: 28px; padding: 14px 0; margin-bottom: 8px; border-block: 1px solid var(--line); }
.product-viewer .cpt-dimensions[hidden] { display: none; }
.product-viewer .cpt-dimensions span, .product-viewer .cpt-dimensions strong { display: block; }
.product-viewer .cpt-dimensions span { font-size: 12px; color: var(--ink-soft); }
.product-viewer .cpt-dimensions strong { margin-top: 4px; font-size: 18px; }
.product-viewer .cpt-facts { margin: 0; font-size: 13px; }
.product-viewer .cpt-facts > div { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.product-viewer .cpt-facts > div[hidden] { display: none; }
.product-viewer .cpt-variant-picker > p { margin: 20px 0 8px; font-size: 14px; font-weight: 700; }
.product-viewer .cpt-facts dt { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.product-viewer .cpt-facts dd { margin: 0; line-height: 1.55; }
.product-viewer .cpt-variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.product-viewer .cpt-variants button { min-height: 64px; min-width: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-size: 12px; overflow-wrap: anywhere; }
.product-viewer .cpt-variants button strong, .product-viewer .cpt-variants button small, .product-viewer .cpt-variants button span { display: block; }
.product-viewer .cpt-variants button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.product-viewer .cpt-variants button:hover { border-color: var(--ink); }
.product-viewer .cpt-details details { border-bottom: 1px solid var(--line); }
.product-viewer .cpt-details summary { display: flex; align-items: center; justify-content: space-between; min-height: 54px; gap: 12px; cursor: pointer; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; list-style: none; }
.product-viewer .cpt-details summary::-webkit-details-marker { display: none; }
.product-viewer .cpt-details summary::after { content: '+'; font-size: 20px; font-weight: 400; }
.product-viewer .cpt-details details[open] summary::after { content: '−'; }
.product-viewer .cpt-details p { margin: 0 0 16px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; white-space: pre-line; }
.product-viewer .cpt-status { margin: 14px 0 0; font-size: 14px; font-weight: 600; }
.product-viewer .cpt-status:empty { display: none; }
.product-viewer .cpt-actions { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; flex: 0 0 auto; padding: 14px 36px 20px calc(44% + 36px); background: var(--porcelain); }
.product-viewer .cpt-actions button { min-height: 54px; border-radius: 99px; padding: 12px 16px; font-size: 13px; font-weight: 750; line-height: 1.35; }
.product-viewer .cpt-actions .cpt-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--paper); background: var(--ink); border: 1px solid var(--ink); }
.product-viewer .cpt-buy span { white-space: nowrap; }
.product-viewer .cpt-buy:hover { background: var(--ink-soft); }
.product-viewer .cpt-buy:disabled { opacity: .6; cursor: not-allowed; }
.product-viewer .cpt-actions .cpt-order { background: transparent; border: 1px solid var(--line); }
.product-viewer .cpt-order:hover { background: var(--product-photo-ground); }
@media (min-width: 1200px) {
  #products .product-grid, .catalog-section .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #products .product-grid, .catalog-section .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 8px; }
  #products .product-card__media, .product-grid .product-card__image { border-radius: 12px; }
  #products .product-card__media img, .product-grid .product-card__image img { padding: 0; }
  .product-grid .product-card__photo-dot { flex-basis: 24px; width: 24px; }
  .product-viewer { width: 100%; height: 100svh; max-height: 100svh; margin: 0; border-radius: 0; }
  .product-viewer .cpt-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
  .product-viewer .cpt-layout { display: block; }
  .product-viewer .cpt-gallery { position: relative; padding: 20px 16px 0; }
  .product-viewer .cpt-photo { width: min(240px, 70vw); }
  .product-viewer .cpt-photo img { padding: 0; }
  .product-viewer .cpt-thumbs { width: min(240px, 70vw); }
  .product-viewer .cpt-content { padding: 22px 20px 18px; }
  .product-viewer .cpt-category { margin-bottom: 12px; }
  .product-viewer .cpt-content h2 { font-size: 30px; line-height: 1.04; }
  .product-viewer .cpt-price { margin: 14px 0 18px; font-size: 20px; }
  .product-viewer .cpt-facts > div { grid-template-columns: 90px 1fr; gap: 12px; }
  .product-viewer .cpt-actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .product-viewer .cpt-actions button { min-height: 52px; padding: 10px 12px; font-size: 12px; }
  .product-viewer .cpt-actions .cpt-buy { flex-wrap: wrap; gap: 4px; justify-content: center; }
}
