/* treniraj.si v5 — single product page (SPEC §7).
   Scope: .tr-pp (page), .tr-gallery, .tr-vars (chips), .tr-buy-row / .tr-atc-btn, .tr-pp-trust, .tr-pp-meta,
   .tr-pp-tabs / .tr-pp-panel, .tr-pp-related, .tr-sticky-add (mobile bar). WC markup is styled only under .tr-pp.
   Rules: tokens only, every selector once, no important-overrides, breakpoints 480/768/1024/1280. */

/* ══ Page + 2-column grid (1.1fr 1fr, gap 56). .tr-pp-grid holds ONLY gallery + summary — it is the containing
   block of the sticky gallery; .tr-pp-below (tabs + related) is its sibling, so the gallery unsticks before them ══ */
.tr-pp{padding-top:var(--tr-s5);padding-bottom:var(--tr-section);/* longhands: .tr-container keeps its horizontal gutter */--tr-pp-star-fill:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.5L12 17.3 6.1 20.5l1.3-6.5L2.5 9.4l6.6-.8z'/%3E%3C/svg%3E");--tr-pp-star-line:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.5L12 17.3 6.1 20.5l1.3-6.5L2.5 9.4l6.6-.8z'/%3E%3C/svg%3E");}
.tr-pp-grid{display:grid;grid-template-columns:1.1fr 1fr;gap:var(--tr-s6) 56px;align-items:start;}
.tr-pp-media{min-width:0;position:sticky;top:var(--tr-sticky-top);}
.tr-pp-summary{min-width:0;display:flex;flex-direction:column;gap:var(--tr-s4);}
.tr-pp-below{min-width:0;margin-top:var(--tr-s8);} /* s8 = the former grid row-gap s6 + margin s6 */

/* ══ Gallery: main image in a grey 1:1 well, thumbs row (72px squares) ══ */
.tr-gallery{position:relative;}
.tr-gallery-badges{position:absolute;top:var(--tr-s4);left:var(--tr-s4);z-index:1;display:flex;flex-direction:column;align-items:flex-start;gap:var(--tr-s1);pointer-events:none;}
.tr-gallery-main{position:relative;aspect-ratio:1 / 1;border-radius:var(--tr-r-lg);background:var(--tr-grey-50);overflow:hidden;}
.tr-gallery-main img{width:100%;height:100%;object-fit:contain;padding:6%;mix-blend-mode:multiply;}
.tr-gallery-thumbs{display:flex;gap:var(--tr-s2);margin-top:var(--tr-s3);overflow-x:auto;scrollbar-width:none;padding:2px;}
.tr-gallery-thumbs::-webkit-scrollbar{display:none;}
.tr-gallery-thumb{flex:none;width:72px;height:72px;border:2px solid transparent;border-radius:var(--tr-r);background:var(--tr-grey-50);overflow:hidden;cursor:pointer;transition:border-color var(--tr-t) var(--tr-ease);}
.tr-gallery-thumb img{width:100%;height:100%;object-fit:contain;padding:6px;mix-blend-mode:multiply;}
.tr-gallery-thumb:hover{border-color:var(--tr-grey-300);}
.tr-gallery-thumb.is-active,.tr-gallery-thumb[aria-pressed="true"]{border-color:var(--tr-ink);}

/* ══ Summary: title, rating, price, short description ══ */
.tr-pp .product_title{font-size:var(--tr-fs-h2);letter-spacing:-.02em;line-height:var(--tr-lh-tight);} /* h1 = largest text on the page; the related h2 below is one step smaller */
.tr-pp .woocommerce-product-rating{display:flex;align-items:center;gap:var(--tr-s2);font-size:var(--tr-fs-13);color:var(--tr-grey-500);}
.tr-pp .woocommerce-review-link{color:var(--tr-grey-500);text-decoration:underline;text-underline-offset:2px;}
.tr-pp .star-rating{position:relative;display:inline-block;width:5em;height:1em;font-size:var(--tr-fs-14);line-height:1;}
.tr-pp .star-rating::before{content:"";position:absolute;inset:0;background:var(--tr-grey-500);-webkit-mask:var(--tr-pp-star-line) left center / 1em 1em repeat-x;mask:var(--tr-pp-star-line) left center / 1em 1em repeat-x;}
.tr-pp .star-rating span{position:absolute;top:0;left:0;bottom:0;overflow:hidden;background:var(--tr-star);color:transparent;text-indent:-999em;white-space:nowrap;-webkit-mask:var(--tr-pp-star-fill) left center / 1em 1em repeat-x;mask:var(--tr-pp-star-fill) left center / 1em 1em repeat-x;}
.tr-pp-summary > .price{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--tr-s2);font-size:var(--tr-fs-24);font-weight:800;line-height:1.2;color:var(--tr-ink);}
.tr-pp-summary > .price ins{order:-1;color:var(--tr-red-ink);}
.tr-pp-summary > .price del{font-size:var(--tr-fs-16);font-weight:500;color:var(--tr-grey-500);}
.tr-pp-summary > .price .woocommerce-price-suffix,.tr-sticky-add-price .woocommerce-price-suffix{font-size:var(--tr-fs-13);font-weight:500;color:var(--tr-grey-500);} /* »z DDV« / »incl. VAT« (inc/omnibus.php) */
.tr-pp-summary > .price .tr-omnibus{flex-basis:100%;margin-top:0;} /* Omnibus note on its own line under price + suffix (the flex gap spaces it) */
.tr-pp .woocommerce-product-details__short-description{font-size:var(--tr-fs-15);line-height:var(--tr-lh);color:var(--tr-grey-700);}
.tr-pp .woocommerce-product-details__short-description p+p{margin-top:var(--tr-s3);}
.tr-pp .woocommerce-product-details__short-description strong{color:var(--tr-ink);}

