/* PDP restyle (pdp-restyle/SPEC.md), after section-main-product. Nested (no nesting = today's PDP);
   px on purpose (mobile root 14px); tokens only. */
.section-main-product {
  /* C4 12 apart, first flush */
  & .product-info-block:not(:first-child),
  & .product-info .product-info-inner .shopify-app-block:not(:first-child) { margin-block-start: 12px; }
  & .product-info-inner > .product-info-block:not(.product-info-block ~ .product-info-block) { margin-block-start: 0; }
  & .variant-selects .product-form-input:not(:has(~ .product-form-input)) { margin-block-end: 0; }
  /* C3 */
  & .product-media-gallery .slider-thumbnails-container .slider-thumbnails-wrapper .thumbnail-slider .thumbnail-list { gap: 6px; }
  /* C6 (M below) */
  & .product-info .product-info-inner .product-title h1.product-title-heading { letter-spacing: .04em; }
  /* C7 pill + stars one row; no reviews = blocks */
  & .product-info-inner > .product-info-app:has(> [id*=__flair_product_badges_]):has(+ .product-info-app > [id*=__judge_me_reviews_preview_badge_]),
  & .product-info-inner > .product-info-app:has(> [id*=__flair_product_badges_]) + .product-info-app:has(> [id*=__judge_me_reviews_preview_badge_]) { display: inline-flex; align-items: center; vertical-align: middle; margin-block-start: calc(12px - 6px); }
  & .product-info-inner > .product-info-app:has(> [id*=__flair_product_badges_]):has(+ .product-info-app .jdgm-prev-badge[data-average-rating='0.00']),
  & .product-info-inner > .product-info-app:has(> [id*=__flair_product_badges_]) + .product-info-app:has(.jdgm-prev-badge[data-average-rating='0.00']) { display: block; margin-block-start: 12px; }
  & .product-info-inner > .product-info-app > [id*=__flair_product_badges_] flair-badges { --flair-layout-margin: 0 6px 0 0; --flair-font-size: 10.5px; --flair-line-height: 18px; --flair-letter-spacing: .04em; --flair-font-weight: 700; }
  /* C2 empty Flair / hidden Auglio: no gap */
  & .product-info-app:has(+ .product-title) > [id*=__flair_product_badges_] { display: flow-root; & flair-badges { --flair-layout-margin: 0 6px 12px 0; } }
  & .product-info-app:has(> [id*=__flair_product_badges_]) + .product-title { margin-block-start: 0; }
  & .product-info-app:first-child:has(> [id*=__auglio_] > [style*="display:none"]) { margin-block-end: -12px; }
  /* C8; B2 (round 2, Sasha 2026-10-05 + DIAG §4): Shop Pay installments ALWAYS one line, the ⓘ included, at every
     width — nowrap, and the font shrinks to the column (container query units). Measured on the dev theme: the line
     is 23.1em + 58px (EN) / 24.55em + 58px (FR; the Shop logo and the ⓘ button are fixed px), so a pure cqi ratio
     (3.3cqi) clipped the ⓘ at 320 FR; the divisor carries +~1.2em for longer prices. Cap = the 12.5 / 14px size.
     overflow: clip is the safety net. One-line reserve at both widths (24.28 / 26.39 measured). */
  & .product-price-tax .product-form { margin-block-start: 2px; font-size: 14px; container-type: inline-size; }
  & .product-price-tax .product-form shopify-payment-terms { display: block; white-space: nowrap; overflow: clip; font-size: min(1em, (100cqi - 60px) / 24.3); }
  & .product-price-tax .product-form:lang(fr) shopify-payment-terms { font-size: min(1em, (100cqi - 60px) / 25.8); }
  /* B2 follow-up (Sasha 2026-10-05: "when it's below 35$ can go on 2 lines then, but not when it's above"). Under the
     Shop Pay threshold (Theme settings → Party Expert; main-product stamps data-paex-spt-below, paex-spt.js follows the
     variant) Shopify prints the longer "Pay over time for orders over $35.00 with Shop" line: normal wrapping at the
     normal size. At / above the threshold the one-line rule above applies unchanged. */
  & .product-price-tax .product-form[data-paex-spt-below] shopify-payment-terms { white-space: normal; overflow: visible; font-size: 1em; }
  /* A6 label; C11 pills 40 tall (48 hit: buy-buttons) */
  & .variant-selects .product-form-input .form-label-wrapper .form-label { font-size: 14px; }
  & .variant-selects .product-form-input .form-label-wrapper .form-label span { font-size: 13px; }
  & .variant-selects .product-form-input .form-options-wrapper.button-options label { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding-block: 0; }
  /* A9 SKU; C22 features; C23 */
  & .product-info-inner > .product-info-custom-liquid:not(:has(.custom-features-section)) { font-size: 13px; line-height: 1.4; }
  & .product-info-custom-liquid .custom-features-section { & h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; letter-spacing: .04em; } & ul { line-height: 1.5; margin-block: 0; } }
  & .product-payment-security.show-box { padding: 12px; }
  /* C24 one line; contain stops nowrap widening the column */
  & .product-info-app > [id*=__smart_breadcrumbs_breadcrumbs_] { contain: inline-size; }
  & .smart-breadcrumbs__list { flex-wrap: nowrap; min-width: 0; }
  & .smart-breadcrumbs__item { min-width: 0; flex-shrink: 1; }
  & :is(.smart-breadcrumbs__item:first-child, .smart-breadcrumbs__separator) { flex-shrink: 0; }
  & .smart-breadcrumbs__item--current { flex-shrink: 1000; }
  & :is(.smart-breadcrumbs__link, .smart-breadcrumbs__current) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  /* C25 28 icons, 44 hits */
  & .product-info-others {
    margin-block-start: 16px;
    & .product-share-link .list-social { gap: 16px; }
    & .product-share-link .list-social .social-item { --icon-width: 16px; padding: 6px; }
    & .list-social .social-item :is(.list-social-link, custom-copy-text)::before { content: ""; position: absolute; inset: -8px; }
  }
  /* C32 (round 2): the bottom tabs became collapsible rows (snippets/paex-pdp-details) — 48px rows, 1px dividers, +/− */
  & .product-container .product-container-bottom {
    margin-block-start: 32px;
    & > .product-tab-panel { min-width: 0; }
    & .product-tab-panel > .product-accordion { margin: 0; border-block-start: 1px solid rgba(var(--color-foreground), .12); }
    & .product-tab-panel > .product-accordion:last-child { border-block-end: 1px solid rgba(var(--color-foreground), .12); }
    & .product-tab-panel > .product-accordion .details-disclosure > summary { position: relative; min-height: 48px; padding-block: 12px; padding-inline: 0 28px; font-size: 14px; font-weight: 600; line-height: 1.35; }
    & .product-tab-panel > .product-accordion .details-disclosure > summary::before,
    & .product-tab-panel > .product-accordion .details-disclosure > summary::after { content: ""; position: absolute; inset-inline-end: 4px; top: 50%; width: 12px; height: 1.5px; margin-block-start: -.75px; background: currentColor; transition: transform 200ms ease; }
    & .product-tab-panel > .product-accordion .details-disclosure > summary::after { transform: rotate(90deg); }
    & .product-tab-panel > .product-accordion .details-disclosure[open] > summary::after { transform: rotate(0deg); }
    & .product-tab-panel > .product-accordion .details-disclosure > summary:focus-visible { outline: 2px solid rgb(var(--color-foreground)); outline-offset: -2px; }
    & .product-tab-panel > .product-accordion .details-disclosure > .details-disclosure-content { padding-block: 0 16px; font-size: 14px; line-height: 1.55; }
  }

  @media screen and (max-width: 749px) {
    & .product-container { padding-block: 0 40px; } /* C1 */
    & .product-container .product-container-main { gap: 16px; } /* C2 */
    & .product-container .product-container-main.product-media-layout--thumbnail-right .slider-thumbnails-container { margin-block-start: 8px; & .thumbnail-list-item { width: 52px; } }
    & .product-info .product-info-inner .product-title h1.product-title-heading { font-size: 15.5px; letter-spacing: .02em; line-height: 1.3; }
    & .product-price-tax .product-form { font-size: 12.5px; }
    & .product-price-tax .product-form:is(:lang(fr), :has([shopify-meta*='"eligible":true'])) { min-height: 24.28px; }
    /* B2 follow-up: under the threshold the reserve follows the line count. The line needs 20em + 53px (EN) / 31.8em + 54px
       (FR) (measured 302.7 / 451.5px at 12.5px), so it wraps to 2 lines (43.03px) below a 303 / 452px column, else 1 (24.28px). */
    & .product-price-tax .product-form[data-paex-spt-below]:has(shopify-payment-terms) .installment { min-height: 43.03px; }
    @container (min-width: 303px) { & .product-price-tax .product-form[data-paex-spt-below]:not(:lang(fr)):has(shopify-payment-terms) .installment { min-height: 24.28px; } }
    @container (min-width: 452px) { & .product-price-tax .product-form[data-paex-spt-below]:lang(fr):has(shopify-payment-terms) .installment { min-height: 24.28px; } }
  }
  @media screen and (min-width: 750px) {
    & .product-price-tax .product-form:is(:lang(fr), :has([shopify-meta*='"eligible":true'])) { min-height: 26.39px; } /* B2: the same one-line reserve */
    /* B2 follow-up at 14px: 332.7 / 499.2px for one line → 2 lines (47.39px) below a 333 / 500px column, else 1 (26.39px) */
    & .product-price-tax .product-form[data-paex-spt-below]:has(shopify-payment-terms) .installment { min-height: 47.39px; }
    @container (min-width: 333px) { & .product-price-tax .product-form[data-paex-spt-below]:not(:lang(fr)):has(shopify-payment-terms) .installment { min-height: 26.39px; } }
    @container (min-width: 500px) { & .product-price-tax .product-form[data-paex-spt-below]:lang(fr):has(shopify-payment-terms) .installment { min-height: 26.39px; } }
    & .product-container .product-container-main.product-media-layout--thumbnail-right .product-media-slider .slider-thumbnails-container { width: 64px; }
  }
}

