/* DESIGN01 D5a (2.0.26): product page v2 — loaded only when tm_product_v2 is active (body.tm-pv2).
   Board: Design/DESIGN01/mockup/Product.dc.html. Colours / fonts = theme.json tokens; numbers in Inter (.tm-num).
   Desktop >= 1024: two columns (6fr / 5fr), right column sticky (top 24px, no inner scroll).
   Phone < 1024: one column, fixed bottom bar instead of the page stepper / button. */

/* ── Layout ─────────────────────────────────────────────────────────────────────────────────── */
.tm-pv2-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 32px 56px;
  padding: 24px 0 48px;
  align-items: start;
}
.tm-pv2-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.tm-pv2-left .tm-set-composition { margin: 0; }

body.tm-pv2 .tm-pv2-summary {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: none;
  overflow: visible;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tm-pv2-summary .tm-eyebrow-row,
.tm-pv2-summary .tm-product-h1,
.tm-pv2-summary .tm-product-meta,
.tm-pv2-summary .tm-product-stock,
.tm-pv2-summary .tm-product-cta-row { margin: 0; }
.tm-pv2-summary .tm-product-rating-count { color: inherit; text-decoration: none; }
.tm-pv2-summary .tm-product-rating-count:hover { text-decoration: underline; }

/* R3 "Why this one" */
.tm-pv2-why {
  background: var(--wp--preset--color--bg-alt);
  border-left: 3px solid var(--wp--preset--color--accent);
  padding: 14px 16px;
}
.tm-pv2-why__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--wp--preset--color--accent);
  margin-bottom: 4px;
}
.tm-pv2-why__text {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--wp--preset--color--text);
}

/* R4 price + unit + stock */
.tm-pv2-buy { display: flex; flex-direction: column; gap: 8px; }
.tm-pv2-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}
.tm-pv2-price__amount .woocommerce-Price-amount,
.tm-pv2-price__amount > bdi {
  font-family: var(--tm-font-num);
  font-variant-numeric: var(--tm-num-variant);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--wp--preset--color--accent);
}
.tm-pv2-price__amount del { opacity: 0.7; margin-right: 8px; }
.tm-pv2-price__amount del .woocommerce-Price-amount {
  font-size: 18px;
  font-weight: 500;
  color: rgba(26, 26, 26, 0.72);
}
.tm-pv2-price__amount ins { background: none; text-decoration: none; }
.tm-pv2-price__unit {
  font-size: 14px;
  color: rgba(26, 26, 26, 0.72);
}

/* R5 stepper + button */
.tm-pv2-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.tm-pv2-cta .tm-qty-stepper input { font-family: var(--tm-font-num); font-size: 16px; }
.tm-pv2-add,
.tm-pv2-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em; /* flex items: the spaces around "·" collapse, the gap keeps them */
  flex: 1 1 220px;
  min-height: 56px;
  height: auto;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--bg);
  font-family: var(--wp--preset--font-family--inter);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.tm-pv2-add:hover,
.tm-pv2-bar__btn:hover { background: var(--wp--preset--color--accent-dark); }
.tm-pv2-add:disabled,
.tm-pv2-bar__btn:disabled { opacity: 0.7; cursor: progress; }
.tm-pv2-add .tm-num,
.tm-pv2-bar__btn .tm-num { letter-spacing: 0.02em; }

body.tm-pv2 .tm-qty-stepper button:focus-visible,
body.tm-pv2 .tm-qty-stepper input:focus-visible,
.tm-pv2-add:focus-visible,
.tm-pv2-bar__btn:focus-visible,
.tm-pv2-btn-outline:focus-visible,
.tm-pv2-ship a:focus-visible,
.tm-pv2-link:focus-visible {
  outline: 2px solid var(--wp--preset--color--text);
  outline-offset: 2px;
}

/* R6 hint */
.tm-pv2-hint {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--wp--preset--color--bg-alt);
  border: 1px solid var(--wp--preset--color--border);
  color: var(--wp--preset--color--text);
}
.tm-pv2-hint[hidden] { display: none; }
.tm-pv2-hint__icon { flex: none; margin-top: 1px; }
.tm-pv2-hint__head { margin: 0; font-weight: 600; font-size: 15px; }
.tm-pv2-hint__sub { margin: 2px 0 0; font-size: 14px; color: rgba(26, 26, 26, 0.72); }