/* ══ Add-to-cart form: chips → stock line → qty + ONE red button (52px) ══ */
.tr-pp form.cart{display:flex;flex-direction:column;gap:var(--tr-s4);}
.tr-pp .variations{display:none;}
.tr-vars{display:flex;flex-direction:column;gap:var(--tr-s4);}
.tr-var-head{display:flex;justify-content:space-between;align-items:baseline;gap:var(--tr-s3);margin-bottom:var(--tr-s2);} /* label · "Počisti izbiro" on one line: revealing the reset never moves the chips / buy row */
.tr-var .tr-label{display:block;margin-bottom:0;}
.tr-var-val{font-weight:500;color:var(--tr-grey-500);}
.tr-var-val:not(:empty)::before{content:": ";}
.tr-vars-reset{flex:none;min-height:24px;padding:var(--tr-s1) 0;border:0;background:none;font-size:var(--tr-fs-13);font-weight:500;color:var(--tr-grey-500);text-decoration:underline;text-underline-offset:2px;cursor:pointer;} /* product.js shows it once a chip is pressed */
.tr-vars-reset[hidden]{display:none;}
.tr-vars-reset:hover{color:var(--tr-ink);}
/* No gap on the wrap: WC's .single_variation is a 0-height item while its price/availability are hidden, and a flex gap
   would push the stock line + buy row 16px down on every selection. Spacing comes from a non-empty description only. */
.tr-pp .single_variation_wrap{display:flex;flex-direction:column;}
.tr-pp .woocommerce-variation-price,.tr-pp .woocommerce-variation-availability{display:none;}
.tr-pp .woocommerce-variation-description{margin-bottom:var(--tr-s4);font-size:var(--tr-fs-14);color:var(--tr-grey-700);}
.tr-pp .woocommerce-variation-description:empty{display:none;}
.tr-pp .woocommerce-variation-add-to-cart{display:flex;flex-direction:column;gap:var(--tr-s4);}
.tr-pp-stock{margin:0;}
.tr-pp-stock .tr-stock{font-size:var(--tr-fs-13);}
.tr-buy-row{display:flex;align-items:center;gap:var(--tr-s3);}
.tr-buy-row .quantity{flex:none;}
.tr-buy-row .tr-qty{height:52px;} /* same row height as the button (components.css .tr-qty is 44px elsewhere) */
.tr-buy-row .tr-qty-btn{width:52px;}
.tr-atc-btn{flex:1 1 auto;min-width:0;height:52px;}
/* Every variation sold out: PHP renders this instead of qty + button (variation-add-to-cart-button.php) */
.tr-pp-soldout{display:flex;flex-direction:column;align-items:flex-start;gap:var(--tr-s3);}
.tr-pp-soldout .tr-stock{font-size:var(--tr-fs-15);}
.tr-pp-soldout-txt{margin:0;font-size:var(--tr-fs-15);line-height:var(--tr-lh);color:var(--tr-grey-700);}

