/* p3dp-prices: [p3dp_prices] store table. Mobile first (the table lives in the narrow buy box), widened with a
   container query when it has room. Colors only from p3dp-ui tokens (--p-*), so light and dark come for free. */

.p3pr { font-family: var(--p-font-body); color: var(--p-text); --p3pr-pad: 22px; }
.p3pr *, .p3pr *::before, .p3pr *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------- container */
.p3pr-table {
  container-type: inline-size; container-name: p3pr-table;
  background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-radius);
  padding: 18px var(--p3pr-pad) 16px; overflow: hidden;
}
/* inside the single printer buy box it replaces the old price block: no box of its own */
.p3-buybox .p3pr-table { border: 0; border-radius: 0; border-bottom: 1px solid var(--p-line-2); }
/* while the tracker shows, its rows replace the template's own buy buttons and disclosure (Add to compare stays) */
.p3-buybox:has(.p3pr-table) .p3-buybox-actions > .elementor-widget-button,
.p3-buybox:has(.p3pr-table) .p3-buybox-actions .p3-disclosure { display: none !important; }

/* ---------------------------------------------------------------- variant tabs */
.p3pr-variants {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 16px;
  background: var(--p-surface-2); border: 1px solid var(--p-line-2); border-radius: 10px;
}
.p3pr-table:not(.is-js) .p3pr-variants { display: none; }
.p3pr-tab {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 7px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: transparent; color: var(--p-ink); font: 700 14px/1.2 var(--p-font-head);
  transition: background-color .2s, color .2s;
}
.p3pr-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.p3pr-tab-price { font: 600 12px/1.2 var(--p-font-head); color: var(--p-mute); }
.p3pr-tab[aria-selected="true"] { background: var(--p-solid); color: var(--p-on-solid); }
.p3pr-tab[aria-selected="true"] .p3pr-tab-price { color: inherit; opacity: .85; }
.p3pr-tab[aria-selected="false"]:hover { background: var(--p-surface); }
.p3pr-tab:focus-visible { outline: 3px solid var(--p-accent); outline-offset: 1px; }

/* ---------------------------------------------------------------- panels (all visible without JS, titled) */
.p3pr-panel + .p3pr-panel { margin-top: 22px; }
.p3pr-table.is-js .p3pr-panel + .p3pr-panel { margin-top: 0; }
.p3pr-panel[hidden] { display: none; }
.p3pr-panel:focus { outline: none; }
.p3pr-panel:focus-visible { outline: 3px solid var(--p-accent); outline-offset: 4px; border-radius: 4px; }
.p3pr-panel-title { font: 700 13px var(--p-font-head) !important; letter-spacing: .1em; text-transform: uppercase; color: var(--p-link) !important; margin: 0 0 10px !important; }
.p3pr-table.is-js .p3pr-panel-title { display: none; }

/* ---------------------------------------------------------------- summary: best price + verdict */
.p3pr-summary { padding-bottom: 14px; border-bottom: 1px solid var(--p-line-2); }
.p3pr-summary-lbl { font: 700 12px var(--p-font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--p-mute); }
.p3pr-summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 2px; }
.p3pr-best { font: 700 40px/1.1 var(--p-font-head); letter-spacing: -.02em; color: var(--p-ink); }
.p3pr-summary-sub { font-size: 13px; line-height: 1.5; color: var(--p-mute); margin-top: 4px; }
.p3pr-summary-sub .p3pr-checked { display: inline; margin: 0; }

/* ---------------------------------------------------------------- rows */
.p3pr-offers, .p3pr-offers tbody { display: block; width: 100%; margin: 0; border: 0; border-collapse: collapse; background: transparent; }
.p3pr-offers caption { caption-side: top; }
.p3pr-offers .p3pr-row {
  position: relative; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "store price buy" "store stock buy";
  column-gap: 12px; row-gap: 2px; padding: 12px 0; border: 0; border-top: 1px solid var(--p-line-2); background: transparent;
}
.p3pr-offers .p3pr-row:first-child { border-top: 0; }
.p3pr-offers th, .p3pr-offers td { display: block; padding: 0; border: 0; background: transparent; text-align: left; vertical-align: middle; font-weight: 400; }
.p3pr-store { grid-area: store; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--p-mute); }
.p3pr-store-name { display: inline; font: 700 15px/1.3 var(--p-font-head); color: var(--p-ink); overflow-wrap: anywhere; }
.p3pr-tag-best {
  display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 1px 7px; border-radius: 999px;
  background: var(--p-tint); color: var(--p-tint-ink); font: 700 10px/1.5 var(--p-font-head); letter-spacing: .06em; text-transform: uppercase;
}
.p3pr-checked, .p3pr-note { display: block; font-size: 12px; line-height: 1.4; color: var(--p-mute); margin-top: 2px; }
.p3pr-coupon {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border: 1px dashed var(--p-tint-ink); border-radius: 6px;
  font-size: 12px; line-height: 1.4; color: var(--p-tint-ink); background: var(--p-tint);
}
.p3pr-coupon code { font: 700 12px var(--p-font-head); color: inherit; background: none; padding: 0; letter-spacing: .04em; }