/* C26-C28 carousels */
body[class*=template-product] :is(.related-products, .recently-viewed-products) {
  padding-block-start: 32px;
  & .title-wrapper { padding-block: 0; margin-block-end: 12px; }
  & .text-content { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; max-width: none; }
  & .text-content > * { margin-block: 0; }
  & .text-content-heading { font-size: 18px; font-weight: 700; letter-spacing: 0; text-align: start; text-transform: none !important; }
  & .text-content-buttons .button { --border-opacity: 0; min-height: 44px; padding: 0; background: none; font-size: 13px; font-weight: 600; }
  & .paex-occasion-badge { display: none; }
  & .card-inner .card-media-wrapper { border-radius: 8px; }
  & .card-content { padding-block: 6px 0; }
  & .card-content > :not(:first-child) { margin-block-start: 4px; }
  & .card-content .card-heading { font-size: 12.5px; line-height: 1.35; }
  & .line-clamp-1 { -webkit-line-clamp: 2; line-clamp: 2; }
  & .card .card-content .card-price .price { font-size: 14px; font-weight: 700; }
  & .card-inner .card-inner-content .card-information { display: flex; justify-content: flex-end; padding: 1px; }
  & .product-card-wrapper .card .card-inner .card-inner-content .card-quick-add .button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border: 5px solid transparent; background-clip: padding-box; background-color: rgb(var(--color-background)); color: rgb(var(--color-foreground)); box-shadow: none; filter: drop-shadow(0 3px 5px rgba(var(--color-foreground), .2)); opacity: 1; animation: none; }
  & .card-quick-add .icon { width: 18px; }

  /* C27/C28 on Ascent sliders only (G10); placeholders: desktop, mobile RV */
  @media screen and (min-width: 750px) {
    & :is(.slider[data-slide-desktop] > .slider-container > .slider-wrapper, .products-container > ul).auto-grid { gap: 10px; & > .grid-item { flex: none; width: 220px; min-width: 0; } }
    & .products-container > ul.auto-grid { display: flex; overflow: hidden; }
  }
  @media screen and (max-width: 749px) {
    padding-block-start: 24px;
    & :is(.slider[data-slide-mobile] > .slider-container > .slider-wrapper, .recently-viewed-products .products-container > ul).auto-grid { gap: 10px; & > .grid-item { flex: none; width: 150px; min-width: 0; } }
    &.recently-viewed-products .products-container > ul.auto-grid { display: flex; overflow: hidden; }
    & .products-container:has(> .slider[data-slide-mobile]), &.recently-viewed-products .products-container:has(> ul.auto-grid) { margin-inline-end: -1.5rem; }
  }
}