/* ══ Trust 2×2 + meta ══ */
.tr-pp-trust{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--tr-s3) var(--tr-s4);padding-top:var(--tr-s4);border-top:var(--tr-border);}
.tr-pp-trust li{display:flex;align-items:center;gap:var(--tr-s2);font-size:var(--tr-fs-13);font-weight:600;line-height:var(--tr-lh-snug);color:var(--tr-grey-700);}
.tr-pp-trust svg{flex:none;width:20px;height:20px;color:var(--tr-red-ink);}
/* Delivery notes under the trust row (inc/product.php treniraj_pp_ship_notes): pickup only, no cash on delivery */
.tr-pp-ship-note{margin:0;padding:var(--tr-s3) var(--tr-s4);border-radius:var(--tr-r-sm);background:var(--tr-grey-50);font-size:var(--tr-fs-13);line-height:var(--tr-lh);color:var(--tr-grey-700);}
.tr-pp-ship-note strong{color:var(--tr-ink);}
.tr-pp-ship-note a{color:var(--tr-red-ink);text-decoration:underline;text-underline-offset:2px;}
.tr-pp-meta{display:flex;flex-direction:column;gap:var(--tr-s1);font-size:var(--tr-fs-13);line-height:var(--tr-lh-snug);color:var(--tr-grey-500);}
.tr-pp-meta div{display:flex;flex-wrap:wrap;gap:var(--tr-s1) var(--tr-s2);}
.tr-pp-meta dt{font-weight:600;color:var(--tr-grey-700);}
.tr-pp-meta dt::after{content:":";}
.tr-pp-meta dd{margin:0;}
.tr-pp-meta a{color:var(--tr-grey-700);text-decoration:underline;text-underline-offset:2px;}

/* ══ Tabs (Opis / Podatki / Mnenja) ══ */
.tr-pp-panel{outline-offset:4px;}
.tr-pp .shop_attributes{font-size:var(--tr-fs-14);}
.tr-pp .shop_attributes th{width:40%;padding:var(--tr-s3) var(--tr-s4);border-bottom:var(--tr-border);text-align:left;vertical-align:top;font-weight:600;color:var(--tr-grey-700);background:var(--tr-grey-50);}
.tr-pp .shop_attributes td{padding:var(--tr-s3) var(--tr-s4);border-bottom:var(--tr-border);text-align:left;vertical-align:top;color:var(--tr-ink);}
.tr-pp .shop_attributes p{margin:0;}

/* GPSR »Proizvajalec in varnost« (inc/gpsr.php): under the Podatki table, or alone in its own Varnost tab */
.tr-gpsr{margin-top:var(--tr-s6);padding-top:var(--tr-s5);border-top:var(--tr-border);}
.tr-pp-panel > .screen-reader-text + .tr-gpsr{margin-top:0;padding-top:0;border-top:0;} /* own tab: only the hidden h2 above it */
.tr-gpsr-title{margin:0 0 var(--tr-s4);font-size:var(--tr-fs-18);line-height:var(--tr-lh-tight);color:var(--tr-ink);}
.tr-gpsr-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--tr-s4) var(--tr-s5);font-size:var(--tr-fs-14);line-height:var(--tr-lh);color:var(--tr-grey-700);}
.tr-gpsr-list dt{margin-bottom:var(--tr-s1);font-weight:600;color:var(--tr-ink);}
.tr-gpsr-list dd{margin:0;}
.tr-gpsr-list a{color:var(--tr-grey-700);text-decoration:underline;text-underline-offset:2px;}
.tr-gpsr-sub{margin:var(--tr-s5) 0 var(--tr-s2);font-size:var(--tr-fs-15);color:var(--tr-ink);}
.tr-gpsr-warn{display:flex;flex-direction:column;gap:var(--tr-s2);padding-left:var(--tr-s5);list-style:disc;font-size:var(--tr-fs-14);line-height:var(--tr-lh);color:var(--tr-grey-700);}
.tr-gpsr-note{margin:var(--tr-s4) 0 0;font-size:var(--tr-fs-12);color:var(--tr-grey-500);}

