/* CKS Northline - single product (approved canvas Product.dc.html). Mobile-first.
   The add-to-cart form is WooCommerce's own markup (plus plugin output); rules here
   restyle it and are scoped to .cks-product so cart/checkout stay untouched. */
.cks-product { padding-top: 14px; }
.cks-product-notices:empty { display: none; }
.cks-product-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

/* gallery: native scroll-snap, no slider library */
.cks-gallery { min-width: 0; }
.cks-gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; border-radius: 20px; background: #F1F0E9; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cks-gallery-track::-webkit-scrollbar { display: none; }
.cks-gallery-track:focus-visible { outline: 2px solid #246B4E; outline-offset: 3px; }
.cks-gallery-slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.cks-gallery-slide a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.cks-gallery-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.cks-gallery-slide.is-fill img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; } /* 4:3 photo in the 4:3 box: it fills it */
/* with JS on, slides 2+ stay out of layout (so the browser does not fetch them) until the inline script in single-product.php marks the gallery live */
.cks-js .cks-gallery:not(.is-live) .cks-gallery-slide + .cks-gallery-slide { display: none; }
.cks-gallery-nav { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.cks-gallery-nav button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #C9C7BE; cursor: pointer; overflow: hidden; }
.cks-gallery-nav button[aria-current] { background: var(--cks-spruce); }
.cks-gallery-nav img { display: none; }

/* summary */
.cks-product-summary { min-width: 0; }
.cks-product-cats { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: #51635A; }
.cks-product-cats a { color: #51635A; text-decoration: none; }
.cks-product-cats a:hover { color: var(--cks-spruce); text-decoration: underline; }
.cks-product-title { margin: 0 0 10px; font-size: 27px; font-weight: 800; letter-spacing: -.4px; line-height: 1.1; }
.cks-product .cks-product-summary > .price { margin: 0 0 10px; font-family: var(--cks-font-display); font-size: 21px; font-weight: 700; color: var(--cks-spruce); }
.cks-product .price del { color: #7E858B; font-weight: 500; margin-right: 6px; }
.cks-product .price ins { text-decoration: none; }
.cks-product .woocommerce-product-details__short-description { font-size: 14.5px; line-height: 1.55; color: #51635A; }
.cks-product .woocommerce-product-details__short-description p { margin: 0 0 10px; }

/* add-to-cart form (WooCommerce markup) */
.cks-product form.cart { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid #E3E1D9; }
.cks-product table.variations, .cks-product table.variations tbody, .cks-product table.variations tr, .cks-product table.variations th, .cks-product table.variations td { display: block; width: auto; padding: 0; border: 0; margin: 0; text-align: left; background: none; line-height: inherit; }
.cks-product table.variations { margin-bottom: 4px; }
.cks-product table.variations th.label { margin-bottom: 9px; }
.cks-product table.variations label { font-size: 14px; font-weight: 700; color: var(--cks-spruce); }
.cks-product form.cart select { width: 100%; max-width: 360px; min-height: 46px; margin: 0; padding: 0 36px 0 14px; border: 1.5px solid #E3E1D9; border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316251E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; appearance: none; -webkit-appearance: none; font: 600 14px var(--cks-font-body); color: var(--cks-spruce); }
.cks-product .reset_variations { display: inline-block; margin-top: 8px; font-size: 12.5px; color: #51635A; }
/* size buttons (built by main.js from the select; the select stays the source of truth) */
.cks-sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; }
.cks-size { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 56px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid #E3E1D9; background: #fff; font-family: var(--cks-font-body); color: var(--cks-spruce); cursor: pointer; }
.cks-size-w { font-size: 14.5px; font-weight: 700; line-height: 1.1; }
.cks-size-p { font-size: 12px; font-weight: 500; line-height: 1.1; color: #51635A; white-space: nowrap; }
.cks-size[aria-pressed="true"] .cks-size-p { color: #DCE3DE; }
.cks-sizes.is-nudged .cks-size { animation: cks-nudge .5s ease 2; }
@keyframes cks-nudge { 50% { border-color: var(--cks-maple); box-shadow: 0 0 0 3px rgba(200, 16, 46, .14); } }
@media (prefers-reduced-motion: reduce) { .cks-sizes.is-nudged .cks-size { animation: none; border-color: var(--cks-maple); } }
.cks-size-hint { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: #A90D27; }
.cks-size:hover { border-color: var(--cks-spruce); }
.cks-size[aria-pressed="true"] { background: var(--cks-spruce); border-color: var(--cks-spruce); color: var(--cks-snow); font-weight: 700; }
.cks-size.is-out { opacity: .45; }
.cks-sizes-on select { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.cks-product .single_variation_wrap { margin-top: 14px; }
.cks-product .woocommerce-variation { margin-bottom: 12px; }
.cks-product .woocommerce-variation-description:empty { display: none; }
.cks-product .woocommerce-variation-description p { margin: 0 0 6px; font-size: 13.5px; color: #51635A; }
.cks-product .woocommerce-variation-price .price { font-family: var(--cks-font-display); font-size: 22px; font-weight: 800; color: var(--cks-spruce); }
.cks-product .woocommerce-variation-availability p, .cks-product p.stock { margin: 4px 0 0; font-size: 12.5px; color: #51635A; }
.cks-product .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cks-product form.cart:not(.variations_form) { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* The add-ons plugin forces display:block on its forms (its own :has() rule, !important) and the
   quantity-buttons plugin floats the stepper; both are overruled here so pack products get the
   same row layout as every other product. The plugin also writes width:75% !important inline on
   the option row and its select - min-width is the only thing that outranks that. */
.woocommerce .cks-product form.cart:has(#yith-wapo-container .yith-wapo-block) { display: flex !important; flex-wrap: wrap; align-items: center; gap: 12px; }
.cks-product form.cart .qib-button-wrapper { float: none !important; flex: none; margin: 0; }
.cks-product #yith-wapo-container .yith-wapo-addon .options { min-width: 100%; }
.cks-product #yith-wapo-container select.yith-wapo-option-value { box-sizing: border-box; min-width: 100%; max-width: none; }
.cks-product form.cart .grPointsPay { flex: 0 0 100%; box-sizing: border-box; max-width: 100%; margin: 2px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--cks-fir-tint); font-size: 13px; line-height: 1.4; }
/* product add-on fields (YITH add-ons plugin markup, e.g. the variety-pack "Selection" selects) */
.cks-product #yith-wapo-container { flex: 0 0 100%; min-width: 0; margin: 0 0 4px; }
.cks-product #yith-wapo-container .yith-wapo-addon { margin: 0 0 14px; padding: 0; border: 0; background: transparent !important; }
.cks-product .yith-wapo-addon .wapo-addon-title { margin: 0 0 8px; font: 700 14px var(--cks-font-body); color: var(--cks-spruce); }
.cks-product .yith-wapo-addon .options { margin: 0; padding: 0; }
.cks-product form.cart .quantity { float: none; margin: 0; display: inline-flex; align-items: center; }
.cks-product form.cart .quantity .qty { width: 54px; height: 46px; margin: 0; padding: 0 4px; border: 1.5px solid #E3E1D9; border-radius: 12px; background: #fff; font: 700 15px var(--cks-font-body); color: var(--cks-spruce); text-align: center; }
.woocommerce .cks-product form.cart button.single_add_to_cart_button { flex: 1 1 180px; float: none; min-height: 54px; margin: 0; padding: 0 22px; border: 0; border-radius: 14px; background: var(--cks-maple); color: #fff; font: 700 16px var(--cks-font-body); cursor: pointer; opacity: 1; }
.woocommerce .cks-product form.cart button.single_add_to_cart_button:hover { background: #A90D27; color: #fff; }
/* before a size is chosen the button stays a full-strength button: tapping it points at the sizes (main.js) */
.woocommerce .cks-product form.cart button.single_add_to_cart_button.disabled, .woocommerce .cks-product form.cart button.single_add_to_cart_button:disabled { background: var(--cks-maple); opacity: 1; cursor: pointer; }
.woocommerce .cks-product form.cart button.single_add_to_cart_button.wc-variation-is-unavailable { opacity: .45; cursor: not-allowed; }

/* rewards line under the button (inc/catalog.php prints it; main.js fills in the number) */
.cks-product form.cart .cks-earn { flex: 0 0 100%; box-sizing: border-box; display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 0; padding: 11px 12px; border: 1px solid #D6E3DB; border-radius: 12px; background: var(--cks-fir-tint); color: var(--cks-spruce); }
.cks-earn-icon { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; color: #246B4E; }
.cks-earn-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cks-earn-title { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.cks-earn-note { font-size: 12.5px; line-height: 1.4; color: #51635A; }
.cks-earn-note a { color: #246B4E; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
/* with the rewards line above it, the loyalty plugin's own "use up to N points" line reads as its footnote, not a second box */
.cks-product form.cart .cks-earn ~ .grPointsPay { margin-top: -4px; padding: 0 2px; background: none; }

/* tabs as accordions */
.cks-product-info { margin-top: 28px; border-top: 1px solid #E3E1D9; }
.cks-acc { border-bottom: 1px solid #E3E1D9; }
.cks-acc > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; font-size: 15px; font-weight: 700; cursor: pointer; list-style: none; }
.cks-acc > summary::-webkit-details-marker { display: none; }
.cks-acc > summary::after { content: ""; flex-shrink: 0; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--cks-spruce); border-bottom: 2px solid var(--cks-spruce); transform: rotate(45deg); transition: transform .15s; }
.cks-acc[open] > summary::after { transform: rotate(-135deg); }
.cks-acc > summary:focus-visible { outline: 2px solid #246B4E; outline-offset: 2px; }
/* prose (.cks-prose) lives in content.css */
.cks-product-info .cks-prose { max-width: none; }
/* the "Name: text" paragraphs of a description read as a list of points (class added by inc/content-format.php) */
.cks-acc-description .cks-point { margin: 0 0 10px; padding: 14px 16px; border: 1px solid #E3E1D9; border-radius: 14px; background: #fff; }
.cks-acc-description .cks-point > strong:first-child, .cks-acc-description .cks-point > b:first-child { color: var(--cks-spruce); }
/* phones: buy first, read second - the same blocks, shown in a different order */
@media (max-width: 859px) {
  .cks-product-summary { display: flex; flex-direction: column; }
  .cks-product-summary > * { order: 3; }
  .cks-product-summary > .cks-product-cats { order: 1; }
  .cks-product-summary > .cks-product-title { order: 1; }
  .cks-product .cks-product-summary > .price { order: 2; margin-bottom: 0; }
  .cks-product .cks-product-summary > form.cart { order: 2; margin-top: 14px; padding-top: 14px; }
  .cks-product .cks-product-summary > .woocommerce-product-details__short-description { margin-top: 18px; }
}
/* phone buy bar (built by main.js) */
.cks-buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px var(--cks-gutter) calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #E3E1D9; background: rgba(250, 250, 247, .97); box-shadow: 0 -6px 18px rgba(22, 37, 30, .08); }
.cks-buybar[hidden] { display: none; }
.cks-buybar-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cks-buybar-title { overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; color: #51635A; }
.cks-buybar-price { font-family: var(--cks-font-display); font-size: 15.5px; font-weight: 700; color: var(--cks-spruce); }
.cks-buybar-btn { flex: none; min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--cks-maple); color: #fff; font: 700 15px var(--cks-font-body); cursor: pointer; }
body.has-buybar { padding-bottom: 70px; }
/* the rewards launcher (loyalty plugin) sits above the buy bar instead of on top of it */
body.has-buybar .am-widgetbar { margin-bottom: 76px !important; }
@media (min-width: 860px) { .cks-buybar { display: none !important; } body.has-buybar { padding-bottom: 0; } body.has-buybar .am-widgetbar { margin-bottom: 0 !important; } }
/* related */
.single-product .cks-footer { margin-top: 0; }
.cks-related { margin-top: 40px; padding: 34px 0 44px; background: var(--cks-fir-tint); }
.cks-related .cks-card-media { background: #FFFFFF; }

@media (min-width: 720px) {
  .cks-gallery-nav { justify-content: flex-start; gap: 10px; }
  .cks-gallery-nav button { width: 64px; height: 64px; border-radius: 12px; border: 1.5px solid #E3E1D9; background: #F1F0E9; display: flex; align-items: center; justify-content: center; }
  .cks-gallery-nav button[aria-current] { background: #F1F0E9; border-color: var(--cks-spruce); }
  .cks-gallery-nav img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
}
@media (min-width: 860px) {
  .cks-product { padding-top: 26px; }
  .cks-product-top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: start; }
  .cks-gallery { position: sticky; top: 16px; }
  .cks-product-title { font-size: 38px; }
  .cks-product .cks-product-summary > .price { font-size: 24px; }
  .cks-product-info { max-width: 780px; margin: 48px auto 0; }
  .cks-product-info .cks-prose { font-size: 15.5px; }
  .cks-sizes { grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; }
}
