/* Kilim additions to the template CSS (app.css stays the template's, so a new template version can replace it as is). */

/* Real photos of round rugs have background corners; the template's pictures were cut out. */
.rugimg--round img { border-radius: 50%; }

/* Accessibility (tools/a11y, axe-core): white 11–12 px bold text needs 4.5:1; the template's coral
   #e0492c gives 4.07, this one 4.79. Only where white text sits on coral (stickers, count badges). */
.sticker--coral, .badge { background: #cf3f1f; }
.cart-pill .badge { background: var(--c-sun); }
/* The cart button's "Krepšelis": hidden on phones like the template's .cart-pill__label, but still
   read by screen readers, so the button keeps its name. */
@media (max-width: 1023px) {
  .cart-pill__text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}

/* Checkout: what changed in the cart since the rugs were added, each with its fix. */
.co-changes { margin: 6px 0 10px; padding-left: 18px; }
.co-changes li + li { margin-top: 4px; }

/* Category bar: entries that do not fit move under "Daugiau" (storefront.js fitCatnav). */
.catnav { position: relative; }
.catnav__row.is-fit { overflow: visible; }
.catnav__entry[hidden], .catnav__more[hidden] { display: none; }
.catnav__more { flex-shrink: 0; }
.catnav__more[aria-expanded="true"] svg { transform: rotate(180deg); }
.catnav__menu { position: absolute; z-index: 40; top: calc(100% - 4px); left: var(--x, 0); transform: translateX(-100%); display: grid; gap: 2px; width: max-content; min-width: 220px; max-width: calc(100vw - 32px); margin: 0; padding: 8px; list-style: none; background: var(--c-bg); border: 2px solid var(--c-line); border-radius: 14px; box-shadow: 0 12px 30px rgb(0 0 0 / .12); }
.catnav__menu[hidden] { display: none; }
.catnav__menu .catnav__link { width: 100%; }

/* Size guide: a hint under one field does not push its neighbour's box out of line. */
.wiz .row2 { align-items: start; }

/* Product gallery: the whole picture fits (no cropping, no scrolling to see it), arrows to the next one. */
.gallery__slide .ph img { object-fit: contain; }
@media (min-width: 1024px) { .gallery__slide { max-height: calc(100svh - 190px); } }
/* The stage grid's auto row would grow to a tall rug's picture and overflow the clamped slide: its one cell is the slide's inner box. */
.stage { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.gallery__nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border: 2px solid var(--c-ink); border-radius: 50%; background: rgba(255,255,255,.92); color: var(--c-ink); cursor: pointer; }
.gallery__nav--prev { left: var(--s-3); }
.gallery__nav--next { right: var(--s-3); }
.gallery__nav:hover, .gallery__nav:focus-visible { background: var(--c-sun); }

/* Home collections: the whole rug is shown (rug photos are portrait, the frames landscape). */
.col__img .ph img { object-fit: contain; }

/* Product page: "Ar galima gauti nuolaidą?" (dialog in storefront.js askDiscount). */
.ask-discount { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-sm); color: var(--c-ink); }
.discount-form { display: grid; gap: var(--s-3); }

