/* Globální styly aplikace — extrahováno z layout.php <style> (F3).
   Zahrnuje :root tokeny, filtrační pilulky, karty nabídek, srovnávací tabulky,
   košík badge, modaly variant a kontrastní opravy (A1). */

:root {
    --pico-font-size: 16px;
    /* Sdílené tokeny košíku (globální, ať jsou dostupné i mimo cart.php) */
    --cx-surface:#fff; --cx-bg:#f3f4f6; --cx-line:#e5e7eb; --cx-ink:#16181d;
    --cx-muted:#6b7280; --cx-save:#15803d; --cx-save-bg:#e9f7ef;
    --cx-radius:14px; --cx-shadow:0 1px 2px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.06);
    /* Systémový display stack — bez externí závislosti (dřív Google Fonts Bricolage) */
    --cx-display: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    /* Ztmavený jantar pro TEXT a aktivní výplně (A1) — projde ~4.8:1 s bílým textem.
       --cx-amber-line zůstává dekorativní (≥3:1). */
    --cx-amber:#8a6500; --cx-amber-line:#f5b400;
}
@media (prefers-color-scheme: dark) {
    :root {
        --cx-surface:#1b2330; --cx-bg:#11161e; --cx-line:#2c3645; --cx-ink:#e8ebf0;
        --cx-muted:#97a1b0; --cx-save:#4ade80; --cx-save-bg:rgba(74,222,128,.14);
    }
}
[data-theme="dark"] {
    --cx-surface:#1b2330; --cx-bg:#11161e; --cx-line:#2c3645; --cx-ink:#e8ebf0;
    --cx-muted:#97a1b0; --cx-save:#4ade80; --cx-save-bg:rgba(74,222,128,.14);
}

/* Respekt k uživatelské preferenci omezeného pohybu (A7) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* Obsahové/textové odkazy → teal TEXT role (AA i v dark: light #0F766E, dark #14B8A6).
   Přepisujeme proměnnou --pico-color, kterou čte Pico základní pravidlo
   :where(a:not([role=button])) (specificita 0) → hover chování (--pico-primary-hover)
   i komponentní odkazy s vlastní barvou (.sr-card__name a, .kl-tabs a, …) zůstávají. */
a:not([role=button]) { --pico-color: var(--brand-teal-text); }

nav .brand { font-weight: bold; font-size: 1.2em; text-decoration: none; }
/* Mobil: brand se nesmí roztáhnout přes celou navigaci */
@media (max-width: 560px) {
    nav .brand { font-size: 1.05em; line-height: 1.1; }
    nav > ul:first-child { max-width: 55%; }
}

/* Brand wordmark (nakupujichytře.cz) — logo swap light/dark + beta chip.
   App běží v prefers-auto (nenastavuje data-theme), ale pokrýváme i budoucí toggle. */
.brand { display:flex; align-items:center; gap:.4rem; }
.brand-logo { height:28px; width:auto; display:block; max-width:60vw; }
.brand-logo--dark { display:none; }
@media (prefers-color-scheme: dark) { .brand-logo--light{display:none} .brand-logo--dark{display:block} }
[data-theme=dark] .brand-logo--light{display:none} [data-theme=dark] .brand-logo--dark{display:block}
[data-theme=light] .brand-logo--light{display:block} [data-theme=light] .brand-logo--dark{display:none}
.beta-chip { font-size:.68rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#fff;
  background:var(--brand-teal-fill); border-radius:999px; padding:.1rem .45rem; line-height:1.4; }
/* Logo + beta-chip + pravé nav odkazy se nesmí překrývat na mobilu (ověřeno 320/375/414).
   Levý brand-ul má max-width:55% (ř. 46) → brand se musí vejít, jinak přeteče přes odkazy.
   Proto na úzkých displejích zmenšíme logo, chip i pravé odkazy současně. */
@media (max-width:560px){ .brand-logo{height:22px} }
@media (max-width:400px){
  .brand-logo{ height:18px; }
  .beta-chip{ font-size:.6rem; padding:.08rem .3rem; }
  nav > ul:last-child a{ font-size:.85rem; padding-left:.4rem; padding-right:.4rem; }
  nav > ul:last-child li{ padding-left:.2rem; padding-right:.2rem; }
}

/* Pico .outline tlačítka: label used --pico-primary #0F766E → 3.28:1 v dark (FAIL).
   Přepneme na --brand-teal-text (dark #14B8A6 → AA). Fill/kontrast varianty ponecháme. */
