/* Single product page: WooCommerce output on top of the .pdp design in pages.css. */

.ct-notices .woocommerce-notices-wrapper:not(:empty) { padding-top: 20px; }
.pdp > * { min-width: 0; }
.pdp-gallery__main img { display: block; }

/* Buttons and focus */
.pdp-thumbs button:focus-visible,
.pdp-color:focus-visible,
.pdp-size:focus-visible,
.pdp-wish:focus-visible,
.qty button:focus-visible,
.pdp-acc summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pdp-wish.ct-wish { position: static; background: #fff; }
.pdp-wish .icon { width: 20px; height: 20px; }

/* Rating stars that fill to the average */
.ct-stars { position: relative; display: inline-flex; flex: none; line-height: 0; vertical-align: middle; }
.ct-stars .stars { display: flex; gap: 2px; margin: 0; }
.ct-stars .stars svg { width: 15px; height: 15px; flex: none; }
.ct-stars__bg { color: var(--stone-2); }
.ct-stars__fg { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--ink); white-space: nowrap; }
.reviews-sum__score .ct-stars { margin: 10px 0 6px; }
.reviews-sum__score .ct-stars svg { width: 18px; height: 18px; }
.review-item .ct-stars svg, .pdp-quote .ct-stars svg { width: 13px; height: 13px; }

/* Price from WooCommerce (screen reader text sits between del and ins) */
.pdp-price { flex-wrap: wrap; }
.pdp-price .price { flex-wrap: wrap; }
.pdp-price del ~ ins { color: var(--sale); }
.pdp-price .save[hidden] { display: none; }
.pdp-price .woocommerce-Price-currencySymbol { font-weight: inherit; }

