/* UX fixes 2026-11-22 – shop, product pages, home, header (inc/ux-1122-shop.php). Owner approved.
   Loaded after the theme styles; css/v3.css can arrive later without blocking, so the rules carry !important where they
   must win over it. Dark mode (html[data-theme=dark]) is left as it is. */

/* 1. Product cards: same photo box, title at most 2 lines (2 lines reserved), price + button at the bottom of the card,
      so cards in a row line up on desktop and phones have no blank gap between title and price. */
html body.v3 .v3-card{height:100%}
html body.v3 .v3-card>.v3-card__media{aspect-ratio:4/5!important;flex:none}
html body.v3 .v3-card>.v3-card__title{min-height:calc(2.8em + 8px)!important}
html body.v3 .v3-card>.v3-card__title a{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
html body.v3 .v3-card>.v3-card__title .sm-name-sub{display:inline!important}
html body.v3 .v3-card>.v3-card__price{margin-top:auto!important}
html body.v3 .v3-card:has(>.v3-card__sale)>.v3-card__sale{margin-top:auto!important}
html body.v3 .v3-card:has(>.v3-card__sale)>.v3-card__price{margin-top:0!important}
html body.v3 .v3-card>.v3-card__row{margin-top:0!important}
:is(.col-6,.col-xs-6,[class*="col-md-"],[class*="col-lg-"])>.v3-card{height:100%}

/* 2. Tour sale note wraps on phones („tik pirmoms 5 vietoms, kitos – 25 €“, home pill „Pirklio malonė · 20 € / asm. · tik pirmoms 5 vietoms →“) */
html body.v3 #events-list .event-item .event-price{min-width:0;white-space:normal!important}
html body.v3 .sm-ev-salenote{white-space:normal!important;overflow-wrap:anywhere}
html body.v3 .v4-tour__dates li span.v4-tour__deal{display:inline-block;max-width:100%;line-height:1.4;white-space:normal!important}
html body.v3 .v4-tour__deal :is(s,.sm-tss-n,b){white-space:nowrap!important}

/* 3. Sale badge with the percent („Pirklio malonė −46 %“) – one line */
html body.v3 .v3-card .v3-card__media .v3-badge{max-width:calc(100% - 16px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:760px){
  html body.v3 .v3-card .v3-card__media .v3-badge{font-size:11.5px!important;letter-spacing:.02em!important;padding-left:9px;padding-right:9px}
}

/* 4. Variable goods: „nuo 19 € 35 €“ – the reduced price first, the old one after it, smaller */
html body.v3 .price .sm-from+ins,html body.v3 .v3-card__price .sm-from+ins{margin-right:6px}
html body.v3 .price ins+del,html body.v3 .v3-card__price ins+del{margin:0 0 0 2px!important}

/* 5. Rating-only reviews: stars, no empty quote */
html body.v3 .review-block .review-stars{margin:0 0 8px;font-size:18px;line-height:1;letter-spacing:2px;color:#8E4E58}
html[data-theme="dark"] body.v3 .review-block .review-stars{color:#E2A99A}

/* 6. Desktop home: the chapter bar starts right of „Didesnės raidės“ (left 18 px + 174 px) and ends before the „to top“ arrow */
@media (min-width:961px){
  html body.v4 .v4-toc{left:206px!important;right:88px!important;width:auto!important;max-width:none!important;transform:translateY(24px)}
  html body.v4 .v4-toc.is-on{transform:none!important}
  html body.v4 .v4-toc ol{-webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 28px),transparent)}
  html body.v4 .v4-toc ol:has(li:last-child a.is-active){-webkit-mask-image:none;mask-image:none}
  html body.v4 .v4-toc a{padding:9px 11px;gap:6px}
  html body.v4 .v4-toc .v4-toc__l{font-size:13.5px!important;letter-spacing:.02em}
}

/* 7. Sections appear while scrolling: 200 ms (js/v3.js starts it 300 px early); product cards, tiles and tour dates
      (photos and prices) never start invisible. */
@media (prefers-reduced-motion:no-preference){
  html.v3-js body .m-up:not(.m-split){transform:translateY(10px);transition:opacity .2s ease,transform .2s ease!important;transition-delay:calc(var(--d,0) * 30ms)!important}
  html.v3-js body .m-split .m-wi{transition:transform .2s ease,opacity .2s ease!important;transition-delay:calc(var(--l,0) * 40ms)!important}
  html.v3-js body .m-media{transition:clip-path .2s ease,opacity .2s ease!important}
  html.v3-js body .m-media img{transition:transform .2s ease!important}
  html.v3-js body .m-img-solo{transition:opacity .2s ease,transform .2s ease!important}
}
html.v3-js body :is(.v3-card,.v4-pick,.v3-tile,.v4-tour__dates li,.v3-dates li).m-up{opacity:1!important;transform:none!important;transition:none!important}

/* 8. No near-black sections in the light theme (owner rule): deep rose #5E2F37 with light text (≥ 4.5:1). */
html:not([data-theme="dark"]) body .v4-occ.v4-occ--crown{background-color:#5E2F37!important;background-image:radial-gradient(ellipse at 50% 26%,rgba(183,110,121,.34),transparent 55%),radial-gradient(ellipse at 50% 120%,rgba(142,78,88,.5),transparent 60%)!important}
html:not([data-theme="dark"]) body .v4-occ.v4-occ--town{background:#5E2F37 radial-gradient(ellipse at 72% 55%,rgba(255,217,160,.12),transparent 58%)!important}
html:not([data-theme="dark"]) body .v4-occ.v4-occ--town::before,html:not([data-theme="dark"]) body .v4-occ.v4-occ--town::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='40' viewBox='0 0 96 40'%3E%3Crect width='96' height='40' fill='%238E4E58'/%3E%3Cpath d='M0 4h96M0 36h96' stroke='%23f6efe2' stroke-width='2.5'/%3E%3Cpath d='M0 14l12-6 12 6 12-6 12 6 12-6 12 6 12-6 12 6' fill='none' stroke='%23f6efe2' stroke-width='2'/%3E%3Cpath d='M24 16l3 6 6 3-6 3-3 6-3-6-6-3 6-3z' fill='%23f6efe2'/%3E%3Cpath d='M72 17l7 8-7 8-7-8z' fill='%23f6efe2'/%3E%3Cpath d='M72 21l3.500 4-3.500 4-3.500-4z' fill='%235E2F37'/%3E%3C/svg%3E")!important}
html:not([data-theme="dark"]) body .v4-occ.v4-occ--town .v4-occ__line{color:#EBDDD6!important}
html:not([data-theme="dark"]) body .v4-oracle{background-color:#5E2F37!important;background-image:var(--noise),radial-gradient(circle at 20% 20%,rgba(183,110,121,.3),transparent 60%)!important}
html:not([data-theme="dark"]) body .sm-rt.sm-rt--dark{background-color:#5E2F37!important;background-image:var(--noise),radial-gradient(circle at 78% 30%,rgba(183,110,121,.3),transparent 58%),radial-gradient(circle at 12% 85%,rgba(183,110,121,.16),transparent 50%)!important}
html:not([data-theme="dark"]) body.v3 .page-header{background-color:#5E2F37!important}
html:not([data-theme="dark"]) body.v3 .page-header .ph-deco{background:linear-gradient(180deg,rgba(94,47,55,0) 0%,rgba(94,47,55,.84) 100%)!important}

/* 9. Product page on phones: one header row (the „Krautuvėlė / Patyrimai“ pills are in the menu and the tab bar elsewhere);
      the promo bar folds on scroll (html.v3-scrolled), the buy bar comes after the page's own button (js/v3.js). */
@media (max-width:760px){
  html body.v3.single-product:not(.v3-has-tabbar) .v3-header .v3-header__in{grid-template-rows:56px!important;padding-bottom:0!important}
  html body.v3.single-product:not(.v3-has-tabbar) .v3-header .v3-icons .v3-shoplink{display:none!important}
}

/* 10. Phone tab bar: labels fit at 390 px and in Latvian („PIEDZĪVOJUMI“) – 10 px, no letter spacing, „…“ when still too long */
@media (max-width:960px){
  html body.v3 .v3-tabbar .v3-tabbar__i{min-width:0;padding-left:2px;padding-right:2px}
  html body.v3 .v3-tabbar .v3-tabbar__i>span{display:block;max-width:100%;font-size:10px!important;letter-spacing:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html body.v3 .v3-tabbar .v3-tabbar__i--cart .v3-tabbar__n{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#8E4E58!important;color:#fff!important;font:700 11px/18px Barlow,"Barlow Fallback",sans-serif!important;text-align:center;box-shadow:0 0 0 2px #FBF6F2}
}

/* 11. Search suggestions: corrected words („Rodoma: …“) and „Ieškoti visur →“ */
html body.v3 .v3-sugg .v3-sugg__fixed{margin:0;padding:8px 14px 4px;font-size:13px;font-style:italic;color:#6F5C58}
html[data-theme="dark"] body.v3 .v3-sugg .v3-sugg__fixed{color:#E3CFC8}

/* 12. Phone tap areas ≥ 44 px without changing the look: colour dots (22 px), popup close (28 px) */
html body.v3 .v3-card__colors{gap:10px}
html body.v3 .v3-card__colors .v3-cdot::after{inset:-11px!important}
html body .xoo-cp-close::after{content:"";position:absolute;inset:-8px}
/* gallery dots already have a 44 px ::after hit area (product-gallery.css) */

/* 13. Contrast and tiny text */
html:not([data-theme="dark"]) body.v3 .sm-reviews-summary .rating-stars,html:not([data-theme="dark"]) body.v3 .v3-card__rating span,html:not([data-theme="dark"]) body.v3 .star-rating span::before{color:#8E4E58!important}
html body.v3 .sm-per{font-size:max(12px,.6em)!important}
@media (max-width:760px){
  html body.v3 .v3-header .v3-logo.v3-logo--crest .v3-logo__word.v3-logo__word{font-size:12px!important;letter-spacing:.16em!important;margin-right:-.16em!important;white-space:nowrap}
  html body.v3 .v3-header .v3-hdr-guide .v3-hdr-guide__long{font-size:12px!important;letter-spacing:0!important}
}
@media (max-width:380px){ /* narrow phones: no room for both at 12 px */
  html body.v3 .v3-header .v3-logo.v3-logo--crest .v3-logo__word.v3-logo__word{font-size:11px!important;letter-spacing:.12em!important;margin-right:-.12em!important}
}
html:not([data-theme="dark"]) body .rfp h2 i,html:not([data-theme="dark"]) body .rfp h3 i{color:#8E4E58!important}
html:not([data-theme="dark"]) body .rfp :is(.rfp-hero,.rfp-set,.rfp-ch--sale,.rfp-foot) :is(h1,h2,h3) i{color:#EBCBBE!important}