:is(button,[type=submit],[type=button],[role=button]).outline:not(.secondary,.contrast){--pico-color:var(--brand-teal-text);--pico-border-color:var(--brand-teal-text)}

/* Visually-hidden utilita pro čtečky obrazovky */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Skip-link je při fokusu viditelný (A2) */
.sr-only-focusable:focus,
.sr-only-focusable:focus-visible {
    position: static !important;
    width: auto; height: auto;
    margin: 0; padding: .5rem 1rem;
    clip: auto; clip-path: none;
    overflow: visible; white-space: normal;
    display: inline-block;
    background: var(--pico-primary, #0050aa); color: #fff;
    border-radius: 0 0 .35rem 0;
    z-index: 999;
}

/* Globální oznamovač chyb HTMX (4xx/5xx) — viditelný toast + role=alert pro čtečky.
   Prázdný = skrytý (:empty → JS jen nastavuje textContent). Kontrast AA: bílý text
   na tmavě červené #b3261e (~5.9:1). */
.app-error {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(90vw, 32rem);
    z-index: 1000;
    padding: .75rem 1rem;
    background: #b3261e;
    color: #fff;
    border-radius: .5rem;
    box-shadow: var(--cx-shadow);
    font-size: .95rem;
    line-height: 1.35;
    text-align: center;
    word-break: break-word;
}
.app-error:empty { display: none; }

/* Drobné textové utility (F6) */
.u-right { text-align: right; }
.u-inherit { color: inherit; }
.u-nowrap { white-space: nowrap; }
/* Add-to-cart tlačítko v tabulkovém řádku / „přidat vše" (statické, ne plovoucí jako na kartě).
   Dvě-třídní selektor (specificita 0,0,2,0) přebíjí base `.btn-add-cart{position:absolute;opacity:0}`
   (0,0,1,0) NEZÁVISLE na pořadí v souboru → inline i „přidat vše" jsou viditelné na desktopu.
   Base overlay „+" na `.offer-card` (homepage) se těchto selektorů NEtýká → dál fade-in on hover. */
.btn-add-cart.btn-add-cart--inline { position: static; opacity: 1; width: 32px; height: 32px; }
.btn-add-cart.btn-add-all { position: static; opacity: 1; width: auto; height: auto; border-radius: 2rem; padding: 0.3rem 1rem; font-size: 0.85rem; }

/* ===== Sjednocený základ filtračních pilulek ===== */
.store-filter, .category-filter, .tag-filter, .time-filter {
    display: flex; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.store-filter a, .category-filter a, .tag-filter a, .time-filter a {
    display: inline-flex; align-items: center;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    color: var(--pico-muted-color);
}
.store-filter a:hover, .category-filter a:hover, .tag-filter a:hover, .time-filter a:hover {
    border-color: var(--pico-primary); color: var(--brand-teal-text);
}
.store-filter a.active, .category-filter a.active, .tag-filter a.active, .time-filter a.active {
    background: var(--pico-primary); border-color: var(--pico-primary); color: #fff;
}

/* Store filter pills — barevné, o úroveň výraznější */
.store-filter { gap: 0.5rem; }
.store-filter a {
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    border-width: 2px;
    border-color: var(--pico-primary);
    color: var(--brand-teal-text);
}
.store-filter a.active { background: var(--pico-primary); color: #fff; }
/* A1/F-c: na světlém pozadí (zlatý Albert SM #d4a100) tmavý text místo bílého kvůli
   kontrastu. Třída .on-light se přidává servisně (View::onLight dle jasu barvy) —
   nahrazuje křehký selektor [style*="#d4a100"]. !important kvůli inline color:#fff. */
.on-light { color: #332600 !important; }

/* Offer grid */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.offer-card {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.offer-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.offer-img {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.offer-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}
.offer-img--empty { min-height: 80px; }
.offer-body {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.offer-body h3, .offer-body h4 { font-size: 0.9rem; margin: 0; line-height: 1.3; }
.offer-body .meta { font-size: 0.8rem; color: var(--pico-muted-color); }
.offer-price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.4rem; row-gap: 0.1rem; margin-top: auto; padding-top: 0.25rem; }
.offer-price .price { font-size: 1.3rem; font-weight: 800; color: var(--brand-teal-text); letter-spacing: -0.01em; line-height: 1.1; }
.offer-price .meta { font-size: 0.8rem; color: var(--pico-muted-color); flex-basis: 100%; }
.offer-price .old-price { font-size: 0.85rem; text-decoration: line-through; color: var(--pico-muted-color); }
.store-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.02em;
}
/* A1: zlatý Albert SM badge má tmavý text — řeší globální utilita .on-light výše
   (přidává se servisně přes View::onLight). */

/* ===== Nejlevnější na home kartách (U2) ===== */
.offer-cheapest {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem;
    margin-bottom: 0.15rem;
}
.offer-cheapest .cheapest-label {
    font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--cx-save);
}
.offer-cheapest .store-badge {
    box-shadow: 0 0 0 2px var(--cx-save);
}
.offer-more-stores {
    font-size: 0.7rem; color: var(--pico-muted-color); font-weight: 600;
    align-self: center;
}
.offer-price .cheapest-label {
    flex-basis: 100%;
    font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--cx-save);
    line-height: 1;
}

.discount-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    background: var(--pico-del-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}
/* Menší inline varianta slevy do buňky ceny (U4) */
.discount-badge--inline {
    font-size: 0.72rem;
    padding: 0.1rem 0.35rem;
    vertical-align: 0.05em;
    margin-left: 0.25rem;
}
.validity { font-size: 0.75rem; color: var(--pico-muted-color); }
.loyalty-price {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0a6b06;
    background: #e6f5e6;
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
}
/* Malý textový odznak místo holého 🎫 emoji (přístupnější než emoji).
   A1: ztmaveno na #0a6b06 + 700/0.7rem kvůli kontrastu na #d8efd8. */
.loyalty-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0a6b06;
    background: #d8efd8;
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
    vertical-align: 0.05em;
}

/* Štítek/odkaz na historii cen (U5) */
.history-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--pico-muted-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    text-decoration: none;
    line-height: 1.3;
    transition: border-color 0.15s, color 0.15s;
}
.history-chip:hover, .history-chip:focus-visible {
    border-color: var(--pico-primary);
    color: var(--brand-teal-text);
}

