/* ==========================================================================
   Outlaw Bullets: product pages (css/pages/product.css), shared by the 18 generated product-<slug>.html.
   Owner: the shop/product builder (with tools/product_template.html).
   Phones: head, photo, the client's words + buy box, then details and prices, shipping, previous/next.
   From 60em: photo with details and prices on the left (6fr); words and buy box on the right (5fr).
   Page-prefixed pieces that might belong in site.css: .product-sub, .product-pager.
   ========================================================================== */

/* --- head: the code, the plain descriptive line, sizing and the starting price --- */
.product-head { padding-bottom: var(--sp-6); }
.product-head .page-head__title--product { margin-bottom: .12em; }
.product-head__desc {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-lede);
  font-weight: 600;
  line-height: 1.4;
}
.product-head__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
}
/* "Sized to .358": a stamped label, the one fact a reloader checks first */
.product-head__sized {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 4px 14px;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  background: var(--paper-hi);
  font: 400 1.75rem/1 var(--f-gothic);
  letter-spacing: .04em;
  white-space: nowrap;
}
.product-head__price { margin: 0; }

/* --- the main block ---
   Phones: .product-main__buy steps aside (display: contents), so its pieces join the main grid and the
   shipping callout can follow the details and prices. From 60em: two columns of about equal height. */
.product-main {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
  padding-block: var(--sp-6) var(--sp-8);
}
.product-main__buy { display: contents; }
.product-main__details { order: 5; margin-top: var(--sp-5); min-width: 0; container-type: inline-size; }
.product-ship { order: 6; margin-top: var(--sp-5); min-width: 0; }
.product-photo { width: min(100%, 27rem); margin-inline: auto; }

@media (min-width: 60em) {
  .product-main {
    grid-template-columns: minmax(0, 32.5rem) minmax(0, 1fr);
    grid-template-areas: "photo buy" "details buy";
    grid-template-rows: auto 1fr;
    gap: var(--sp-7) clamp(40px, 5vw, 88px);
    padding-top: var(--sp-7);
  }
  .product-main__photo { grid-area: photo; }
  .product-main__buy { grid-area: buy; display: grid; gap: var(--sp-5); align-content: start; min-width: 0; }
  .product-main__details { grid-area: details; margin-top: 0; }
  .product-ship { margin-top: var(--sp-5); }
  .product-photo { width: 100%; margin-inline: 0; }
}

/* small section heading inside the page: "Details", "Prices" */
.product-sub {
  margin: 0 0 var(--sp-2);
  font: 400 2rem/1 var(--f-gothic);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.product-specs { margin-bottom: var(--sp-7); }
.product-tiers { margin-bottom: 0; }

/* the client's own words, verbatim, in quotation marks */
.product-desc {
  position: relative;
  margin: 0;
  padding: var(--sp-4) var(--sp-5) var(--sp-4) var(--sp-5);
  background: var(--paper-deep);
  border-left: 6px solid var(--red);
}
.product-desc p {
  margin: 0;
  font-size: var(--fs-lede);
  line-height: 1.5;
  max-width: 34em;
}

.product-ask { margin: 0; }

/* --- shipping callout (partials/shipping.html) --- */
.product-ship .ship-box { max-width: 48rem; }
@media (min-width: 60em) {
  .product-ship .ship-box__boxes { grid-template-columns: minmax(0, 1fr); }   /* one box per row in the column */
}

/* --- previous / next through the store order --- */
.product-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "prev next" "all all";
  gap: var(--sp-3);
  padding: var(--sp-5) 0 var(--section-y);
  border-top: 3px solid var(--ink);
}
.product-pager__slot--prev { grid-area: prev; }
.product-pager__slot--next { grid-area: next; }
.product-pager__all {
  grid-area: all;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--sp-3);
  font-weight: 700;
  text-decoration-color: var(--red-line);
}
.product-pager__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 100%;
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
}
.product-pager__link--next { flex-direction: row; justify-content: flex-end; text-align: right; }
.product-pager__link .icon { flex: none; width: 22px; height: 22px; fill: var(--red); }
.product-pager__link img {
  flex: none;
  width: 64px;
  height: 64px;
  border: 1px solid var(--rule-strong);
}
.product-pager__text { display: grid; min-width: 0; }
.product-pager__label {
  font: 700 var(--fs-label)/1.3 var(--f-text);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
}
.product-pager__name { font: 400 1.625rem/1.05 var(--f-gothic); letter-spacing: .02em; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
  .product-pager__link:hover { background: var(--red-tint); }
  .product-pager__link:hover .product-pager__name { color: var(--red); }
}
/* narrow phones: drop the thumbnails so the codes keep their room */
@media (max-width: 29.99em) {
  .product-pager__link img { display: none; }
  .product-pager__link { padding-inline: var(--sp-2); gap: var(--sp-2); }
}
@media (max-width: 22.49em) {
  .product-pager { grid-template-columns: minmax(0, 1fr); grid-template-areas: "prev" "next" "all"; }
  .product-pager__link--next { justify-content: space-between; }
}
@media (min-width: 48em) {
  .product-pager { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "prev all next"; align-items: center; }
}

@media print {
  .product-pager, .product-ask, .product-ship { display: none; }
}

/* the medium box's capacities: "3,000 × 125/130 gr" on one line */
.product-ship .ship-box__holds { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); }
@media (max-width: 37.49em) {
  .product-desc { padding: var(--sp-3) var(--sp-4); }
  .product-desc p { font-size: var(--fs-body); }
}

/* four tiers: two by two (never three and an orphan); one column where two would not fit "1,200 pieces" */
.picker--tiers .picker__opts:has(> .choice:nth-child(4):last-child) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(10.5rem, calc(50% - var(--sp-2)))), 1fr));
}

/* no-JS note under Add to cart (the GET to cart.html only works with JS on there) */
.buybox__nojs { margin: var(--sp-3) 0 0; font-size: var(--fs-note); line-height: 1.5; }
.js .buybox__nojs { display: none; }