/* Option buttons */
.pdp-colors { flex-wrap: wrap; }
.pdp-color:disabled { cursor: not-allowed; opacity: .45; }
.pdp-color:disabled::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ink); transform: rotate(45deg); }
.pdp-sizes { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
.pdp-size { padding: 0 6px; }
.pdp-size:disabled { text-decoration: line-through; border-color: var(--line); }
.pdp-size:disabled:hover { border-color: var(--line); }
.pdp-size[aria-pressed="true"] em { border-color: #fff; }

/* WooCommerce's own selects stay for its script, the buttons replace them */
.ct-cart-form.is-enhanced .ct-variations { display: none; }
.ct-variations { width: 100%; margin: 0 0 12px; font-size: 14px; }
.ct-variations th { text-align: left; padding: 6px 12px 6px 0; font-weight: 500; }
.ct-variations select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; font: inherit; background: #fff; }
.single_variation .woocommerce-variation-price,
.single_variation .woocommerce-variation-availability { display: none; }
.single_variation .woocommerce-variation-description { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.single_variation .woocommerce-variation-description:empty { display: none; }

/* Stock line states */
.pdp-stock span { min-width: 0; }
.pdp-stock.is-low { color: var(--sale); }
.pdp-stock.is-low i { background: var(--sale); box-shadow: 0 0 0 4px rgba(185, 65, 47, .14); }
.pdp-stock.is-out { color: var(--muted); }
.pdp-stock.is-out i { background: var(--muted); box-shadow: 0 0 0 4px rgba(110, 116, 121, .14); }

/* Buy row */
.pdp-buy { align-items: stretch; }
.pdp-buy .single_add_to_cart_button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pdp-buy .single_add_to_cart_button.loading { opacity: .7; cursor: progress; }
.pdp-buy .qty input { height: 52px; }
.pdp-alt button.btn { width: 100%; }
.pdp-alt .btn { min-width: 0; }

/* Bundle */
.bundle__item img { flex: none; border-radius: 3px; }
.bundle__item > span:last-child { min-width: 0; }
.bundle__item b { color: var(--ink); }
.bundle__foot .btn[aria-busy="true"] { opacity: .6; }

/* Accordions */
.pdp-acc .acc-body > * + * { margin-top: 12px; }
.pdp-acc .ct-desc > * + * { margin-top: .8em; }
.pdp-acc .ct-desc ul { list-style: disc; padding-left: 18px; }
.ct-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ct-acc-link .u-link { font-size: 14px; }

/* Reviews */
.ct-reviews .reviews-sum__score b.ct-score { margin-top: 10px; }
.ct-reviews__empty { font-size: 26px; margin: 12px 0 8px; }
.ct-reviews__write { margin-top: 22px; }
.ct-reviews__more { margin-top: 22px; }
.ct-reviews__more .u-link { background: none; }
.review-item[hidden] { display: none; }
.review-item header b { display: inline-flex; flex-wrap: wrap; align-items: center; }
.review-item__text > * + * { margin-top: .6em; }
.review-item__text p { color: var(--ink-2); }
.review-list > .ct-review-form { margin-top: 28px; }
.review-list > .review-item + .ct-review-form, .review-list > p + .ct-review-form { margin-top: 28px; }
.ct-review-form summary { font-size: 16px; }
.ct-review-form .comment-form { display: grid; gap: 4px; }
.ct-review-form .comment-form-author, .ct-review-form .comment-form-email { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .ct-review-form .comment-form { grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .ct-review-form .comment-form > * { grid-column: 1 / -1; }
  .ct-review-form .comment-form-author { grid-column: 1; }
  .ct-review-form .comment-form-email { grid-column: 2; }
}
.ct-review-form .comment-form-fit { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.ct-review-form .comment-form-fit legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.ct-fit-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-fit-choices label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.ct-fit-choices label:has(input:checked) { border-color: var(--ink); background: var(--stone); }
.ct-fit-choices input { accent-color: var(--ink); margin: 0; }
.ct-review-form textarea { width: 100%; font: inherit; font-size: 15px; border: 1px solid #D6D3CC; border-radius: 8px; padding: 12px 14px; min-height: 120px; resize: vertical; }
.ct-review-form select { width: 100%; font: inherit; font-size: 15px; border: 1px solid #D6D3CC; border-radius: 8px; padding: 0 14px; min-height: 48px; background: #fff; }
.ct-review-form .form-submit { margin-top: 6px; }
.ct-review-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.ct-review-form .comment-form-cookies-consent input { margin-top: 3px; accent-color: var(--ink); }
.ct-review-form .comment-form-cookies-consent label { font-weight: 400; font-size: 13px; }
.ct-review-form .woocommerce-verification-required, .ct-review-form .must-log-in { color: var(--ink-2); font-size: 14px; }
.ct-review-form .must-log-in a { text-decoration: underline; text-underline-offset: 3px; }
/* Star picker WooCommerce's script adds before the rating select */
.comment-form-rating p.stars { display: flex; gap: 4px; margin: 2px 0 0; }
.comment-form-rating p.stars span { display: flex; gap: 4px; }
.comment-form-rating p.stars a { position: relative; width: 30px; height: 30px; overflow: hidden; text-indent: -999em; border-radius: 4px; }
.comment-form-rating p.stars a::before {
  content: ""; position: absolute; inset: 3px; text-indent: 0; background: var(--stone-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.8 6.3.9-4.6 4.4 1.1 6.3L12 17.2l-5.6 3 1.1-6.3L2.9 9.5l6.3-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.8 6.3.9-4.6 4.4 1.1 6.3L12 17.2l-5.6 3 1.1-6.3L2.9 9.5l6.3-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.comment-form-rating p.stars a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.comment-form-rating p.stars:hover a::before,
.comment-form-rating p.stars.selected a::before { background: var(--ink); }
.comment-form-rating p.stars:hover a:hover ~ a::before,
.comment-form-rating p.stars.selected a.active ~ a::before { background: var(--stone-2); }
.comment-form-rating p.stars.selected a.active::before { background: var(--ink); }

/* Related products */
.ct-related ul.products { margin: 0; }

/* Mobile buy bar */
.buy-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.buy-bar > div { min-width: 0; }
.buy-bar b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buy-bar img { flex: none; }
.buy-bar .btn { flex: none; }
@media (max-width: 959px) {
  body.page-product { padding-bottom: 76px; }
}
@media (max-width: 380px) {
  .pdp-trust { grid-template-columns: repeat(2, 1fr); }
  .buy-bar .btn { padding: 0 16px; }
}

/* Products with one photo: no thumbnail column */
@media (min-width: 960px) { .pdp-gallery--single { grid-template-columns: 1fr; } }