/* Zvýraznění nejlevnějšího řádku ve srovnávacích tabulkách (#13) */
.price-table tr.cheapest-row > td { background: var(--cx-save-bg, #e9f7ef); }
.price-table tr.cheapest-row > td:first-child { box-shadow: inset 3px 0 0 var(--cx-save, #15803d); }
.cheapest-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: #15803d; /* fixní tmavě zelená + bílá ~5:1 AA v light I dark; NE var(--cx-save) (dark #4ade80+bílá ~1,7:1 padá AA) */
    padding: 0.08rem 0.4rem;
    border-radius: 0.2rem;
    white-space: nowrap;
}

/* Price comparison table */
.price-table { width: 100%; }
.price-table .offer-thumb { max-width: 300px; max-height: 300px; height: auto; object-fit: contain; border-radius: 4px; mix-blend-mode: multiply; }
.price-table .price { font-weight: bold; font-size: 1.1rem; }
.price-table .old-price { text-decoration: line-through; color: var(--pico-muted-color); font-size: 0.85rem; }
.price-table .discount { color: var(--pico-del-color); font-weight: bold; }
.price-table .validity { font-size: 0.8rem; color: var(--pico-muted-color); }

/* ===== Srovnání cen na mobilu (B1) — karty místo tabulky ≤760px ===== */
/* Vzor: cart.php .cx-card / .cx-cards. Tabulka zůstává desktopu beze změny. */
.po-cards { display: none; }
.po-card {
    display: flex; gap: 0.8rem;
    background: var(--cx-surface); border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius); box-shadow: var(--cx-shadow);
    padding: 0.7rem 0.8rem; margin-bottom: 0.6rem;
}
.po-card--cheapest { border-color: var(--cx-save); box-shadow: 0 0 0 1px var(--cx-save), var(--cx-shadow); }
/* Náhled je shora omezený, ať nikdy nebobtná (B1) */
.po-thumb {
    width: 56px; max-width: 56px; height: 56px; flex: 0 0 auto;
    border-radius: 10px; background: #fff;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 3px;
}
.po-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.po-thumb.empty { background: var(--cx-bg); }
.po-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.po-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.po-name { font-weight: 700; color: var(--cx-ink); line-height: 1.3; }
.po-name small { display: block; font-weight: 400; color: var(--cx-muted); font-size: 0.78rem; }
.po-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; }
.po-price .price { font-size: 1.25rem; font-weight: 800; color: var(--brand-teal-text); line-height: 1.1; }
.po-price small { flex-basis: 100%; color: var(--cx-muted); font-size: 0.78rem; }
.po-price .old-price { font-size: 0.85rem; text-decoration: line-through; color: var(--cx-muted); }
.po-validity { font-size: 0.78rem; color: var(--cx-muted); }
.po-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
/* Add-to-cart na kartě je plnohodnotné tappable tlačítko (≥44px), ne mini-kolečko */
.po-add.btn-add-cart--inline {
    position: static; opacity: 1; width: auto; height: auto; min-height: 40px;
    border-radius: 2rem; padding: 0.45rem 1rem; font-size: 0.9rem; font-weight: 700;
    flex: 1 1 auto;
}
.po-actions .history-chip { min-height: 40px; padding: 0.4rem 0.8rem; font-size: 0.8rem; }
/* Náhledový sloupec tabulky nesmí bobtnat ani na mobilu (pojistka) */
.price-table td:first-child { max-width: 56px; }
.price-table td:first-child .offer-thumb { max-width: 56px; max-height: 56px; }

/* ≤760px: skryj tabulku, ukaž karty (stejný breakpoint jako košík) */
@media (max-width: 760px) {
    .po-table-wrap { display: none; }
    .po-cards { display: block; }
}

/* Search */
.search-box { margin-bottom: 1rem; }

/* Panel výsledků — čistý blok přes celou šířku POD vyhledávacím polem (mimo Pico
   [role=search] pilulku, takže žádný inline-flex ani 5rem radius nekaskáduje dovnitř). */
.search-results:not(:empty) {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow);
    padding: 0.75rem 1rem;
}
.search-results table { font-size: 0.9rem; }