/* Reviews (WC template, styled here — WC's icon font is not loaded, stars are masks) */
.tr-pp .woocommerce-Reviews-title{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0;}
.tr-pp .woocommerce-noreviews{font-size:var(--tr-fs-15);color:var(--tr-grey-500);}
.tr-pp .commentlist{display:flex;flex-direction:column;gap:var(--tr-s4);}
.tr-pp .comment_container{display:flex;gap:var(--tr-s3);}
.tr-pp .comment_container .avatar{flex:none;width:40px;height:40px;border-radius:50%;}
.tr-pp .comment-text{flex:1 1 auto;min-width:0;padding:var(--tr-s4);border:var(--tr-border);border-radius:var(--tr-r-lg);}
.tr-pp .comment-text .meta{margin:var(--tr-s1) 0 var(--tr-s2);font-size:var(--tr-fs-13);color:var(--tr-grey-500);}
.tr-pp .comment-text .description{font-size:var(--tr-fs-15);color:var(--tr-grey-700);}
.tr-pp #review_form_wrapper{margin-top:var(--tr-s5);}
.tr-pp .comment-reply-title{display:block;margin-bottom:var(--tr-s3);font-size:var(--tr-fs-18);font-weight:700;}
.tr-pp .comment-form{display:flex;flex-direction:column;gap:var(--tr-s4);}
.tr-pp .comment-notes{font-size:var(--tr-fs-13);color:var(--tr-grey-500);}
.tr-pp .comment-form .required{color:var(--tr-red-ink);}
.tr-pp .form-submit{margin:0;}
.tr-pp p.stars{display:flex;gap:var(--tr-s1);margin:0;}
.tr-pp p.stars span{display:flex;gap:var(--tr-s1);}
.tr-pp p.stars a{--tr-pp-star-m:var(--tr-pp-star-line);--tr-pp-star-c:var(--tr-grey-500);display:block;width:24px;height:24px;overflow:hidden;color:transparent;text-indent:-999em;white-space:nowrap;background:var(--tr-pp-star-c);-webkit-mask:var(--tr-pp-star-m) center / 24px 24px no-repeat;mask:var(--tr-pp-star-m) center / 24px 24px no-repeat;transition:background-color var(--tr-t) var(--tr-ease);}
.tr-pp p.stars:hover a{--tr-pp-star-m:var(--tr-pp-star-fill);--tr-pp-star-c:var(--tr-star);}
.tr-pp p.stars:hover a:hover ~ a{--tr-pp-star-m:var(--tr-pp-star-line);--tr-pp-star-c:var(--tr-grey-500);}
.tr-pp p.stars.selected a{--tr-pp-star-m:var(--tr-pp-star-fill);--tr-pp-star-c:var(--tr-star);}
.tr-pp p.stars.selected a.active ~ a{--tr-pp-star-m:var(--tr-pp-star-line);--tr-pp-star-c:var(--tr-grey-500);}

/* ══ Related: 4 cards under a hairline ══ */
.tr-pp-related{margin-top:var(--tr-s8);padding-top:var(--tr-s8);border-top:var(--tr-border);}
.tr-pp-related .tr-sh-title{font-size:var(--tr-fs-28);} /* below the product h1 (--tr-fs-h2) in the hierarchy */

/* ══ Mobile sticky add-to-cart bar (≤768): thumb · name + price · button; sits on top of the tab bar ══ */
.tr-sticky-add{position:fixed;left:0;right:0;bottom:calc(var(--tr-tabbar-h) + env(safe-area-inset-bottom,0px));z-index:var(--tr-z-sticky);display:none;align-items:center;gap:var(--tr-s3);height:var(--tr-sticky-h);padding:0 var(--tr-gutter);background:var(--tr-white);border-top:var(--tr-border);box-shadow:0 -8px 24px color-mix(in srgb,var(--tr-black) 8%,transparent);visibility:hidden;transform:translateY(100%);transition:transform var(--tr-t-slow) var(--tr-ease),visibility 0s linear var(--tr-t-slow);}
.tr-sticky-add.is-visible{visibility:visible;transform:none;transition-delay:0s;}
.tr-sticky-add-thumb{flex:none;width:48px;height:48px;border-radius:var(--tr-r);background:var(--tr-grey-50);overflow:hidden;}
.tr-sticky-add-thumb img{width:100%;height:100%;object-fit:contain;padding:4px;mix-blend-mode:multiply;}
.tr-sticky-add-info{flex:1 1 0;min-width:112px;display:flex;flex-direction:column;gap:2px;} /* basis 0 + min 112px: on a 320px phone the name keeps ~7 rem and the button gives way (it wraps to two lines, below) instead of squeezing the name to 70px */
.tr-sticky-add-name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-size:var(--tr-fs-13);font-weight:600;line-height:1.2;color:var(--tr-ink);} /* two lines (72px bar: 2×16 + price 18) of whole words, the clamp ellipsis ends line 2; overflow-wrap only for a single word wider than the column */
.tr-sticky-add-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--tr-s1);max-height:calc(var(--tr-fs-15) * 1.2);overflow:hidden;font-size:var(--tr-fs-15);font-weight:800;line-height:1.2;color:var(--tr-ink);} /* ONE line (max-height = its line box): the current price always shows; »z DDV«, a struck-through price or anything else that no longer fits wraps to line 2 and is clipped whole instead of pushing the column out of the 72px bar */
.tr-sticky-add-from{order:-2;font-size:var(--tr-fs-13);font-weight:400;color:var(--tr-grey-500);} /* »od« / »from« before a variable product's lowest price (woocommerce/single-product.php), same as .tr-card-price-from */
.tr-sticky-add-price ins{order:-1;color:var(--tr-red-ink);}
.tr-sticky-add-price .tr-omnibus{display:none;} /* the Omnibus note stays with the main price in the summary; a third line never fits the bar */
.tr-sticky-add-price:has(.tr-omnibus) del{display:none;} /* …and without its note the bar shows no struck-through reference price either */
.tr-sticky-add-price del{font-size:var(--tr-fs-12);font-weight:400;color:var(--tr-grey-500);}
.tr-sticky-add-btn{flex:0 1 auto;white-space:normal;line-height:1.15;} /* shrinks only when the name would drop below its minimum (≈320px phones): the label wraps to two lines inside the 44px button */

