/* ==========================================================================
   Product detail page — Amazon layout (gallery / details / buy box) with
   Google Ads polish. Builds on app.css tokens and components.
   ========================================================================== */

body.page-product { background: var(--ts-surface); }
.pdp { padding-bottom: 8px; }

/* Top grid --------------------------------------------------------------- */
.pdp-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 340px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "gallery head buy"
    "gallery details buy";
  align-items: start;
  gap: 0 32px;
  margin-top: 6px;
}
.pdp-gallery { grid-area: gallery; }
.pdp-head { grid-area: head; min-width: 0; }
.pdp-details { grid-area: details; min-width: 0; }
.pdp-buy { grid-area: buy; min-width: 0; }

@media (min-width: 1280px) {
  .pdp-gallery { position: sticky; top: 16px; }
}
@media (min-width: 1024px) and (min-height: 1040px) {
  .pdp-buy { position: sticky; top: 16px; }
}

/* Gallery (CSS-only switcher: radios + labels) --------------------------- */
.pdp-gallery {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-areas:
    "thumbs stage"
    ". note";
  gap: 10px 14px;
  min-width: 0;
}
.pdp-thumbs { grid-area: thumbs; display: flex; flex-direction: column; gap: 10px; }
.pdp-thumb {
  display: block;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--ts-border);
  border-radius: var(--radius);
  background: #dfe3e6;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.pdp-thumb .art { width: 100%; height: 100%; }
.pdp-thumb:hover { border-color: #e77600; box-shadow: 0 0 3px 2px rgba(228, 121, 17, .45); }
.pdp-thumb-specs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: linear-gradient(140deg, var(--c2, var(--ts-navy-700)), var(--c1, var(--ts-steel)));
}
#pdp-view-1:checked ~ .pdp-thumbs .pdp-thumb-1,
#pdp-view-2:checked ~ .pdp-thumbs .pdp-thumb-2,
#pdp-view-3:checked ~ .pdp-thumbs .pdp-thumb-3 {
  border-color: #e77600;
  box-shadow: 0 0 3px 2px rgba(228, 121, 17, .5);
}
#pdp-view-1:focus-visible ~ .pdp-thumbs .pdp-thumb-1,
#pdp-view-2:focus-visible ~ .pdp-thumbs .pdp-thumb-2,
#pdp-view-3:focus-visible ~ .pdp-thumbs .pdp-thumb-3 {
  outline: var(--focus);
  outline-offset: 2px;
}
.pdp-stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  background: #dfe3e6;
  box-shadow: var(--shadow-1);
}
.pdp-view { position: absolute; inset: 0; display: none; }
.pdp-view .art { width: 100%; height: 100%; aspect-ratio: auto; }
#pdp-view-1:checked ~ .pdp-stage .pdp-view-1,
#pdp-view-2:checked ~ .pdp-stage .pdp-view-2,
#pdp-view-3:checked ~ .pdp-stage .pdp-view-3 { display: block; animation: pdp-fade .25s ease; }
.pdp-gallery-note { grid-area: note; margin: 0; font-size: 12px; color: var(--ts-text-3); }
@media (min-width: 1280px) {
  .pdp-stage { aspect-ratio: 4 / 3; }
}

.pdp-glance {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 22px 28px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .18), transparent 45%),
    linear-gradient(140deg, var(--c2, var(--ts-navy-700)), var(--c1, var(--ts-steel)));
}
.pdp-glance-head { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pdp-glance-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.pdp-glance-list { display: grid; gap: 10px; margin: 0; }
.pdp-glance-list > div { padding-left: 12px; border-left: 2px solid rgba(255, 255, 255, .45); }
.pdp-glance-list dt { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.pdp-glance-list dd {
  margin: 1px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Title block ------------------------------------------------------------ */
.pdp-cat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ts-steel-600);
}
.pdp-cat-link:hover { color: #c7511f; }
.pdp-title { margin: 6px 0 6px; font-size: 27px; font-weight: 600; line-height: 1.22; letter-spacing: -.015em; }
.pdp-byline { margin: 0 0 10px; font-size: 14px; color: var(--ts-text-2); }
.pdp-sep { margin: 0 8px; }
.pdp-sku { font-variant-numeric: tabular-nums; }
.pdp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

/* Details ---------------------------------------------------------------- */
.pdp-details { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ts-border-2); }
.pdp-from-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.pdp-from-price .price-from { font-size: 13px; }
.pdp-from-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 14px; font-weight: 500; color: var(--ts-green); }
.pdp-from-note-neutral { color: var(--ts-text-2); }
.pdp-short { margin: 16px 0; font-size: 15.5px; line-height: 1.55; }
.pdp-h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.pdp-about { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ts-border-2); }
.pdp-highlights > li { font-size: 14.5px; line-height: 1.55; }
.pdp-plans-glance { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--ts-border-2); }
.pdp-glance-titlebar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pdp-small-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 600; }

