/* dBShop: a classic Czech e-shop layout. Light, dense, blue for navigation, green for buying. */
:root {
  --page: #f1f3f6;
  --card: #ffffff;
  --line: #dfe3ea;
  --line-strong: #c7cdd8;
  --text: #1c2433;
  --subtext: #5b6577;
  --muted: #8a93a3;
  --blue: #0b57c2;
  --blue-dark: #083f8f;
  --blue-soft: #e8f0fc;
  --green: #2e9e44;
  --green-dark: #227a34;
  --red: #d2293b;
  --yellow-soft: #fff4d6;
  --radius: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { image-rendering: pixelated; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
code { background: rgb(11 87 194 / .1); color: var(--blue-dark); padding: 1px 6px; border-radius: 4px; font-size: .95em; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }

/* ---- info strip ---- */
.strip { background: var(--blue-dark); color: #dbe6f8; font-size: 12.5px; }
.strip .wrap { display: flex; gap: 24px; align-items: center; height: 32px; }
.strip span::before { content: "✓ "; color: #8fd19e; }
.strip .strip-right { margin-left: auto; }
.strip .strip-right::before { content: ""; }
.strip code { background: rgb(255 255 255 / .16); color: #fff; }

/* ---- header ---- */
.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgb(20 30 50 / .06); }
.top-row { display: flex; align-items: center; gap: 28px; height: 76px; }
.logo { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; color: var(--blue-dark); }
.logo span { color: var(--green); }
.search { flex: 1; display: flex; height: 44px; max-width: 640px; border: 2px solid var(--blue); border-radius: var(--radius); overflow: hidden; background: #fff; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 14px; font-size: 15px; background: none; }
.search input::placeholder { color: var(--muted); }
.search button { border: 0; background: var(--blue); color: #fff; font-weight: 700; padding: 0 22px; }
.search button:hover { background: var(--blue-dark); }
.top-actions { display: flex; gap: 6px; margin-left: auto; }
.action {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px;
  background: none; border: 0; border-radius: var(--radius); text-align: left;
}
.action:hover { background: var(--blue-soft); }
.action svg { width: 26px; height: 26px; fill: var(--blue-dark); flex: none; }
.action-text { display: grid; line-height: 1.2; }
.action-text small { color: var(--subtext); font-size: 11.5px; }
.action-text b { font-size: 14px; white-space: nowrap; }
.action.cart { background: var(--green); color: #fff; padding: 0 16px; }
.action.cart:hover { background: var(--green-dark); }
.action.cart svg { fill: #fff; }
.action.cart small { color: #dff3e3; }

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; padding-top: 20px; padding-bottom: 40px; align-items: start; }
.categories { position: sticky; top: 96px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.categories h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--blue); padding: 11px 14px; }
.categories nav { display: flex; flex-direction: column; max-height: calc(100vh - 170px); overflow: auto; scrollbar-width: thin; }
.categories a { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-weight: 500; }
.categories a:first-child { border-top: 0; }
.categories a img { width: 22px; height: 22px; flex: none; }
.categories a::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 16px; }
.categories a:hover { background: var(--blue-soft); color: var(--blue-dark); }
.categories a.active { background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; box-shadow: inset 3px 0 0 var(--blue); }
.categories small { display: none; }

main { min-height: 60vh; outline: 0; }
.crumbs { color: var(--subtext); font-size: 12.5px; margin-bottom: 8px; }
.crumbs a { color: var(--blue); }
.crumbs a:hover { text-decoration: underline; }
.page-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.page-head h1 { font-size: 26px; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--subtext); }

/* sort tabs, like the row above any product listing */
.sort { display: flex; gap: 2px; border-bottom: 2px solid var(--blue); margin-bottom: 14px; overflow-x: auto; }
.sort button { border: 0; background: #e3e8f0; padding: 9px 16px; border-radius: 6px 6px 0 0; font-weight: 600; color: var(--subtext); white-space: nowrap; }
.sort button:hover { background: #d5dce8; }
.sort button.active { background: var(--blue); color: #fff; }

/* ---- home ---- */
.hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  background: linear-gradient(100deg, var(--blue-dark), var(--blue) 70%); color: #fff;
  border-radius: var(--radius); padding: 28px 32px; margin-bottom: 18px;
}
.hero h1 { font-size: 30px; letter-spacing: -0.02em; margin-bottom: 6px; }
.hero p { margin: 0 0 16px; color: #d6e3f8; max-width: 52ch; }
.hero img { width: 128px; height: 128px; filter: drop-shadow(0 8px 16px rgb(0 0 0 / .35)); }
.section-title { font-size: 18px; margin: 22px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; text-align: center; }
.tile:hover { border-color: var(--blue); color: var(--blue-dark); box-shadow: 0 2px 10px rgb(11 87 194 / .12); }
.tile img { width: 44px; height: 44px; }

/* ---- product grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card {
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0;
  background: var(--card); transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 4px 18px rgb(20 30 50 / .14); position: relative; z-index: 1; }
.card .art { height: 110px; display: grid; place-items: center; }
.card .art img { width: 80px; height: 80px; }
.card h3 { font-size: 14.5px; font-weight: 700; color: var(--blue-dark); min-height: 2.4em; }
.card .pack { color: var(--subtext); font-size: 12.5px; }
.stock { color: var(--green-dark); font-size: 12.5px; font-weight: 600; }
.price { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.price small { color: var(--subtext); font-weight: 500; font-size: 12.5px; }
.dia { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dia img { width: 1em; height: 1em; vertical-align: -0.12em; }

.stepper { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px; height: 34px; background: #fff; }
.stepper button { height: 32px; border: 0; background: none; font-size: 18px; color: var(--blue-dark); border-radius: 6px; }
.stepper button:hover { background: var(--blue-soft); }
.stepper output { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.card-actions { display: grid; gap: 6px; }
.link-button { border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 12.5px; padding: 2px; }
.link-button:hover { text-decoration: underline; }

.button { height: 38px; padding: 0 16px; border: 0; border-radius: 6px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.button.buy { background: var(--green); color: #fff; }
.button.buy:hover { background: var(--green-dark); }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-dark); }
.button.ghost { background: #e3e8f0; }
.button.ghost:hover { background: #d5dce8; }
.button.light { background: #fff; color: var(--blue-dark); }
.button.light:hover { background: var(--blue-soft); }
.button:disabled { opacity: .5; cursor: not-allowed; }

/* ---- cart drawer ---- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgb(15 23 42 / .45); }
.drawer { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--card); box-shadow: -8px 0 30px rgb(15 23 42 / .2); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer[hidden], .scrim[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; background: #f8f9fb; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: #e3e8f0; }
.line { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line > img { width: 40px; height: 40px; }
.line .name { font-weight: 700; color: var(--blue-dark); }
.line .meta { color: var(--subtext); font-size: 12.5px; }
.line .stepper { width: 104px; grid-template-columns: 30px 1fr 30px; height: 30px; }
.line .stepper button { height: 28px; font-size: 16px; }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; font-weight: 800; }
.muted { color: var(--subtext); font-size: 12.5px; }
.warn { color: var(--red); font-size: 12.5px; font-weight: 600; }
.empty { color: var(--subtext); text-align: center; padding: 48px 0; }

/* ---- orders & account ---- */
.stack { display: grid; gap: 12px; max-width: 900px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.order-head h3 { font-size: 16px; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.SHIPPING { background: var(--yellow-soft); color: #8a5a00; }
.badge.READY { background: #e3f5e7; color: var(--green-dark); }
.badge.COLLECTED { background: #e9edf3; color: var(--subtext); }
.badge.REFUNDED { background: #fde8ea; color: var(--red); }
.code { margin-left: auto; font: 800 22px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; color: var(--blue-dark); background: var(--blue-soft); padding: 8px 12px; border-radius: 6px; border: 1px dashed var(--blue); }
.items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; background: var(--page); border-radius: 999px; font-size: 12.5px; }
.chip > img { width: 20px; height: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--subtext); font-size: 12.5px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--subtext); font-weight: 600; font-size: 12.5px; padding: 6px 8px; }
td { padding: 9px 8px; border-top: 1px solid var(--line); }
td.plus { color: var(--green-dark); font-weight: 700; }
td.minus { color: var(--red); font-weight: 700; }
td.num, th.num { text-align: right; }

/* ---- dialog, toast, footer ---- */
dialog { border: 0; border-radius: 12px; background: var(--card); color: var(--text); padding: 26px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgb(15 23 42 / .3); }
dialog::backdrop { background: rgb(15 23 42 / .5); }
dialog ol { color: var(--subtext); padding-left: 20px; margin: 14px 0 18px; display: grid; gap: 6px; }
#login-code { width: 100%; height: 60px; text-align: center; border-radius: 8px; font: 800 28px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .3em; background: #fff; border: 2px solid var(--line-strong); outline: 0; }
#login-code:focus { border-color: var(--blue); }
.form-error { color: var(--red); min-height: 1.5em; margin: 8px 0 0; font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #1c2433; color: #fff; padding: 12px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); font-weight: 600; box-shadow: 0 8px 24px rgb(15 23 42 / .3); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }
.foot { background: #1c2433; color: #aeb7c6; font-size: 12.5px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-block: 18px; }
.foot b { color: #fff; }
.foot code { background: rgb(255 255 255 / .12); color: #fff; }

/* ---- narrow screens ---- */
@container (max-width: 190px) {
  .price { font-size: 19px; }
}
@media (max-width: 900px) {
  .strip .wrap span:nth-child(2), .strip .strip-right { display: none; }
  .top-row { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 10px 12px; }
  .logo { font-size: 26px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .action-text small { display: none; }
  .action { height: 44px; padding: 0 10px; }
  .action:not(.cart) .action-text { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 12px; }
  .wrap { padding: 0 12px; }
  .categories { position: static; }
  .categories h2 { display: none; }
  .categories nav { flex-direction: row; max-height: none; overflow-x: auto; }
  .categories a { border-top: 0; border-right: 1px solid var(--line); white-space: nowrap; }
  .categories a::after { content: none; }
  .categories a.active { box-shadow: inset 0 -3px 0 var(--blue); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero img { display: none; }
  .hero h1 { font-size: 24px; }
  .code { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- help ---- */
.strip a { color: #fff; font-weight: 600; }
.strip a:hover, .foot a:hover { text-decoration: underline; }
.foot a { color: #fff; }
.help { display: grid; gap: 12px; max-width: 900px; }
.help .panel h2 { font-size: 18px; margin-bottom: 10px; }
.help ol, .help ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--subtext); }
.help li b { color: var(--text); }
.help .steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.help .step { background: var(--blue-soft); border-radius: var(--radius); padding: 14px; }
.help .step b { display: block; color: var(--blue-dark); margin-bottom: 4px; }
.help .step span { color: var(--subtext); font-size: 13px; }