/* ══ Responsive ══ */
@media (min-width:769px) and (max-width:1024px){
  .tr-pp-related .tr-card-grid{grid-template-columns:repeat(4,minmax(0,1fr));} /* samo tablica: 4 kartice; pod 768 velja 2-stolpčno pravilo iz components.css */
}
@media (max-width:1024px){
  .tr-pp-grid{gap:var(--tr-s6);}
  .tr-pp-media{position:static;}
}
@media (max-width:768px){
  .tr-pp{padding-top:var(--tr-s4);}
  .tr-pp-grid{grid-template-columns:minmax(0,1fr);gap:var(--tr-s5);}
  .tr-gallery-main{aspect-ratio:auto;width:100%;height:min(75vw,60vh,480px);} /* one column: a 1:1 well would fill the whole first screen (736px at 768). 16. 11. 2026: prej 4:3 + max-height → pri 768 px širina 640 in prazen pas desno; zdaj polna širina, slika (contain) na sredini */
  .tr-pp-below{margin-top:calc(var(--tr-s5) + var(--tr-s4));} /* former row-gap s5 + margin s4 */
  .tr-pp .product_title{font-size:var(--tr-fs-28);}
  .tr-pp-related .tr-sh-title{font-size:var(--tr-fs-24);}
  .tr-pp-summary > .price{font-size:var(--tr-fs-20);}
  .tr-pp-related{margin-top:var(--tr-s7);padding-top:var(--tr-s7);}
  .tr-pp p.stars a{width:44px;height:44px;} /* tap target; the 24px glyph stays centred by the mask */
  .tr-sticky-add{display:flex;}
  /* FAB / cookie lift contract (components.css): tab bar + this bar while it is shown (tokens.css --tr-tabbar-h / --tr-sticky-h) */
  body.single-product.tr-sticky-on{--tr-fab-lift:calc(var(--tr-tabbar-h) + var(--tr-sticky-h));padding-bottom:calc(var(--tr-tabbar-h) + var(--tr-sticky-h) + env(safe-area-inset-bottom,0px));}
  /* While the bar is up the two FABs would hover over the description text (3 bars + 2 circles ≈ 45 % of a phone screen) */
  body.single-product.tr-sticky-on .tr-fab{opacity:0;visibility:hidden;pointer-events:none;}
  /* Open cookie banner: the bar yields (banner + bar + tab bar would pin 39 % of the viewport) and the lift drops back to the tab bar */
  body.single-product:has(.tr-cookie-banner.tr-cookie-open) .tr-sticky-add{visibility:hidden;transform:translateY(100%);}
  body.single-product.tr-sticky-on:has(.tr-cookie-banner.tr-cookie-open){--tr-fab-lift:var(--tr-tabbar-h);}
}
@media (max-width:480px){
  /* Stepper + button stay on ONE row (358px column at 390: 136 + 12 + ~190); the button wraps to a full-width
     second row only where it no longer fits beside the stepper (~≤360px phones) — content-sized basis, not 100 %. */
  .tr-buy-row{flex-wrap:wrap;}
  .tr-buy-row .tr-qty-btn{width:44px;} /* row height stays 52 (base rule) so both controls share their edges */
  .tr-atc-btn{flex:1 1 auto;padding:0 var(--tr-s3);}
  .tr-atc-btn svg{display:none;} /* cart icon + 22px padding would push the button onto its own row at 390 */
  .tr-gallery-main{aspect-ratio:1 / 1;max-height:none;} /* phones: the photo is the content — full square well again */
  .tr-gallery-thumb{width:64px;height:64px;}
  .tr-sticky-add-btn{padding:0 var(--tr-s3);}
  .tr-sticky-add-price del{display:none;} /* reclaim width for the two-line name */
}
