/* Urweg shop pages: page content styles. The header, menu, cart and pop-ups are in site.css
   (loaded first, shared with the legacy pages). Mobile-first: base = phones. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link-hover); outline-offset: 2px; }
button, select, input { font: inherit; }

.banner { margin: 0; padding: 10px var(--gutter); text-align: center; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--text-strong); }
.banner--preview { background: #2a2410; color: var(--accent); font: 14px var(--font-ui); }

/* ---- Main */
main { max-width: 1120px; margin: 0 auto; padding: 8px var(--gutter) 48px; }
.page-h1 { text-align: center; text-wrap: balance; color: var(--text-strong); font-size: 1.45rem; line-height: 1.25; margin: 16px auto 20px; }
/* a comma-separated part of a heading, or a link in the words below it, is never split across two lines */
.header-text a, .section-intro a { display: inline-block; max-width: 100%; }
.prose { max-width: 70ch; margin: 0 auto; }
/* Photos inside text sit side by side when there are several in a row */
.prose { text-align: center; }
.prose p, .prose ul, .prose h3 { text-align: left; }
.prose-photo { display: inline-block; vertical-align: top; margin: 8px 4px; max-width: 100%; }
.prose-photo img { max-height: 360px; width: auto; margin: 0 auto; border-radius: 6px; }
.prose-photo figcaption { color: var(--muted); font-size: 14px; margin-top: 4px; }
.header-text { margin-bottom: 24px; }
/* the words under the heading: centred, as wide as the cards, the same size as the Home page's welcome text */
.header-text { max-width: none; }
.header-text, .header-text p { text-align: center; font-size: var(--header-text); line-height: var(--header-leading); text-wrap: pretty; }
.header-text p { margin: 0; }

/* Ring size system picker */

/* Sections within a page */
.section-title {
  text-align: center; color: var(--text-strong); font-size: 1.3rem;
  margin: 32px auto 16px; padding-top: 20px; border-top: 1px solid var(--line);
}
.section-title.is-first { margin-top: 8px; padding-top: 0; border-top: 0; }
/* A page category without a heading ("Uncategorized"): just the divider line the headings have */
.section-divider { border: 0; border-top: 1px solid var(--line); margin: 32px 0 20px; }
.section-title { scroll-margin-top: 16px; }
.section-intro { margin: -6px auto 18px; text-align: center; color: var(--muted); font-size: var(--header-text); line-height: var(--header-leading); }
.product-grid + .product-grid { margin-top: 16px; }
/* an item with no photo yet */
.product__noimage { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; box-sizing: border-box; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: #000; color: var(--muted); text-align: center; font-size: 1.05rem; font-style: italic; }

/* ---- Items: one column on phones */
.product-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px 16px; grid-template-columns: 1fr; }
.product {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center; scroll-margin-top: 16px;
}
/* Cards in the same row share four row heights: photo · thumbnails · text · price + buying.
   So photos, names and Add to cart buttons line up across the row, and a row only grows where a card needs it. */
@supports (grid-template-rows: subgrid) {
  .product { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 8px; }
}
.product:target { border-color: var(--link); }
.product__photo { display: contents; } /* photo + thumbnails: grouped only in the wide layout below */

/* The photo box: same shape on every card. The photo is scaled to fit inside it on both sides
   (a tall photo fills the height, a wide one fills the width) and is never cropped. */