/* R7 ships / pickup line */
.tm-pv2-ship {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(26, 26, 26, 0.72);
}
.tm-pv2-ship::first-letter { text-transform: uppercase; }
.tm-pv2-ship a {
  color: var(--wp--preset--color--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}

/* ── Sections (GO A, 04.12: in the left column under the gallery / set contents, one column each; the right column
   stays sticky down to the related block) ───────────────────────────────────────────────────────────────── */
.tm-pv2-sections { display: flex; flex-direction: column; }
.tm-pv2-band {
  padding: 32px 0;
  border-top: 1px solid var(--wp--preset--color--border);
}
.tm-pv2-wrap { margin: 0; padding: 0; }
.tm-pv2-cols {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.tm-pv2-cols > .tm-pv2-col + .tm-pv2-col {
  padding-top: 32px;
  border-top: 1px solid var(--wp--preset--color--border);
}
.tm-pv2-h2 {
  margin: 0 0 16px;
  font-family: var(--wp--preset--font-family--cormorant);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  color: var(--wp--preset--color--text);
}
.tm-pv2-text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--wp--preset--color--text-body);
}
.tm-pv2-text > :first-child { margin-top: 0; }
.tm-pv2-text p { margin: 14px 0 0; }
.tm-pv2-text ul { padding-left: 20px; margin: 14px 0 0; }
.tm-pv2-text li { margin: 6px 0; }
.tm-pv2-text h3 { font-family: var(--wp--preset--font-family--cormorant); font-weight: 500; font-size: 22px; margin: 20px 0 8px; }

/* S1 brewing list (2 columns) */
.tm-pv2-brew__list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}
.tm-pv2-brew__row { border-top: 1px solid var(--wp--preset--color--border); padding-top: 8px; }
.tm-pv2-brew__row.is-wide { grid-column: 1 / -1; }
.tm-pv2-brew__row dt {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.72);
}
.tm-pv2-brew__row dd { margin: 2px 0 0; font-size: 15px; color: var(--wp--preset--color--text); }

/* S1 characteristics (small, end of "About") */
.tm-pv2-props { margin-top: 28px; }
.tm-pv2-props__title {
  margin: 0 0 8px;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(26, 26, 26, 0.72);
}
.tm-pv2-props__list { margin: 0; font-size: 14px; }
.tm-pv2-props__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-top: 1px solid var(--wp--preset--color--border);
}
.tm-pv2-props__row dt { color: rgba(26, 26, 26, 0.72); }
.tm-pv2-props__row dd { margin: 0; text-align: right; color: var(--wp--preset--color--text); }

/* S2 origin */
.tm-pv2-origin__grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
body.tm-pv2 .tm-pv2-origin__visual { width: 160px; height: 160px; }
.tm-pv2-origin__name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: var(--wp--preset--font-family--cormorant);
  font-weight: 500;
  font-size: 24px;
}
.tm-pv2-origin__name img { height: auto; }
.tm-pv2-link {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 0;
  color: var(--wp--preset--color--accent);
  text-decoration: none;
  font-size: 14px;
}
.tm-pv2-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* S2 delivery: the shipping block keeps its markup; its own title is replaced by the section heading */
.tm-pv2-delivery { scroll-margin-top: 24px; }
.tm-pv2-delivery .tm-product-shipping { border-top: 0; padding-top: 0; margin-top: 0; }
.tm-pv2-delivery .tm-product-shipping__title { display: none; }

/* S3 reviews */
.tm-pv2-reviews__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 8px;
}
.tm-pv2-reviews__head .tm-pv2-h2 { margin: 0; }
.tm-pv2-btn-outline {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--wp--preset--color--text);
  color: var(--wp--preset--color--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.tm-pv2-btn-outline:hover { background: var(--wp--preset--color--text); color: var(--wp--preset--color--bg); }
.tm-pv2-reviews__empty { margin: 0 0 16px; color: rgba(26, 26, 26, 0.72); }
.tm-pv2-reviews__wc #reviews { scroll-margin-top: 96px; }
.tm-pv2-reviews__wc .woocommerce-Reviews-title,
.tm-pv2-reviews__wc .woocommerce-noreviews { display: none; }
.tm-pv2-reviews__wc #review_form_wrapper { scroll-margin-top: 24px; }

/* S3 review form (WooCommerce markup): closed until "Write a review" (product-v2.js adds body.tm-pv2-reviews-js;
   without JS the form stays visible). Labels 14 px, fields full width, border token, 44 px targets. */
body.tm-pv2-reviews-js .tm-pv2-reviews__wc #review_form_wrapper { display: none; }
body.tm-pv2-reviews-js .tm-pv2-reviews__wc #review_form_wrapper.is-open { display: block; }
.tm-pv2-reviews__wc #review_form_wrapper {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--wp--preset--color--border);
}
.tm-pv2-reviews__wc .comment-reply-title {
  display: block;
  margin: 0 0 8px;
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--wp--preset--color--text);
}
.tm-pv2-reviews__wc .comment-form { display: flex; flex-direction: column; gap: 14px; }
.tm-pv2-reviews__wc .comment-form p { margin: 0; }
.tm-pv2-reviews__wc .comment-notes,
.tm-pv2-reviews__wc .logged-in-as { font-size: 14px; color: rgba(26, 26, 26, 0.72); }
.tm-pv2-reviews__wc .comment-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
}
.tm-pv2-reviews__wc .comment-form .required { color: var(--wp--preset--color--accent); }
.tm-pv2-reviews__wc .comment-form input[type="text"],
.tm-pv2-reviews__wc .comment-form input[type="email"],
.tm-pv2-reviews__wc .comment-form input[type="url"],
.tm-pv2-reviews__wc .comment-form textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 0;
  background: var(--wp--preset--color--bg);
  color: var(--wp--preset--color--text);
  font-family: var(--wp--preset--font-family--inter);
  font-size: 16px;
  line-height: 1.4;
}
.tm-pv2-reviews__wc .comment-form textarea { min-height: 120px; resize: vertical; }
.tm-pv2-reviews__wc .comment-form input:focus-visible,
.tm-pv2-reviews__wc .comment-form textarea:focus-visible,
.tm-pv2-reviews__wc .comment-form select:focus-visible,
.tm-pv2-reviews__wc .comment-form .submit:focus-visible {
  outline: 2px solid var(--wp--preset--color--text);
  outline-offset: 2px;
}
.tm-pv2-reviews__wc .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.tm-pv2-reviews__wc .comment-form-cookies-consent label { display: inline; margin: 0; font-weight: 400; }
.tm-pv2-reviews__wc .comment-form .submit {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--wp--preset--color--text);
  border-radius: 0;
  background: transparent;
  color: var(--wp--preset--color--text);
  font-family: var(--wp--preset--font-family--inter);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.tm-pv2-reviews__wc .comment-form .submit:hover { background: var(--wp--preset--color--text); color: var(--wp--preset--color--bg); }
