/* =====================================================================
   Product page
   ===================================================================== */
.tm-pdp-wrap { padding-bottom: 12px; }
.tm-pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr);
  gap: 44px; align-items: start;
  margin-top: 8px;
}

/* Gallery */
.tm-gal { display: grid; grid-template-columns: 1fr; gap: 14px; position: sticky; top: calc(var(--mast-h) + 16px); }
.tm-gal--many { grid-template-columns: 76px minmax(0, 1fr); }
.tm-gal__thumbs { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; scrollbar-width: none; }
.tm-gal__thumbs::-webkit-scrollbar { display: none; }
.tm-gal__thumb {
  width: 76px; height: 76px; flex-shrink: 0; padding: 4px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; overflow: hidden;
}
.tm-gal__thumb img { width: 100%; height: 100%; object-fit: contain; }
.tm-gal__thumb:hover { border-color: var(--line-3); }
.tm-gal__thumb.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.tm-gal__stage {
  position: relative; aspect-ratio: 1 / 1;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #fff; overflow: hidden;
}
.tm-gal__track { position: absolute; inset: 0; }
.tm-gal__slide { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity .25s ease; }
.tm-gal__slide.is-on { opacity: 1; visibility: visible; }
.tm-gal__slide img { width: 92%; height: 92%; object-fit: contain; }
.tm-gal__wish {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  background: #fff; display: grid; place-items: center; box-shadow: var(--sh-1);
}
.tm-gal__nav {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%;
  background: rgba(255, 255, 255, .95); display: grid; place-items: center; box-shadow: var(--sh-1);
}
.tm-gal__nav--prev { left: 14px; }
.tm-gal__nav--next { right: 14px; }
.tm-gal__count { position: absolute; left: 14px; bottom: 14px; z-index: 2; padding: 4px 10px; border-radius: var(--pill); background: rgba(25, 24, 22, .75); color: #fff; font-size: 12.5px; font-weight: 600; }

/* Right column */
.tm-pdp__side { display: grid; gap: 18px; min-width: 0; }
.tm-pdp__brand { display: inline-block; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.tm-pdp__brand:hover { color: var(--brand); }
.tm-pdp__title { margin-top: 6px; font-size: 27px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.tm-pdp__ref { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.tm-pdp__ref span { font-weight: 600; color: var(--ink-2); }

.tm-buy { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1); }
.tm-buy__price { font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.tm-buy__shipnote { margin-top: 6px; font-size: 14px; color: var(--muted); }
.tm-buy__stock { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: 14.5px; color: var(--ink-2); }
.tm-buy__stock .tm-i { color: var(--ok); margin-top: 1px; }
.tm-buy__stock strong { color: var(--ok); }
.tm-buy__stock.is-out { color: var(--bad); font-weight: 700; }

.tm-buy__cart { margin-top: 16px; }
.tm-buy__cart form.cart { display: flex; align-items: stretch; gap: 10px; margin: 0; }
.tm-buy__cart .quantity { flex-shrink: 0; }
.tm-buy__cart .single_add_to_cart_button {
  flex: 1; height: 52px; padding: 0 24px;
  border: 0; border-radius: var(--pill);
  background: var(--brand); color: #fff;
  font-size: 16.5px; font-weight: 800;
  transition: background-color .15s ease;
}
.tm-buy__cart .single_add_to_cart_button:hover { background: var(--brand-h); }
.tm-buy__cart .single_add_to_cart_button.loading { opacity: .7; }
.tm-buy__cart .single_add_to_cart_button.is-added { background: var(--ok); }
.tm-buy__cart .stock { display: none; }

.tm-buy__save {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 2px;
  border: 0; background: none; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
}
.tm-buy__save:hover span { text-decoration: underline; }

.tm-buy__deliv { display: flex; gap: 12px; margin-top: 14px; padding: 14px; border-radius: var(--r); background: var(--soft); }
.tm-buy__deliv-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.tm-buy__deliv strong { display: block; font-size: 15.5px; font-weight: 800; }
.tm-buy__deliv span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }

.tm-buy__facts { list-style: none; display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); }
.tm-buy__facts li { display: flex; gap: 10px; align-items: flex-start; }
.tm-buy__facts .tm-i { color: var(--muted); margin-top: 1px; }
.tm-buy__facts strong { color: var(--ink); }

.tm-buy__pay { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.tm-buy__pay > span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

.tm-glance { padding: 18px 20px; border-radius: var(--r-lg); background: var(--soft); }
.tm-glance__t { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.tm-glance dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.tm-glance dl > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.tm-glance__ico { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.tm-glance dt { font-size: 12.5px; color: var(--muted); }
.tm-glance dd { font-size: 15px; font-weight: 700; line-height: 1.25; }

/* Quantity stepper (product page + cart) */
.quantity { display: inline-flex; align-items: center; height: 52px; border: 1.5px solid var(--line-3); border-radius: var(--pill); background: #fff; overflow: hidden; }
.quantity .qty {
  width: 44px; height: 100%; padding: 0; border: 0; background: transparent;
  text-align: center; font-size: 16px; font-weight: 700;
  -moz-appearance: textfield;
}
.quantity .qty:focus { outline: none; }
.quantity .qty::-webkit-inner-spin-button, .quantity .qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-btn { width: 40px; height: 100%; border: 0; background: transparent; font-size: 20px; font-weight: 600; color: var(--ink); }
.qty-btn:hover { background: var(--soft); }

/* Details */
.tm-details { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 44px; align-items: start; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.tm-dsec { margin-bottom: 8px; }
.tm-dsec__t { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.tm-prose { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.tm-prose p + p { margin-top: 12px; }
.tm-prose--clamp { position: relative; max-height: 15em; overflow: hidden; }
.tm-prose--clamp.is-open { max-height: none; }
.tm-prose--clamp:not(.is-open).is-long::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.tm-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tm-more[hidden] { display: none; }
.tm-more.is-open .tm-i { transform: rotate(180deg); }

.tm-acc { border-top: 1px solid var(--line); }
.tm-acc:last-child { border-bottom: 1px solid var(--line); }
.tm-details__main .tm-dsec + .tm-acc { margin-top: 28px; }
.tm-acc > summary { display: flex; align-items: center; gap: 12px; padding: 18px 0; list-style: none; cursor: pointer; font-size: 17px; font-weight: 700; }
.tm-acc > summary::-webkit-details-marker { display: none; }
.tm-acc > summary > span { flex: 1; }
.tm-acc > summary > .tm-i:last-child { transition: transform .2s ease; color: var(--muted); }
.tm-acc[open] > summary > .tm-i:last-child { transform: rotate(180deg); }
.tm-acc__b { padding: 0 0 18px 32px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.tm-acc__b p + p { margin-top: 10px; }
.tm-acc__b a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

.tm-spec { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tm-spec__row { display: grid; grid-template-columns: 42% 1fr; }
.tm-spec__row:nth-child(odd) { background: var(--soft); }
.tm-spec__row dt, .tm-spec__row dd { padding: 11px 16px; font-size: 14.5px; }
.tm-spec__row dt { color: var(--muted); }
.tm-spec__row dd { font-weight: 600; }
.tm-spec__note { margin-top: 10px; font-size: 13px; color: var(--muted); }

.tm-sec--pdp { margin-top: 48px; }

/* Sticky buy bar (phones) */
.tm-stickybuy { display: none; }

@media (max-width: 1000px) {
  .tm-pdp { grid-template-columns: 1fr; gap: 20px; }
  .tm-gal { position: static; }
  .tm-gal--many { grid-template-columns: 1fr; }
  .tm-gal__thumbs { display: none; }
  .tm-gal__stage { margin: 0 calc(var(--gut) * -1); border-radius: 0; border-left: 0; border-right: 0; }
  .tm-gal__track { display: flex; position: absolute; inset: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .tm-gal__track::-webkit-scrollbar { display: none; }
  .tm-gal__slide { position: relative; inset: auto; flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; opacity: 1; visibility: visible; }
  .tm-gal__nav { display: none; }
  .tm-pdp__title { font-size: 22px; }
  .tm-buy { padding: 18px; box-shadow: none; }
  .tm-buy__price { font-size: 28px; }
  .tm-details { grid-template-columns: 1fr; gap: 28px; margin-top: 32px; padding-top: 24px; }

  .tm-stickybuy {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
    transform: translateY(110%); transition: transform .25s ease;
  }
  .tm-stickybuy.is-on { transform: none; }
  .tm-stickybuy__info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
  .tm-stickybuy__info img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: var(--soft); flex-shrink: 0; }
  .tm-stickybuy__info > div { min-width: 0; display: grid; }
  .tm-stickybuy__name { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tm-stickybuy__price { font-size: 17px; font-weight: 800; }
  .tm-stickybuy .tm-btn { height: 46px; padding: 0 20px; flex-shrink: 0; }
}
@media (max-width: 760px) {
  .tm-acc__b { padding-left: 0; }
  .tm-glance dl { grid-template-columns: 1fr 1fr; }
}
.tm-buy__cart a.added_to_cart { display: none; }