.tier-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.tier-mini-item { display: flex; min-width: 0; }
.tier-mini-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--ts-border);
  border-radius: var(--radius);
  color: var(--ts-text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.tier-mini-link:hover { border-color: var(--ts-blue); box-shadow: 0 0 0 1px var(--ts-blue); color: var(--ts-text); text-decoration: none; }
.tier-mini-item.is-recommended .tier-mini-link { border-color: #e9a46a; background: #fffaf3; }
.tier-mini-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.tier-mini-top .badge { padding: 2px 6px; font-size: 10.5px; }
.tier-mini-name { font-size: 14px; font-weight: 700; }
.tier-mini-price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tier-mini-price small { font-size: 12px; font-weight: 400; color: var(--ts-text-2); }
.tier-mini-summary {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ts-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-mini-cta { display: inline-flex; align-items: center; gap: 2px; margin-top: auto; padding-top: 4px; font-size: 13px; font-weight: 600; color: var(--ts-blue); }

/* Buy box ---------------------------------------------------------------- */
.buy-box {
  padding: 18px 18px 16px;
  border: 1px solid var(--ts-border);
  border-radius: var(--radius);
  background: var(--ts-surface);
}
.buy-price-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.buy-price-amount { display: inline-flex; }
.buy-list { margin: 4px 0 0; font-size: 13px; color: var(--ts-text-2); }
.buy-field { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.buy-legend { display: block; margin: 0 0 8px; padding: 0; font-size: 13px; font-weight: 700; color: var(--ts-text); }
.buy-plans { display: grid; gap: 14px; }
.buy-plan { padding: 10px 12px 10px 40px; }
.buy-plan .radio-card-indicator { top: 12px; left: 12px; right: auto; width: 18px; height: 18px; }
.buy-plan .radio-card-title { font-size: 14.5px; }
.buy-plan .radio-card-price { font-variant-numeric: tabular-nums; }
.buy-plan .radio-card-price small { margin-left: 1px; font-size: 12px; font-weight: 500; color: var(--ts-text-2); }
.buy-plan .radio-card-desc {
  font-size: 12.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.buy-plan:not(.is-selected) .radio-card-desc { display: none; } /* summary shown for the chosen plan only */
.buy-plan .radio-card-tag { top: -10px; right: 10px; padding: 2px 7px; font-size: 11px; }
.buy-plan.is-flash { animation: pdp-flash 1s ease; }

.buy-terms { margin-top: 16px; }
.buy-terms > legend { margin-bottom: 8px; font-size: 13px; }
.buy-term-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.buy-terms .chip {
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-height: 50px;
  padding: 4px 6px;
  border-radius: 10px;
  font-size: 13.5px;
  text-align: center;
}
.buy-terms .chip .chip-check { display: none !important; }
.buy-terms .chip-note { font-size: 11.5px; }
.buy-terms .chip-note-muted, .buy-terms .chip:has(input:checked) .chip-note-muted { color: var(--ts-text-2); font-weight: 500; }

.buy-onetime { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 13.5px; color: var(--ts-text-2); }
.buy-qty { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 16px; }
.buy-qty .buy-legend { margin: 0; }
.buy-qty-unit { font-size: 13px; color: var(--ts-text-2); }

.buy-totals {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--ts-border-2);
  border-radius: var(--radius);
  background: var(--ts-surface-2);
}
.buy-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 0; font-size: 14px; }
.buy-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy-row-total { font-size: 16px; font-weight: 700; }
.buy-note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ts-text-2); }
.buy-savings { display: block; margin: 6px 0 0; }

.buy-available { display: flex; align-items: center; gap: 6px; margin: 14px 0 4px; font-size: 15px; font-weight: 600; color: var(--ts-green); }
.buy-lead { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 14px; font-size: 14px; }
.buy-lead .icon { margin-top: 2px; color: var(--ts-text-2); }
.buy-actions { display: grid; gap: 10px; }
.buy-actions .btn { font-weight: 500; }
.buy-secure { display: flex; align-items: flex-start; gap: 6px; margin: 14px 0 8px; font-size: 13px; color: var(--ts-text-2); }
.buy-secure .icon { margin-top: 1px; }
.buy-secure strong { color: var(--ts-text); font-weight: 600; }
.buy-meta { margin: 0 0 4px; font-size: 13px; line-height: 1.45; color: var(--ts-text-2); }
.buy-meta strong { color: var(--ts-text); font-weight: 600; }
.buy-tax { margin: 8px 0 0; font-size: 12px; color: var(--ts-text-3); }

.buy-quote {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--ts-border);
  border-radius: var(--radius);
  font-size: 14px;
}
.buy-quote-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--ts-blue-50); color: var(--ts-blue); }
.buy-quote-title { margin: 0 0 2px; font-weight: 700; }
.buy-quote a { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }

/* In-page navigation ----------------------------------------------------- */
.pdp-jump { margin: 32px 0 0; }
.pdp-jump ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

/* Sections --------------------------------------------------------------- */
.pdp-section { margin: 24px 0 0; padding: 28px 0 4px; border-top: 1px solid var(--ts-border-2); scroll-margin-top: 12px; }
.pdp-h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; }
.pdp-section-sub { margin: -8px 0 16px; font-size: 14px; color: var(--ts-text-2); }
#specs, #faq { scroll-margin-top: 12px; }