button.tm-pv2-btn-outline { background: transparent; border-radius: 0; font-family: var(--wp--preset--font-family--inter); cursor: pointer; }

/* Related keeps its 2.0.25 markup; spacing only */
body.tm-pv2 .tm-product-related { margin-top: 0; }

/* Phone bar: hidden on desktop */
.tm-pv2-bar { display: none; }

/* ── Phone / tablet < 1024 ──────────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .tm-pv2-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px 0 32px;
  }
  /* Children of the left column and of the summary become items of one column, ordered:
     gallery, R1–R4, set contents, R7. Stepper, button and hint live in the bar. */
  .tm-pv2-left,
  body.tm-pv2 .tm-pv2-summary { display: contents; }
  .tm-pv2-left .tm-product-gallery { order: 1; margin-bottom: 8px; }
  .tm-pv2-o-head { order: 2; }
  .tm-pv2-left .tm-set-composition { order: 3; }
  .tm-pv2-o-ship { order: 4; }
  .tm-pv2-summary .tm-pv2-cta,
  .tm-pv2-summary .tm-pv2-hint { display: none !important; }
  .tm-pv2-price__amount .woocommerce-Price-amount,
  .tm-pv2-price__amount > bdi { font-size: 26px; }

  .tm-pv2-left .tm-pv2-sections { order: 5; }
  .tm-pv2-band { padding: 28px 0; }
  .tm-pv2-h2 { font-size: 28px; }
  .tm-pv2-origin__grid { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
  body.tm-pv2 .tm-pv2-origin__visual { width: 120px; height: 120px; }

  .tm-pv2-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    box-sizing: border-box;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    background: var(--wp--preset--color--bg);
    border-top: 1px solid var(--wp--preset--color--text);
  }
  .tm-pv2-bar__hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--wp--preset--color--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tm-pv2-bar__hint[hidden] { display: none; }
  .tm-pv2-bar__row { display: flex; gap: 10px; align-items: stretch; }
  .tm-pv2-bar__qty {
    display: inline-flex;
    align-items: center;
    flex: none;
    border: 1px solid var(--wp--preset--color--text);
    height: 48px;
  }
  .tm-pv2-bar__qty button {
    width: 44px;
    height: 46px;
    border: 0;
    background: none;
    font-size: 20px;
    color: var(--wp--preset--color--text);
    cursor: pointer;
  }
  .tm-pv2-bar__qty input {
    width: 36px;
    height: 46px;
    border: 0;
    padding: 0;
    text-align: center;
    font-family: var(--tm-font-num);
    font-size: 16px;
    font-weight: 600;
    background: transparent;
    -moz-appearance: textfield;
  }
  .tm-pv2-bar__qty input::-webkit-outer-spin-button,
  .tm-pv2-bar__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .tm-pv2-bar__btn {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 48px;
    padding: 0 12px;
    font-size: 14px;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.tm-drawer-open .tm-pv2-bar { display: none; }

  /* Room for the bar (its height is measured into --tm-paybar-h by product-v2.js; 96px until then). */
  body.tm-pv2.tm-is-product-page main { padding-bottom: calc(var(--tm-paybar-h, 96px) + 16px); }

  /* CookieYes (first visit banner, revisit button) above the bar — same variable as the checkout pay bar. */
  body.tm-pv2:not(.tm-drawer-open) .cky-consent-container[class*="-bottom-"] {
    bottom: var(--tm-paybar-h, 96px);
  }
  body.tm-pv2:not(.tm-drawer-open) .cky-btn-revisit-wrapper {
    bottom: calc(var(--tm-paybar-h, 96px) + 8px);
  }
}

@media (max-width: 400px) {
  .tm-pv2-bar__btn { font-size: 13px; letter-spacing: 0.02em; padding: 0 8px; }
  .tm-pv2-bar__qty button { width: 44px; }
}