/* Social links: footer icons and the banner on the product page. */
.ftr__social { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.ftr__social a { display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid currentColor; border-radius: 50%; color: inherit; }
.ftr__social a:hover, .ftr__social a:focus-visible { background: var(--c-sun); color: var(--c-ink); border-color: var(--c-sun); }
.social-banner { display: grid; gap: var(--s-2); padding: var(--s-4); border: 2px solid var(--c-line); border-radius: var(--r); background: var(--c-surface); }
.social-banner__logo { height: 28px; width: auto; }
.social-banner__text { margin: 0; font-size: var(--fs-sm); }
.social-banner__links { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; }

/* Non-ASCII text in CSS as escapes: it shows right whatever charset the stylesheet is served with. */
.crumbs li:not(:last-child)::after { content: "\2192"; }
.ph.is-broken::after, .rugimg.is-broken::after { content: "Nuotrauka nei\012F sik\0117 l\0117"; }

/* Zoom layer: the picture opens whole (phones too); a double click / double tap zooms (openZoom). */
.zoom { cursor: zoom-in; touch-action: manipulation; }
.zoom picture { display: contents; }
.zoom img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; width: auto; height: auto; object-fit: contain; }
.zoom.is-zoomed img { max-width: none; max-height: none; }
/* While the large picture loads, a smaller one the browser has stands in at the same place and size. */
.zoom > .zoom-preview, .zoom picture img { grid-area: 1 / 1; }
.zoom > .zoom-preview { width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; object-fit: contain; }
.zoom.is-loading picture img { opacity: 0; }
.zoom.is-loading::after { content: ""; position: fixed; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: zoom-spin .8s linear infinite; pointer-events: none; }
@keyframes zoom-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .zoom.is-loading::after { animation: none; } }
.zoom-hint { position: absolute; top: var(--s-4); left: var(--s-4); z-index: 2; margin: 0; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(0,0,0,.55); color: #fff; font-size: 13px; pointer-events: none; }
/* Rugs that cannot be bought now (owner 2026-11-28): grey pictures by CSS only (no extra renditions);
   the listing puts them last, the product page keeps only the essentials. */
.card.is-out .card__img { opacity: .75; filter: grayscale(1); }
.pdp--gone .gallery__track img, .pdp--gone .gallery__thumbs img { filter: grayscale(1); opacity: .8; }
.pdp--gone .buy__title { color: var(--c-ink-2); }
/* Rug on its tint (cart line, checkout summary, saved list, comparison; QA 2026-11-29): a tall runner
   picture grew out of the box because the grid row sized itself to the picture; one bounded cell keeps it inside. */
.tinted { grid-template: minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; }
.tinted .rugimg { max-width: 100%; max-height: 100%; }

/* Search suggestions sit inside .search__box, whose rule for the magnifier (.search__box .i: absolute,
   left 16px) also caught the "Visi rezultatai" arrow and laid it over the text. */
.search__panel .i { position: static; color: inherit; }

/* Hero rugs (UI/UX audit 2026-11-30): the drop shadow outlined each photo's whole white background as a
   frame, so it is gone. The label shows model and real size at all times (touch has no hover), on one
   line, shortened by the server. */
/* Blending the card with the coloured backdrop would remove the white too, but tints the rug (a black rug
   turns yellow): true colours win; only cut-out covers lose the white entirely. */
.hero-rugs__card img { filter: none; }
.hero-rugs__caption span { display: inline; }
.hero-rugs__card:is(:hover,:focus-visible) .hero-rugs__caption span { display: inline; }
/* With the size always shown the caption may be wider than its card: wrap it rather than widen the page (phones scrolled sideways). */
.hero-rugs__caption { width: max-content; max-width: 100%; white-space: normal; text-align: center; }
.hero-rugs__card:focus-visible { outline: 3px solid #2a211f; outline-offset: 4px; border-radius: 6px; }
.hero-rugs__controls [data-rugs-pause] { font-size: .85rem; }
.hero-shapes { margin-top: 10px; }
.hero-shapes .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hero-shapes .chip { min-height: 40px; display: inline-flex; align-items: center; background: #fffdf8; }

/* Checkout header and footer (audit 2026-11-30): logo, back to the cart, help; no shop navigation. */
.hdr--checkout .hdr__row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 12px; }
.hdr--checkout .logo img { height: 36px; width: auto; }
.hdr-co__nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.hdr-co__nav .link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.ftr-co { padding: 24px 0 32px; border-top: 1px solid var(--line, #e5ddd2); margin-top: 40px; }
.ftr-co a { color: inherit; }
.buy__ship { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; }

/* Catalog (audit 2026-11-30): quick filter chips show when their filter is on; the desktop filter column
   scrolls with the page instead of in its own box, so the main groups are not hidden in a nested scroll. */
.catalog-shortcuts .chip--on { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.catalog-shortcuts .chip .i-sm { width: 14px; height: 14px; }
@media (min-width: 1024px) { .filters-desktop { position: static; max-height: none; overflow: visible; } }

/* Cart line notes (price change, quantity, sold): under the whole line, not squeezed into the name column (PM 2026-11-30). */
.line__issue { grid-column: 1 / -1; margin: 0; }
.line__issue > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.line__issue > div > p { margin: 0; }

/* Listing under a size filter: the matching size's stock on the card (PM 2026-11-30). */
.card__stock { margin: 2px 0 0; font-size: var(--fs-xs); font-weight: 700; color: var(--c-ink-2); }
.card__stock--out { color: #8a3b12; }
.active-filters__note { margin: 4px 0 0; }

/* "Kilimas parduotas prieš N min." pop-up (owner 2026-11-30, RecentSales): bottom left, above the tab bar. */
.sales-pop { position: fixed; z-index: 300; left: var(--s-3); bottom: calc(var(--s-3) + var(--safe-b) + var(--tab-h)); max-width: min(360px, calc(100vw - 2 * var(--s-3))); display: flex; align-items: flex-start; gap: var(--s-2); padding: var(--s-3); background: var(--c-surface); color: var(--c-ink); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-2); opacity: 0; transform: translateY(12px); transition: opacity .3s ease, transform .3s ease; }
.sales-pop.is-on { opacity: 1; transform: none; }
.sales-pop__link { display: flex; align-items: center; gap: var(--s-3); color: inherit; text-decoration: none; min-width: 0; }
.sales-pop__link img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-xs); flex: none; background: var(--c-line); }
.sales-pop__link > span { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-sm); line-height: 1.35; }
.sales-pop__kicker, .sales-pop__time { color: var(--c-ink-2); font-size: var(--fs-xs); }
.sales-pop__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sales-pop__link:hover .sales-pop__name, .sales-pop__link:focus-visible .sales-pop__name { text-decoration: underline; }
.sales-pop__close { flex: none; width: 32px; height: 32px; display: grid; place-items: center; margin: calc(-1 * var(--s-1)) calc(-1 * var(--s-1)) 0 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.sales-pop__close:hover { background: var(--c-line); }
@media (prefers-reduced-motion: reduce) { .sales-pop { transition: none; transform: none; } }

/* Product page share links (PM 2026-11-30). */
.share { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; }

/* Newsletter form (spec 2026-11-30): footer block, page, pop-ups. */
.nl-form { display: grid; gap: var(--s-2); }
.nl-form .field { margin: 0; }
.nl-form__row { display: grid; gap: var(--s-2); grid-template-columns: minmax(0, 1fr); align-items: start; }
/* The button stays next to the input when an error appears under it (label height + field gap). */
@media (min-width: 600px) { .nl-form__row { grid-template-columns: minmax(0, 1fr) auto; } .nl-form__btn { margin-top: calc(var(--fs-sm) * 1.55 + 6px); } }
.nl-form__btn { min-height: var(--tap); }
.nl-form__btn[aria-disabled="true"] { opacity: .75; cursor: progress; }
.nl-form__note { margin: 0; font-size: var(--fs-xs); color: var(--c-ink-3); }
.nl-form__status { margin: 0; font-weight: 600; }
.nl-form__status.is-err { color: var(--c-err); }
.nl-form__status:focus { outline: none; }
.nl-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nl-page__form { max-width: 520px; margin: var(--s-5) auto 0; text-align: left; }
.ftr__nl { display: grid; gap: var(--s-4); padding-bottom: var(--s-6); margin-bottom: var(--s-6); border-bottom: 1px solid #3b3650; }
@media (min-width: 1024px) { .ftr__nl { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: var(--s-6); } }
.ftr .ftr__nl-h { font: 800 var(--fs-xl)/1.2 var(--f-display); color: #fff; letter-spacing: -.01em; text-transform: none; margin: 0 0 var(--s-2); }
.ftr__nl p { margin: 0; }
.ftr .nl-form label { color: #fff; }
.ftr .nl-form__note, .ftr .nl-form__status { color: #cfc9dc; }
.ftr .nl-form__note a { text-decoration: underline; }
.ftr .nl-form .field__err, .ftr .nl-form__status.is-err { color: #ffb4ab; }
.ftr .nl-form .check input { accent-color: var(--c-sun); }
.ftr .nl-form input:focus-visible { box-shadow: 0 0 0 4px rgba(255, 178, 56, .8); }

/* Pop-up campaigns: modal / bottom sheet (layers) and the non-modal corner block / bar. */
.pop { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.pop__close { position: absolute; top: var(--s-2); right: var(--s-2); z-index: 1; min-width: 44px; min-height: 44px; background: var(--c-surface); border-radius: 50%; }
.pop__img img { display: block; width: 100%; height: 100%; max-height: 220px; object-fit: cover; object-position: var(--pop-fm, center); }
.pop__body { padding: var(--s-5); padding-top: var(--s-5); display: grid; gap: var(--s-3); }
.pop__title { font: 800 var(--fs-xl)/1.2 var(--f-display); margin: 0; padding-right: 44px; }
.pop__img + .pop__body .pop__title { padding-right: 0; }
.pop__text, .pop__terms, .pop__code, .pop__actions, .pop__dismiss, .pop__success { margin: 0; }
.pop__terms { font-size: var(--fs-xs); color: var(--c-ink-3); }
.pop__success { font-weight: 600; }
.pop__success:focus { outline: none; }
.pop-panel { overflow: auto; }
.pop-panel.panel--bottom { padding-bottom: calc(var(--safe-b) + var(--kb, 0px)); }
@media (min-width: 720px) {
  .pop-panel.panel--center { width: min(720px, calc(100vw - 32px)); }
  .pop-panel .pop:has(.pop__img) { grid-template-columns: 280px minmax(0, 1fr); }
  .pop-panel .pop__img img { max-height: none; min-height: 100%; object-position: var(--pop-fd, center); }
}
.pop-float { position: fixed; z-index: 290; background: var(--c-bg); color: var(--c-ink); border: 1px solid var(--c-line); box-shadow: var(--sh-2); animation: slideU var(--t-slow) var(--ease); }
.pop-float--corner { right: var(--s-4); bottom: calc(var(--s-4) + var(--safe-b)); width: min(360px, calc(100vw - 32px)); border-radius: var(--r-lg); overflow: hidden; }
.pop-float--corner .pop__img img { max-height: 160px; object-position: var(--pop-fd, center); }
.pop-float--bar { left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + var(--kb, 0px)); border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 60dvh; overflow: auto; }
.pop-float--bar .pop__img { display: none; }
.pop-float--bar .pop__body { padding: var(--s-4); gap: var(--s-2); }
.pop-float--bar .pop__title { font-size: var(--fs-lg); }

/* Product page (PM 2026-12-01): the details are in the .pdp grid. Desktop: gallery and details in the left
   column, the buy column spans both rows; row 2 is 1fr so a taller buy column grows it, not the gallery row. */
.pdp > .pdp-details { margin-top: var(--s-6); }
@media (max-width: 1023px) { .pdp > .pdp-details { order: 4; } }
@media (min-width: 1024px) {
  .pdp { grid-template-rows: auto 1fr; }
  .pdp > .gallery { grid-column: 1; grid-row: 1; }
  .pdp > .buy { grid-column: 2; grid-row: 1 / span 2; }
  .pdp > .pdp-details { grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr); margin-top: var(--s-4); }
}