/* Skrýt homepage obsah, dokud běží hledání (jsou výsledky) — žádný dlouhý scroll
   ani grid za výsledky. Po vymazání pole se třída sundá a obsah se vrátí. */
body.is-searching #page-content { display: none; }

/* Tabulka „Nabídky z obchodů" → desktop tabulka uvnitř .overflow-auto, na ≤760px
   se schová a místo ní karty (.sr-cards). Vlastní .sr-* třídy (ne admin .am-*). */
.sr-cards { display: none; }
/* Plnohodnotná karta (vzor .po-card) — explicitní vizuál přes tokeny, ne dědění z Pico. */
.sr-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.6rem;
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow);
}
/* Náhled jako bílý-box (vzor .po-thumb): multiply blenduje vůči BÍLÉMU boxu,
   takže PNG s bílým pozadím se nikdy neztmaví ani v dark režimu. Sjednoceno pro
   desktopový řádek (.sr-table-wrap) i mobilní kartu (.sr-card). */
.sr-thumb {
    width: 48px; max-width: 48px; height: 48px; flex: 0 0 auto;
    border-radius: 8px; background: #fff;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 3px;
}
.sr-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.sr-card__body { flex: 1 1 auto; min-width: 0; }
.sr-card__top { margin-bottom: 0.2rem; }
.sr-card__name { word-break: break-word; line-height: 1.3; margin-bottom: 0.15rem; }
.sr-card__name a { color: var(--cx-ink); }
.sr-card__price {
    display: flex; flex-wrap: wrap; align-items: baseline;
    column-gap: 0.4rem; row-gap: 0.1rem;
}
.sr-card__price .price { font-size: 1.1rem; font-weight: 800; color: var(--brand-teal-text); line-height: 1.1; }
.sr-card__price .old-price { font-size: 0.85rem; text-decoration: line-through; color: var(--cx-muted); }
.sr-card__price small { flex-basis: 100%; color: var(--cx-muted); font-size: 0.78rem; }
/* Add-to-cart ve výsledcích hledání je plnohodnotné tappable tlačítko (44×44, ≥44px touch),
   ne mini-kolečko jako na offer-card. Dřív inline style v partialech. */
.sr-card .btn-add-cart,
.sr-table-wrap .btn-add-cart { position: static; opacity: 1; width: 44px; height: 44px; flex: 0 0 auto; }

/* Vizuální spinner u inputu během hledání (htmx přepíná .htmx-request).
   Scope zúžen na .search-box, ať styl nezdědí jiný budoucí prvek s hx-indicator.
   V klidu absolutně pozicovaný → nezabírá flex místo v Pico pilulce (žádný prázdný „ocásek"). */
.search-box .htmx-indicator {
    display: inline-flex;
    align-items: center;
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.htmx-request .search-box .htmx-indicator,
.search-box.htmx-request .htmx-indicator,
.search-box .htmx-request.htmx-indicator { opacity: 1; }
.search-box .htmx-indicator::before {
    content: "";
    width: 1rem; height: 1rem;
    border: 2px solid var(--cx-line);
    border-top-color: var(--pico-primary);
    border-radius: 50%;
    animation: sr-spin 0.7s linear infinite;
}
@keyframes sr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .search-box .htmx-indicator::before { animation: none; border-top-color: var(--cx-line); }
}