.product__media { position: relative; aspect-ratio: 4 / 3; max-width: 100%; background: #000; border-radius: 8px; overflow: hidden; }
/* The photo is a button: click to open it large */
.product__zoom { position: absolute; inset: 0; padding: 0; border: 0; background: none; cursor: default; }
/* the pop-up is for 2- and 3-column layouts; phones already show the photo full width */
@media (min-width: 560px) { .product__zoom { cursor: zoom-in; } }
.product__zoom:focus-visible { outline: 2px solid var(--link-hover); outline-offset: -2px; }
/* --photo-scale (Photos > Size in the card): shows a small piece smaller than its neighbours, in the same box */
.product__media img {
  position: absolute; inset: 0; margin: auto; max-width: none; object-fit: contain;
  width: calc((100% - 20px) * var(--photo-scale, 1)); height: calc((100% - 20px) * var(--photo-scale, 1));
}
/* Extra photos: their own row under the box, never on top of the photo */
.product__thumbs-row { min-width: 0; }
.product__thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.product__thumbs::-webkit-scrollbar { display: none; }
.product__thumbs > :first-child { margin-left: auto; }
.product__thumbs > :last-child { margin-right: auto; }
.thumb { flex: none; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #000; cursor: pointer; width: 56px; height: 44px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover, .thumb:focus-visible { border-color: var(--text-strong); }

/* Text on top; price, stock note and buying controls stay together at the bottom */
.product__body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.product__purchase { display: grid; gap: 10px; align-content: end; min-width: 0; margin-top: auto; }

.badge { position: absolute; top: 8px; left: 8px; z-index: 1; font: bold 12px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px; }
.badge--new { background: var(--accent); color: #000; }
.badge--sold { background: #555; color: #fff; }
.badge--inline { position: static; display: inline-block; vertical-align: middle; margin-left: 10px; }
.badge--mto { background: #000; color: var(--accent); border: 1px solid var(--accent); }
/* sold: the whole card is greyed out (the "Sold" label stays) */
.is-sold { opacity: .6; filter: grayscale(1); }

.product__name { margin: 4px 0 0; font-size: 1.3rem; line-height: 1.25; color: var(--text-strong); }
.product__details { margin: 0; }
.product__sizes { margin: 0; color: var(--muted); }
.product__notice { margin: 0; color: var(--accent); font-style: italic; }
.product__text { font-size: .95rem; text-align: left; }
.product__text p { margin: 0 0 .7em; }
.product__text p:last-child { margin-bottom: 0; }

.product__prices { list-style: none; margin: 4px 0 0; padding: 0; }
.product__prices li { display: flex; align-items: baseline; gap: 6px; text-align: left; }
.product__prices .dots { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line); transform: translateY(-4px); }
.product__prices strong { color: var(--text-strong); font-size: 1.1rem; white-space: nowrap; }
.product__price, .product__soldnote, .product__order { margin: 4px 0 0; }
.product__stock { margin: 0; color: var(--muted); font: 14px var(--font-ui); }
.product__stock--mto { color: var(--accent); }

/* ---- Buy form */
/* Add to cart: a button, not a bar across the card */
.buy .btn--primary { justify-self: center; width: auto; min-width: 190px; padding-inline: 32px; }
.field__error { margin: 2px 0 0; color: var(--danger); font: 600 14px var(--font-ui); }
.field.has-error select, .field.has-error input[type='text'] { border-color: var(--danger); }
.buy { display: grid; gap: 10px; text-align: left; font: 16px var(--font-ui); }
.field { display: grid; gap: 4px; }
.field > span { color: var(--muted); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; flex: none; }
select, input[type='text'] {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px; /* 16px stops iOS zooming in */
  background: var(--surface-2); color: var(--text-strong);
  border: 1px solid var(--line); border-radius: 6px;
}
select:invalid { color: var(--muted); }
/* sizes in stock in the size menu (Chrome, Firefox and Edge colour menu items; iPhones show the text only) */
select option.is-instock { color: var(--accent); font-weight: 600; }
.notices { max-width: 70ch; margin: 32px auto 0; text-align: center; color: var(--muted); }
.notices p { margin: .4em 0; }
.page-more { margin-top: 28px; }
.thanks { max-width: 60ch; margin: 0 auto; text-align: center; }

/* ---- Larger phones / small tablets: two columns (small cards: three) */
@media (min-width: 560px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
  .product-grid--small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 14px; }
}

/* ---- Tablets and up */
@media (min-width: 768px) {
  body { font-size: 17px; }
  .page-h1 { font-size: 2rem; margin: 20px auto 28px; }
  .section-title { font-size: 1.6rem; margin-top: 40px; padding-top: 24px; }
  .product__name { font-size: 1.4rem; }
}

/* ---- Desktop: three columns */
@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid--small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .product-grid--large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* small cards: tighter padding and type so four fit across */
  .product-grid--small .product { padding: 12px; }
  .product-grid--small .product__name { font-size: 1.15rem; }
}

/* ---- Wide cards (Bracelets, Brooches, Pendants, Torcs, Necklaces, Pouches): one card per row, the big photo on the left,
   everything else on the right. Phones keep the stacked card. */
@media (min-width: 700px) {
  .product-grid--wide { grid-template-columns: 1fr; gap: 32px; }
  .product-grid--wide .product {
    grid-row: auto; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 28px; row-gap: 14px; align-items: start; text-align: left; padding: 20px;
  }
  .product-grid--wide .product__photo { display: grid; gap: 8px; grid-column: 1; grid-row: 1 / span 2; align-self: start; min-width: 0; }
  .product-grid--wide .product__body { grid-column: 2; grid-row: 1; align-content: start; }
  .product-grid--wide .product__purchase { grid-column: 2; grid-row: 2; align-self: end; margin-top: 0; }
  .product-grid--wide .product__thumbs > :first-child { margin-left: 0; }
  .product-grid--wide .product__text { max-width: none; }
  .product-grid--wide .product__text.prose, .product-grid--wide .prose p { text-align: left; }
  .product-grid--wide .buy .btn--primary { justify-self: start; }
  .product-grid--wide .product__name { font-size: 1.5rem; }
}

/* ---- "Previous work" (Horns): the Home page's framed panel, big photos spread out, the footer's knot-and-line between pieces */
main:has(.showcase-panel) { max-width: 1166px; }
.showcase-panel {
  margin-top: 24px; padding: 20px 64px 40px; background: #000;
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .015), 0 18px 50px rgba(0, 0, 0, .55);
}
.showpiece { display: grid; gap: 16px; justify-items: center; text-align: center; }
.showrule { width: 100%; margin: 34px 0 8px; }
.showrule img { background: #000; }
.showpiece__name { margin: 0; color: var(--text-strong); font-size: 1.6rem; line-height: 1.2; }
.showpiece__photos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; width: 100%; }
.showpiece__photo { padding: 0; border: 0; background: none; cursor: default; max-width: 100%; }
@media (min-width: 560px) { .showpiece__photo { cursor: zoom-in; } }
.product__zoom.is-nozoom, .showpiece__photo.is-nozoom { cursor: default; } /* Photo zoom off for the page */
.showpiece__photo img { width: auto; height: 230px; max-width: 100%; object-fit: contain; border-radius: 6px; }
.showpiece__photo.is-lead { flex: 1 1 100%; }
.showpiece__photo.is-lead img { height: auto; max-height: 560px; width: auto; margin: 0 auto; }
.showpiece__text { max-width: 62ch; }
.showpiece__text p { text-align: center; }
@media (max-width: 700px) {
  main:has(.showcase-panel) { padding-inline: 0; }
  .showcase-panel { border: 0; border-radius: 0; box-shadow: none; padding: 8px 14px 24px; }
  .showpiece__photo img { height: 150px; }
}