.pdp-desc { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.pdp-desc .prose { max-width: 820px; }
.pdp-facts {
  padding: 18px 20px;
  border: 1px solid var(--ts-border-2);
  border-radius: var(--radius-lg);
  background: var(--ts-surface-2);
}
.pdp-facts-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.pdp-facts-list { display: grid; gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; }
.pdp-facts-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.45; }
.pdp-facts-list .icon { margin-top: 1px; color: var(--ts-steel-600); }
.pdp-facts-list div { display: flex; flex-direction: column; min-width: 0; }
.pdp-facts-list span { color: var(--ts-text-2); }

/* Compare table */
/* position: relative keeps absolutely positioned (visually-hidden) descendants clipped by the scroll box */
.compare-wrap { position: relative; border: 1px solid var(--ts-border-2); border-radius: var(--radius-lg); }
.compare-table { min-width: 760px; table-layout: fixed; }
.compare-table thead th { padding: 14px; background: var(--ts-surface-2); }
.compare-table .compare-corner { width: 190px; }
.compare-table .compare-head { vertical-align: bottom; color: var(--ts-text); font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; white-space: normal; }
.compare-name { display: block; }
.compare-head .badge { margin-top: 6px; }
.compare-table tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 190px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ts-border-2);
  background: var(--ts-surface-2);
  color: var(--ts-text);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  vertical-align: top;
}
.compare-table td { font-size: 14px; line-height: 1.5; }
.compare-table .is-recommended { background: #fffaf3; }
.compare-table thead th.is-recommended { background: #fff1e0; box-shadow: inset 0 3px 0 #e77600; }
.compare-table tbody tr:hover td { background: inherit; }
.compare-table tbody tr:hover td.is-recommended { background: #fffaf3; }
.compare-price .price { font-size: 22px; }
.compare-price .price-per { display: block; margin-top: 4px; }
.compare-save { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--ts-green-50); color: #0d652d; font-size: 12px; font-weight: 700; }
.compare-features { gap: 7px; font-size: 13.5px; }
.compare-actions td { vertical-align: top; }
.compare-actions form { margin: 0; }
.compare-actions .btn { max-width: 240px; }
.compare-customize { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 500; }
.compare-hint { display: none; }

/* Specs + FAQ */
.pdp-specs-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.pdp-specs .spec-table th { width: 36%; }
.pdp-faq .accordion summary { font-size: 15px; }
.pdp-faq-more { margin: 14px 0 0; font-size: 14px; color: var(--ts-text-2); }

.pdp-related .section-head { margin-bottom: 14px; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1279px) {
  .pdp-top {
    grid-template-columns: minmax(0, 1fr) 330px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "head buy"
      "gallery buy"
      "details buy";
    gap: 0 28px;
  }
  .pdp-head { margin-bottom: 16px; }
  .pdp-desc { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
}

@media (max-width: 1023px) {
  .pdp-top { grid-template-columns: minmax(0, 1fr) 300px; gap: 0 24px; }
  .tier-mini { grid-template-columns: minmax(0, 1fr); }
  .tier-mini-summary { -webkit-line-clamp: 2; }
  .pdp-desc { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .pdp-specs-faq { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 767px) {
  .pdp-top {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas:
      "head"
      "gallery"
      "buy"
      "details";
  }
  .pdp-head { margin-bottom: 12px; }
  .pdp-title { font-size: 22px; }
  .pdp-gallery {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "stage"
      "thumbs"
      "note";
  }
  .pdp-thumbs { flex-direction: row; justify-content: center; }
  .pdp-thumb { width: 48px; height: 48px; }
  .pdp-gallery-note { text-align: center; }
  .pdp-glance { padding: 14px 18px; gap: 8px; }
  .pdp-glance-head { font-size: 11.5px; }
  .pdp-glance-icon { width: 28px; height: 28px; }
  .pdp-glance-list { gap: 6px; }
  .pdp-glance-list dt { font-size: 10.5px; }
  .pdp-glance-list dd { font-size: 13px; -webkit-line-clamp: 1; }
  .pdp-buy { margin-top: 18px; }
  .buy-box { padding: 16px 14px 14px; }
  .pdp-details { margin-top: 20px; }
  .pdp-jump { margin-top: 24px; }
  .pdp-jump ul { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
  .pdp-jump ul::-webkit-scrollbar { display: none; }
  .pdp-section { padding-top: 22px; margin-top: 18px; }
  .pdp-h2 { font-size: 20px; }
  .compare-table { min-width: 640px; }
  .compare-hint { display: inline; }
  .compare-table .compare-corner, .compare-table tbody th[scope="row"] { width: 120px; }
  .pdp-specs .spec-table th { width: 42%; }
}

@media (max-width: 380px) {
  .pdp-glance-list > div:nth-child(3) { display: none; }
}

/* Motion ----------------------------------------------------------------- */
@keyframes pdp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pdp-flash {
  0% { box-shadow: 0 0 0 1px var(--ts-blue), 0 0 0 6px rgba(26, 115, 232, .35); }
  100% { box-shadow: 0 0 0 1px var(--ts-blue), 0 0 0 0 rgba(26, 115, 232, 0); }
}