.p3pr-price { grid-area: price; text-align: right !important; white-space: nowrap; }
.p3pr-price b { font: 700 18px/1.2 var(--p-font-head); color: var(--p-ink); }
.p3pr-was { display: block; font: 500 12px/1.3 var(--p-font-head); color: var(--p-mute); }
.p3pr-price--none { font-size: 12px; line-height: 1.35; color: var(--p-mute); white-space: normal; max-width: 92px; }

.p3pr-stock { grid-area: stock; text-align: right !important; font: 600 12px/1.3 var(--p-font-head); white-space: nowrap; }
.p3pr-stock--in { color: var(--p-tint-ink); }
.p3pr-stock--out { color: var(--p-warn-ink); }
.p3pr-stock--unknown { color: var(--p-mute); font-weight: 400; }

.p3pr-buy { grid-area: buy; }
.p3pr-buy .p3-btn { min-height: 44px; padding: 0 14px; }

/* the best row gets an accent rule in the gutter */
.p3pr-row--best::before { content: ""; position: absolute; left: calc(-1 * var(--p3pr-pad)); top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--p-accent); }
.p3pr-row--out .p3pr-price b { color: var(--p-mute); }
.p3pr-row--held .p3pr-store-name { color: var(--p-text-2); }

/* Amazon: a link, never a price */
.p3pr-row--amazon .p3pr-price, .p3pr-row--amazon .p3pr-stock { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.p3pr-offers .p3pr-row--amazon { grid-template-areas: "store buy buy" "store buy buy"; }

/* very narrow buy boxes: the button drops under the store line */
@container p3pr-table (max-width: 360px) {
  .p3pr-offers .p3pr-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "store price" "store stock" "buy buy"; row-gap: 6px; }
  .p3pr-offers .p3pr-row--amazon { grid-template-areas: "store store" "buy buy"; }
  .p3pr-buy .p3-btn { width: 100%; }
  .p3pr-best { font-size: 34px; }
}
/* roomy: one line per store, stock in its own column */
@container p3pr-table (min-width: 620px) {
  .p3pr-offers .p3pr-row { grid-template-columns: minmax(0, 1.6fr) minmax(100px, .7fr) minmax(100px, .6fr) minmax(120px, auto); grid-template-areas: "store price stock buy"; column-gap: 20px; }
  .p3pr-offers .p3pr-row--amazon { grid-template-areas: "store buy buy buy"; }
  .p3pr-row--amazon .p3pr-buy { justify-self: end; }
  .p3pr-buy .p3-btn { width: 100%; }
  .p3pr-stock { text-align: left !important; }
}

/* ---------------------------------------------------------------- disclosure + report */
.p3pr-disclosure { font-size: 12.5px; line-height: 1.5; color: var(--p-mute); margin: 14px 0 0; }
.p3pr-disclosure a, .p3pr-report a { color: var(--p-link); }
.p3pr-report { font-size: 13px; margin: 8px 0 0; }
.p3pr-report-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; padding: 14px; border: 1px solid var(--p-line); border-radius: var(--p-radius-sm); background: var(--p-surface-2); }
.p3pr-report-form[hidden] { display: none; }
.p3pr-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.p3pr-field label { font: 600 13px var(--p-font-head); color: var(--p-ink); }
.p3pr-field input, .p3pr-field select, .p3pr-field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--p-line); border-radius: var(--p-radius-sm);
  background: var(--p-surface); color: var(--p-ink); font: 15px var(--p-font-body);
}
.p3pr-field textarea { min-height: 88px; resize: vertical; }
.p3pr-field input:focus, .p3pr-field select:focus, .p3pr-field textarea:focus { outline: none; border-color: var(--p-link); box-shadow: 0 0 0 3px var(--p-tint); }
.p3pr-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.p3pr-report-msg { font-size: 13px; color: var(--p-text-2); margin: 8px 0 0; min-height: 1em; }
.p3pr-report-msg.is-ok { color: var(--p-tint-ink); }
.p3pr-report-msg.is-err { color: var(--p-warn-ink); }
@container p3pr-table (min-width: 520px) {
  .p3pr-report-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p3pr-field--wide { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .p3pr-tab { transition: none; }
}