@media (max-width: 760px) {
    .sr-table-wrap { display: none; }
    .sr-cards { display: block; }
}

/* Time filter pills — žlutý akcent (časové filtry).
   A1: text/aktivní výplň používá ztmavený jantar (--cx-amber), okraj smí být dekorativní. */
.time-filter { gap: 0.4rem; margin-bottom: 1rem; }
.time-filter a { padding: 0.25rem 0.75rem; font-size: 0.8rem; font-weight: 600; }
.time-filter a:hover { border-color: var(--cx-amber); color: var(--cx-amber); }
.time-filter a.active { background: var(--cx-amber); border-color: var(--cx-amber); color: #fff; }

/* Category filter pills */
.category-filter { gap: 0.35rem; }
.category-filter a { padding: 0.2rem 0.65rem; font-size: 0.75rem; }

/* Tag filter pills — nejmenší úroveň hierarchie */
.tag-filter { gap: 0.3rem; margin-top: -1rem; }
.tag-filter a { padding: 0.15rem 0.55rem; font-size: 0.7rem; border-radius: 1rem; }

/* ===== Mobil: větší tap targety filtračních pilulek (B2) ===== */
/* Na dotyku míříme na ~40–44px výšku — drobné desktopové paddingy se na Pixelu
   špatně trefují. Desktop (≥760px) zůstává beze změny. */
@media (max-width: 760px) {
    .store-filter a,
    .category-filter a,
    .tag-filter a,
    .time-filter a {
        min-height: 40px;
        padding-top: 0.5rem; padding-bottom: 0.5rem;
        font-size: 0.85rem;
    }
    .category-filter a, .tag-filter a { font-size: 0.8rem; }
    /* Tag řádek (až 52 pilulek) — místo vysoké zalamované zdi jeden vodorovně
       scrollovatelný řádek (vzor: .shop-tabs v košíku). Bigger tap target je must. */
    .tag-filter {
        flex-wrap: nowrap; overflow-x: auto; margin-top: 0;
        padding-bottom: 0.25rem;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .tag-filter::-webkit-scrollbar { display: none; }
    .tag-filter a { flex: 0 0 auto; white-space: nowrap; }
}

/* Cart badge */
.cart-link { position: relative; }
.cart-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--pico-del-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}
.cart-badge:empty { display: none; }

/* Add to cart button */
.btn-add-cart {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--pico-primary);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.offer-card { position: relative; }
.offer-card:hover .btn-add-cart { opacity: 1; }
/* A11y: na dotykových zařízeních (bez hoveru) vždy viditelné */
@media (hover: none) { .btn-add-cart { opacity: 1; } }
/* A11y: viditelné při klávesovém fokusu */
.btn-add-cart:focus-visible { opacity: 1; outline: 2px solid var(--pico-primary); outline-offset: 2px; }
.btn-add-cart.in-cart { background: var(--pico-del-color); opacity: 1; }

/* Budoucí nabídky (A1: text jantarového badge ztmaven) */
.offer-card.offer-card--upcoming {
    border: 2px solid var(--cx-amber-line);
    background: linear-gradient(180deg, #fffaeb 0%, transparent 40%);
}
.upcoming-badge {
    display: inline-block;
    background: var(--cx-amber);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 4px 0;
}
.expired-badge {
    display: inline-block;
    background: #888;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Modal pro výběr variant */
#variant-modal {
    max-width: 600px;
    width: 90vw;
    border-radius: 8px;
    border: none;
    padding: 1.25rem;
}
#variant-modal::backdrop { background: rgba(0,0,0,0.5); }
#variant-modal .variant-modal-header { margin-bottom: 0.75rem; }
#variant-modal .variant-modal-header h3 { margin: 0 0 0.25rem 0; }
#variant-modal .variant-modal-header small { color: var(--pico-muted-color); }
#variant-modal #variant-form { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
#variant-modal .variant-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
}
#variant-modal .variant-row:hover { background: #f0f0f0; border-color: #ddd; }
#variant-modal .variant-row--upcoming { background: #fffaeb; border-color: var(--cx-amber-line); }
#variant-modal .variant-name { font-size: 0.95rem; }
#variant-modal .variant-price { font-weight: 600; white-space: nowrap; }
#variant-modal .variant-price small { font-weight: 400; color: var(--pico-muted-color); margin-left: 4px; }
#variant-modal .variant-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
#variant-modal .variant-modal-actions button { margin-bottom: 0; }
#variant-modal .variant-modal-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
#variant-modal .variant-modal-toolbar button { margin-bottom: 0; width: auto; font-size: 0.85rem; padding: 0.3rem 0.75rem; }

/* #3 F2: report trigger + dialog. Trigger = chip konzistentní s .history-chip (viditelný text
   „nahlásit" + ikona, WCAG 2.2 SC 2.5.8 tap-target ≥40px — title-only glyf na dotyku nefunguje). */
.po-report {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 40px;
    width: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--pico-muted-color);
    background: none;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.po-report:hover, .po-report:focus-visible { border-color: var(--pico-primary); color: var(--brand-teal-text); }
#report-modal { border:none; border-radius:12px; padding:1.25rem; max-width:24rem; width:calc(100% - 2rem); }
#report-modal::backdrop { background:rgba(0,0,0,.4); }
#report-modal h3 { margin:0 0 .25rem; }
#report-modal .rep-prod { color:var(--cx-muted,#6b7280); font-size:.85rem; margin:0 0 .75rem; }
#report-modal .rep-aspects { border:1px solid var(--cx-line,#e5e7eb); border-radius:8px; padding:.5rem .75rem; margin:0 0 .75rem; }
#report-modal .rep-aspect { display:flex; align-items:center; gap:.5rem; padding:.15rem 0; }
#report-modal .rep-note textarea { width:100%; }
#report-modal .rep-msg:empty { display:none; }
#report-modal .rep-msg { margin:.5rem 0 0; font-size:.85rem; }
#report-modal .rep-actions { display:flex; gap:.5rem; margin-top:.75rem; }
/* honeypot: off-screen (ne display:none — bot ho má „vidět" a vyplnit) */
.rep-hp { position:absolute; left:-9999px; width:1px; height:1px; opacity:0; }

/* #3 F1/F2: admin klasifikace záložky (Ke kontrole ↔ Nahlášeno uživateli) */
.kl-tabs { display:flex; flex-wrap:wrap; gap:.25rem; margin:0 0 1rem; border-bottom:1px solid var(--cx-line,#e5e7eb); }
.kl-tabs a { padding:.5rem .9rem; text-decoration:none; color:var(--pico-muted-color); font-weight:600;
    border-bottom:2px solid transparent; margin-bottom:-1px; }
.kl-tabs a:hover { color:var(--brand-teal-text); }
.kl-tabs a.kl-tab-active { color:var(--brand-teal-text); border-bottom-color:var(--pico-primary); }

/* #3 F4: akční sada fronty (OK / Upravit / Přeřadit / Nepouštět do živa / Vrátit).
   40px tap-target na KAŽDÉ akci (ne jen .kl-actions button) — summary trigger i confirm-group. */
.kl-actions { display:flex; flex-wrap:wrap; gap:.4rem; align-items:flex-start; }
.kl-bulk-actions { display:flex; flex-wrap:wrap; gap:.4rem; align-items:flex-start; }
.kl-actions button, .kl-actions summary, .kl-recl summary, .kl-edit summary, .kl-suppress summary,
.kl-confirm-gp, .ru-dismiss-all button, .kl-approve-all button { min-height:40px; display:inline-flex; align-items:center; padding:.4rem .8rem; cursor:pointer; }
.kl-edit-body label { display:block; margin:.3rem 0; }

/* Overflow helper */
.overflow-auto { overflow-x: auto; }

/* Admin */
.match-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; }
.match-form select, .match-form input { margin-bottom: 0; }
.stats { display: flex; gap: 2rem; margin-bottom: 1.5rem; }
.stats .stat { text-align: center; }
.stats .stat-value { font-size: 1.5rem; font-weight: bold; }
.stats .stat-label { font-size: 0.85rem; color: var(--pico-muted-color); }

/* ===== C1: Admin tabulky → karty na mobilu (≤760px) =====
   Vzor: .po-cards / cart .cx-cards. Desktop (≥760px) drží <table> uvnitř .overflow-auto.
   Karetní bloky (.am-cards) jsou v markupu vedle tabulky a defaultně skryté; ≤760px se
   tabulka schová a karty ukážou — žádný vodorovný scroll těla, všechny akce viditelné. */
.am-cards { display: none; }
.am-card {
    background: var(--cx-surface); border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius); box-shadow: var(--cx-shadow);
    padding: 0.8rem 0.9rem; margin-bottom: 0.7rem;
}
.am-card__head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.am-card__title { font-weight: 700; color: var(--cx-ink); line-height: 1.3; }
.am-row { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.25rem 0; font-size: 0.85rem; border-top: 1px solid var(--cx-line); }
.am-row:first-of-type { border-top: 0; }
.am-row__label { color: var(--cx-muted); flex: 0 0 auto; }
.am-row__value { text-align: right; color: var(--cx-ink); min-width: 0; word-break: break-word; }
.am-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.7rem; }
/* Akce v kartě jsou full-width tappable (≥44px) a nevyžadují panování */
.am-actions form, .am-actions > a, .am-actions > button { margin: 0; width: 100%; }
.am-actions button, .am-actions a[role="button"], .am-actions [type="submit"] {
    width: 100%; min-height: 44px; margin: 0;
}
.am-actions .am-upload { display: flex; flex-direction: column; gap: 0.4rem; }
.am-actions .am-upload input[type="file"] { width: 100%; max-width: none; margin: 0; font-size: 0.85rem; }
.am-card .am-match select,
.am-card .am-match input[type="text"] { width: 100%; }
.am-card details { margin: 0; }
.am-card summary[role="button"] { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* Tappable šipková navigace v review/staging (≥44px), stylovaná jako tlačítko (C6) */
.item-nav {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; font-size: 1.5rem; line-height: 1;
    text-decoration: none; border-radius: 0.4rem;
    border: 1px solid var(--pico-muted-border-color); color: var(--pico-primary);
}
.item-nav:hover { background: var(--cx-bg); }
.item-nav--disabled { opacity: 0.3; border-color: transparent; pointer-events: none; }

@media (max-width: 760px) {
    /* tabulky uvnitř .overflow-auto schovat, karetní blok ukázat */
    .am-table-wrap { display: none; }
    .am-cards { display: block; }
}

/* Staging overview (feature B) — přehled celého běhu: filtr pilulky + tabulka/karty. */
.so-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.so-pill {
    flex: 0 0 auto;
    padding: 0.3rem 0.85rem; min-height: 44px; font-size: 0.8rem; font-weight: 600;
    border: 1px solid var(--cx-line); border-radius: 1rem; background: var(--cx-surface);
    color: var(--cx-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem;
}
.so-pill:hover { border-color: var(--pico-primary); }
.so-pill.active { background: var(--pico-primary); border-color: var(--pico-primary); color: #fff; }
/* Leták-filtr (#lf-filter) toggluje aria-pressed → vizuální aktivní stav pro vidoucí uživatele. */
.so-pill[aria-pressed="true"] { background: var(--pico-primary); border-color: var(--pico-primary); color: #fff; }
.so-jump-hint { color: var(--cx-muted); font-size: 0.72rem; white-space: nowrap; }
.so-badge { font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.so-badge--new { color: var(--cx-save); }
.so-badge--upd { color: var(--brand-teal-text); }
.so-table-wrap table { font-size: 0.9rem; }
.so-table-wrap .price { font-weight: 700; }
.so-table-wrap .old-price { text-decoration: line-through; color: var(--cx-muted); font-size: 0.8rem; }
.so-thumb { display: inline-flex; width: 44px; height: 44px; flex: 0 0 auto; background: #fff; border-radius: 8px; overflow: hidden; }
.so-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.so-cards { display: none; }
.so-card { border: 1px solid var(--cx-line); border-radius: var(--cx-radius); background: var(--cx-surface); box-shadow: var(--cx-shadow); padding: 0.6rem; margin-bottom: 0.6rem; }
.so-card__head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.so-card__title { font-weight: 700; color: var(--cx-ink); flex: 1 1 auto; min-width: 0; word-break: break-word; }
.so-card__title a { color: var(--cx-ink); }
.so-row { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.2rem 0; font-size: 0.85rem; border-top: 1px solid var(--cx-line); }
.so-row:first-of-type { border-top: 0; }
.so-row__label { color: var(--cx-muted); flex: 0 0 auto; }
.so-row__value { text-align: right; color: var(--cx-ink); min-width: 0; word-break: break-word; }
.so-row__value .price { font-weight: 700; }
.so-row__value .old-price { text-decoration: line-through; color: var(--cx-muted); }
.so-badge--dup, .so-badge--warn { background: var(--cx-amber); color: #fff; padding: 0.05rem 0.4rem; border-radius: 0.3rem; white-space: normal; }
.so-badge--win { color: var(--cx-save); }
.so-row--dup { flex-direction: column; align-items: stretch; gap: 0.35rem; }  /* mobil: badge → vítěz-ref → full-width tlačítko vertikálně */
@media (max-width: 760px) {
    .so-table-wrap { display: none; }
    .so-cards { display: block; }
}

/* --- A2.2 leták-editor --- */
.lf-head { display:flex; align-items:center; gap:0.75rem; flex-wrap:wrap; margin-bottom:0.75rem; }
.lf-status { min-height:1.2rem; color:var(--cx-save); font-weight:600; }
.lf-page { margin-bottom:1.5rem; border-top:1px solid var(--cx-line); padding-top:0.75rem; }
.lf-page__title small { color:var(--cx-muted); font-weight:400; }
.lf-split { display:grid; grid-template-columns:minmax(320px, 46%) 1fr; gap:1rem; align-items:start; }
.lf-render__frame { position:relative; display:inline-block; max-width:100%; }
.lf-render__frame img { max-width:100%; height:auto; display:block; }
.lf-bbox { position:absolute; box-sizing:border-box; border:2px solid rgba(0,0,0,.55);
    outline:1px solid rgba(255,255,255,.9); pointer-events:none; }
.lf-bbox--swap { border-color:var(--cx-amber-line); outline-color:rgba(0,0,0,.55); }
.lf-product { border:1px solid var(--cx-line); border-radius:var(--cx-radius); padding:0.6rem; margin-bottom:0.6rem; background:var(--cx-surface); }
.lf-product__head { display:flex; gap:0.6rem; align-items:flex-start; }
.lf-thumb { width:56px; height:56px; object-fit:contain; background:var(--cx-bg); border-radius:0.3rem; flex:0 0 auto; }
.lf-thumb--empty { display:inline-block; }
.lf-meta { display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap; margin-top:0.2rem; }
.lf-badge { font-size:0.75rem; font-weight:700; padding:0.05rem 0.4rem; border-radius:0.3rem; white-space:nowrap; }
.lf-badge--ok { color:var(--cx-save); }
.lf-badge--low { background:var(--cx-amber); color:#fff; }   /* výplň+bílý text → AA v light i dark */
.lf-badge--unknown { color:var(--cx-muted); }
.lf-palette__grid { display:grid; grid-template-columns:repeat(auto-fill, 72px); gap:0.4rem; margin-top:0.5rem; }
.lf-cand-form { margin:0; }
.lf-cand { position:relative; padding:0; border:2px solid var(--cx-line); border-radius:0.3rem; background:var(--cx-surface); cursor:pointer; width:72px; height:72px; }
.lf-cand img { width:100%; height:100%; object-fit:contain; display:block; }
.lf-cand:focus-visible { outline:3px solid var(--pico-primary); outline-offset:2px; }
.lf-cand--chosen { border-color:var(--cx-save); box-shadow:0 0 0 2px var(--cx-save); }
/* Fixní tmavě zelená (ne var --cx-save, ta je v dark #4ade80 → bílá ~1.7:1, padá AA).
   #15803d + bílá ~5:1 → AA v light i dark módu. */
.lf-cand__tag { position:absolute; left:0; right:0; bottom:0; font-size:0.62rem; font-weight:700;
    background:#15803d; color:#fff; text-align:center; }
.lf-cand-form.htmx-request .lf-cand { opacity:0.5; pointer-events:none; }
.lf-empty { color:var(--cx-muted); }
body.lf-only-review .lf-product[data-swappable="0"] { display:none; }
body.lf-only-review .lf-page[data-swappable="0"] { display:none; }
@media (max-width:1000px) {
    .lf-split { grid-template-columns:1fr; }   /* úzký desktop: stack render nad tabulkou */
}

/* „Dobrá koupě?" signál na /historie (T2). Bezpečné AA barvy v light i dark.
   NIKDY var(--cx-save) solid — ta je v dark #4ade80 → s bílým textem ~1.7:1, padá AA. */
.buy-signal { display:inline-block; padding:.3rem .7rem; border-radius:6px; font-weight:600; margin:.3rem 0; }
.buy-signal--low { background:#15803d; color:#fff; }          /* ~5:1 AA light+dark (ne var(--cx-save)!) */
.buy-signal--near { background:var(--cx-amber); color:#fff; }  /* --cx-amber #8a6500 (dark nepřepsán) + bílá ~5,3:1 AA */
.buy-signal--neutral { padding:0; background:none; color:var(--pico-muted-color); font-weight:400; }  /* prostý muted fakt, ne prázdná pilulka (M1) */
