/*
 * Noční (tmavý) vzhled obchodu. Zapíná ho skript v hlavičce stránky přes <html data-theme="dark">:
 * podle nastavení systému, nebo podle volby návštěvníka (tlačítko v patičce, pamatuje si ho prohlížeč).
 * Jen pro obrazovku, tisk zůstává světlý. Barvu obchodu (--accent) nemění: tlačítka a modrý pruh
 * kategorií zůstanou v barvě obchodu, jen odkazy a zvýrazněný text dostanou světlejší odstín (--link).
 * Obchod si tmavé barvy upraví v shop.css, např. :root[data-theme="dark"] { --bg: #101215; }.
 * Logo na tmavém podkladu: theme/assets/logo-dark.svg (nebo .png); když chybí, dostane logo světlý podklad.
 * Selektory mají před sebou :where([data-theme="dark"]), takže mají stejnou váhu jako ve style.css
 * a přebijí ho jen tím, že se načítají až po něm.
 */

@media screen {

:root[data-theme="dark"] {
    color-scheme: dark;
    --text: #e7e9ec;
    --text-soft: #c2c6cd;
    --muted: #9a9fa8;
    --bg: #15171b;
    --surface: #20242a;
    --card: #1c1f24;            /* karta zboží a kategorie (podklad fotky zůstává bílý) */
    --card-line: color-mix(in srgb, var(--accent) 55%, var(--bg));
    --line: #2b2f36;
    --field-line: #3b4049;
    --accent-soft: color-mix(in srgb, var(--accent) 24%, var(--bg));
    --link: color-mix(in srgb, var(--accent) 50%, #fff);
    --ok: #4cc26f;
    --warn: #e9a848;
    --error: #f2796b;
    --tint-ok: #15301f;
    --tint-warn: #352812;
    --tint-error: #3a1c1a;
    --tint-info: #172a42;
}

/* Odkazy a zvýrazněný text: světlejší odstín barvy obchodu */
:where([data-theme="dark"]) a:hover,
:where([data-theme="dark"]) .content a, :where([data-theme="dark"]) .link,
:where([data-theme="dark"]) .search-form button:hover,
:where([data-theme="dark"]) .menu-panel-back,
:where([data-theme="dark"]) .menu-tree .menu-all,
:where([data-theme="dark"]) .breadcrumbs a:hover,
:where([data-theme="dark"]) .category-tree a[aria-current="page"],
:where([data-theme="dark"]) .link-button,
:where([data-theme="dark"]) .is-done .checkout-step-mark,
:where([data-theme="dark"]) .order-box-head a,
:where([data-theme="dark"]) .account-link:hover,
:where([data-theme="dark"]) .account-nav a[aria-current="page"],
:where([data-theme="dark"]) .footer-main a:hover { color: var(--link); }
@media (max-width: 47.99rem) {
    :where([data-theme="dark"]) .subcategories a[aria-current],
    :where([data-theme="dark"]) .sorts.sheet a[aria-current] { color: var(--link); }
}
:where([data-theme="dark"]) :focus-visible { outline-color: var(--link); }
:where([data-theme="dark"]) .search-form:focus-within { border-color: var(--link); box-shadow: 0 0 0 1px var(--link); }

/* Hlavička: název obchodu vedle loga zesvětlený, logo bez tmavé verze na světlém podkladu */
:where([data-theme="dark"]) .site-brand-name { color: color-mix(in srgb, var(--brand-name-color, var(--text)) 45%, #fff); }
:where([data-theme="dark"]) .site-brand img:not(.logo-dark) { padding: .25rem .5rem; background: #fff; border-radius: 8px; }
:where([data-theme="dark"]) .site-header { border-bottom-color: var(--line); }

/* Karty zboží a kategorií: tmavá karta, fotka dál na bílém (fotky zboží mají bílé pozadí) */
:where([data-theme="dark"]) .product-card,
:where([data-theme="dark"]) .category-tile { background: var(--card); }
:where([data-theme="dark"]) .product-card:hover,
:where([data-theme="dark"]) .category-tile:hover,
:where([data-theme="dark"]) .subcategories a:hover { border-color: var(--link); }
:where([data-theme="dark"]) .product-thumbs a[aria-current] { border-color: var(--link); }

/* Natvrdo zadané světlé barvy ze style.css */
:where([data-theme="dark"]) .menu-tree a { border-bottom-color: var(--line); }
:where([data-theme="dark"]) .menu-panel.is-levels .has-children > a::after,
:where([data-theme="dark"]) .category-tree-arrow,
:where([data-theme="dark"]) .category-tree .count,
:where([data-theme="dark"]) .checkout-steps,
:where([data-theme="dark"]) .account-order summary::after { color: var(--muted); }
:where([data-theme="dark"]) .category-tree a,
:where([data-theme="dark"]) .order-next { color: var(--text-soft); }
:where([data-theme="dark"]) .sorts a[aria-current] { color: var(--bg); }
:where([data-theme="dark"]) .notice-ok { background: var(--tint-ok); }
:where([data-theme="dark"]) .notice-warn { background: var(--tint-warn); }
:where([data-theme="dark"]) .notice-error { background: var(--tint-error); }
:where([data-theme="dark"]) .free-shipping-done { color: var(--ok); background: var(--tint-ok); border-color: #24502f; }
:where([data-theme="dark"]) .free-shipping progress,
:where([data-theme="dark"]) .free-shipping progress::-webkit-progress-bar { background: var(--surface); }
:where([data-theme="dark"]) .checkout-form .reveal { background: var(--surface); }
:where([data-theme="dark"]) .order-status-icon { background: var(--tint-ok); }
:where([data-theme="dark"]) .account-order-body { background: #1a1d22; }
:where([data-theme="dark"]) .order-chip-new, :where([data-theme="dark"]) .order-chip-processing { color: #9cc3f0; background: var(--tint-info); }
:where([data-theme="dark"]) .order-chip-ready, :where([data-theme="dark"]) .order-chip-sent { color: var(--warn); background: var(--tint-warn); }
:where([data-theme="dark"]) .order-chip-done { color: var(--ok); background: var(--tint-ok); }
:where([data-theme="dark"]) .order-chip-cancelled { color: var(--error); background: var(--tint-error); }
:where([data-theme="dark"]) .variant-color { border-color: rgb(255 255 255 / .3); }
@media (max-width: 47.99rem) {
    :where([data-theme="dark"]) .product-dots span { background: #4a4f58; }
}
:where([data-theme="dark"]) .quantity-step, :where([data-theme="dark"]) .point-dialog-close { color: var(--text); }
:where([data-theme="dark"]) .point-dialog { background: var(--bg); color: var(--text); }

}

/* Přepínač vzhledu v patičce (bez JavaScriptu skrytý) */
.theme-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin-top: 1rem; padding: 0; font: inherit; color: var(--text-soft); background: none; border: 0; cursor: pointer; }
.theme-toggle:hover { color: var(--link, var(--accent)); }
.theme-toggle svg { flex: none; }
.theme-toggle .theme-to-light, [data-theme="dark"] .theme-toggle .theme-to-dark { display: none; }
[data-theme="dark"] .theme-toggle .theme-to-light { display: inline-flex; align-items: center; gap: .5rem; }
.theme-toggle .theme-to-dark { display: inline-flex; align-items: center; gap: .5rem; }
@media print { .theme-toggle { display: none; } }

/* Logo pro noční vzhled (logo-dark.svg/png v tématu obchodu) */
.site-brand .logo-dark { display: none; }
@media screen {
    [data-theme="dark"] .site-brand .logo-light { display: none; }
    [data-theme="dark"] .site-brand .logo-dark { display: block; }
}
