/* That Brand "palace": shop / collection + product page layer. Ported from the mock's collection.html and product.html
   (everything after the shared base block now living in palace.css). Scoped so it never leaks onto the home grid. */

/* ---------- collection: giant heading (.pg-head), sticky bar, four-across grid ---------- */
.shop { padding: 0 var(--gap) 8px; }
.shop .bar { position: sticky; top: 64px; z-index: 5; background: var(--white); padding-top: 12px; border-top: 2px solid var(--ink); }
body.admin-bar .shop .bar { top: 110px; }
.bar .filters a { padding: 0 0 3px; font: inherit; letter-spacing: inherit; text-transform: uppercase; text-decoration: none; color: var(--grey); border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.bar .filters a:hover { color: var(--ink); }
.bar .filters a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.more .bar .filters a { padding: 0; border: 0; color: var(--ink); }
.shop .grid { grid-template-columns: repeat(4, 1fr); padding-top: 18px; }
.item .tile img { transform: scale(var(--z, 1)); transform-origin: var(--o, 50% 50%); }
.item:hover .tile img { transform: scale(calc(var(--z, 1) * 1.03)); }
.shop .item .name { font-size: 24px; }
.item .price del { color: var(--grey); }
.item .price ins { text-decoration: none; }
.none { margin: 40px 6px 22px; font-family: var(--display); font-weight: 900; letter-spacing: -.045em; font-size: clamp(30px, 4vw, 56px); line-height: 1; }
.none span { color: #6b685f; }
.none-wrap { padding: 0 6px 40px; }
.none-wrap .btn { margin-top: 6px; }

/* paging: previous / page n of N / next, in the bar's voice */
.pager { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 6px 28px; border-top: 1px solid var(--line); text-transform: uppercase; font-size: 12px; }
.pager a { text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid var(--ink); transition: color .15s, border-color .15s; }
.pager a:hover { color: var(--grey); border-bottom-color: var(--grey); }
.pager .of { color: var(--grey); }

/* WooCommerce notices, hard-edged */
.woocommerce-notices-wrapper { margin: 0; }
.woocommerce-error, .woocommerce-message, .woocommerce-info { list-style: none; margin: 0 0 18px; padding: 14px 16px 13px; border: 1px solid var(--ink); background: var(--white); font-size: 12px; text-transform: uppercase; line-height: 1.6; overflow: hidden; }
.woocommerce-message .button, .woocommerce-info .button { float: right; margin-left: 12px; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) { .shop .grid { grid-template-columns: repeat(2, 1fr); } .shop .bar { top: 108px; } body.admin-bar .shop .bar { top: 154px; } }
@media (max-width: 600px) {
  .shop .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .shop .item .name { font-size: 18px; }
  .shop .item .meta { flex-wrap: wrap; gap: 4px 12px; }
  .bar .filters { gap: 6px 14px; }
}

/* ---------- product page: photographs stack on the right and scroll past; the buy panel stays in view on the left ---------- */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding: var(--gap); align-items: start; }
.gwrap { position: relative; }
.gallery { display: flex; flex-direction: column; gap: var(--gap); }
.slide { position: relative; margin: 0; height: calc(100svh - 2 * var(--gap)); background: var(--ink); overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide:first-child img { object-position: 50% 30%; }
/* the counter rides along the bottom of the screen while the photographs scroll (zero-height sticky anchor) */
.g-count { position: sticky; top: calc(100svh - 74px); z-index: 3; height: 0; }
.g-count span { position: absolute; left: 22px; top: 0; display: flex; align-items: center; gap: 14px; padding: 16px 18px 15px; background: var(--ink); color: var(--white); font-size: 12px; line-height: 1; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.g-count .bar2 { display: block; position: relative; width: 84px; height: 2px; background: #4a483f; }
.g-count .bar2 i { position: absolute; inset: 0 auto 0 0; background: var(--white); width: 33.3%; transition: width .5s var(--ease); }
.buy { position: sticky; top: var(--gap); height: calc(100svh - 2 * var(--gap)); display: flex; flex-direction: column; padding: 84px 6% 24px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.buy > .inner { width: 100%; max-width: 440px; margin-inline: auto; margin-block: auto; }
.crumbs { margin: 0 0 26px; font-size: 11px; text-transform: uppercase; color: var(--grey); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }
.eyebrow { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; }
.eyebrow a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.buy h1 { margin: 0; font-family: var(--display); font-weight: 900; letter-spacing: -.04em; font-size: clamp(34px, 3.8vw, 56px); line-height: 1.02; }
.buy .price { margin: 14px 0 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.buy .price del { color: var(--grey); }
.buy .price ins { text-decoration: none; }
.tbp-form { margin: 0; }
fieldset.opt { border: 0; padding: 0; margin-inline: 0; margin-bottom: 0; min-width: 0; }
.opt { margin-top: 26px; }
.opt .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 12px; text-transform: uppercase; }
.opt .row legend { padding: 0; }
.opt .row a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.opt .row .val { color: var(--grey); }
.swatches, .sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.swatch, .size { position: relative; }
.swatch input, .size input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 40px; height: 40px; background: var(--ink); outline: 1px solid var(--line); outline-offset: 3px; }
.swatch input:checked + span, .swatches > .swatch:only-child span { outline-color: var(--ink); }
.size span { display: grid; place-items: center; min-width: 52px; height: 44px; padding: 0 10px; border: 1px solid var(--line); font-size: 12px; text-transform: uppercase; transition: border-color .15s, background .15s, color .15s; }
.size input:hover + span { border-color: var(--ink); }
.size input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.size input:focus-visible + span, .swatch input:focus-visible + span { outline: 3px solid currentColor; outline-offset: 3px; }
.size.is-out span { color: #a39f93; text-decoration: line-through; }
.size input:disabled { cursor: not-allowed; }
.add { display: block; width: 100%; margin-top: 30px; padding: 20px 22px 19px; background: var(--ink); color: var(--white); text-align: center; text-transform: uppercase; font-weight: 700; font-size: 12px; letter-spacing: .08em; line-height: 1; transition: background .15s, transform .15s var(--ease); }
.add:hover { background: #34322a; transform: translateY(-2px); }
.add:active { transform: translateY(0); }
.add:disabled { background: var(--tile); color: #6f6c62; cursor: not-allowed; transform: none; }
.add u { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.note-line { margin: 14px 0 0; font-size: 12px; text-transform: uppercase; color: var(--grey); }
.copy { margin: 28px 0 0; font-size: 13px; line-height: 1.7; }
.copy p { margin: 0 0 14px; }
.acc { margin-top: 28px; border-top: 2px solid var(--ink); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 15px; list-style: none; cursor: pointer; text-transform: uppercase; font-size: 12px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 16px; line-height: 1; }
.acc details[open] summary::after { content: "\2212"; }
.acc details > div { padding: 0 0 18px; font-size: 13px; line-height: 1.7; max-width: 46ch; }
.more { padding: 56px var(--gap) 0; }
.more .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  /* phones and tablets: photographs first as a swipe strip, then the details */
  .pdp { grid-template-columns: 1fr; }
  .gwrap { order: -1; }
  .gallery { flex-direction: row; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .gallery::-webkit-scrollbar { display: none; }
  .slide { flex: 0 0 100%; height: 78svh; min-height: 420px; scroll-snap-align: start; }
  .g-count { position: absolute; top: auto; bottom: 12px; left: 12px; height: auto; }
  .g-count span { position: static; }
  .buy { position: static; height: auto; overflow: visible; padding: 36px 14px 40px; }
  .buy > .inner { margin-block: 0; }
  .crumbs { margin-bottom: 28px; }
  .more .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .more .grid { gap: 10px; }
  .more .item .meta { flex-wrap: wrap; column-gap: 8px; }
  .more .item .name { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .g-count .bar2 i { transition: none; } }
