/* ============================================================
   MISTPRO — styly pro košík, pokladnu a děkovnou stránku
   Vlastník: agent košík/pokladna. Design dle reference/design-kit.md
   a reference/mistpro-kosik.html. Design tokeny (--accent, --sp-* …)
   definuje globální CSS z base.html; zde všude var() s fallbackem,
   aby stránky fungovaly i samostatně.
   ============================================================ */

/* --- Sdílené drobnosti (identické s kitem — bezpečná duplicita) --- */
.price, .price-old, .cart-sum, .qty, .opt-price, .ci-unit {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price { font-size: var(--fs-price, 17px); font-weight: 700; color: var(--text, #06070d); }
.price-old { font-size: var(--fs-price-old, 13px); font-weight: 400; color: var(--text-muted, #6e6e73); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 var(--sp-5, 24px);
  border-radius: var(--radius-pill, 980px);
  font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent, #0071e3); color: #fff; }
.btn-primary:hover { background: var(--accent-hover, #2997ff); }
.btn-secondary { background: var(--surface, #f5f5f7); color: var(--text, #06070d); border-color: var(--hairline, rgba(6,7,13,.08)); }
.btn-secondary:hover { background: #ebebed; }
.btn-lg { height: 48px; padding: 0 var(--sp-6, 32px); font-size: 15px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Kostra stránky --- */
.checkout-main { padding: var(--sp-5, 24px) 0 var(--sp-7, 48px); }

.page-head { margin-bottom: var(--sp-5, 24px); }
.page-head h1 {
  font-size: var(--fs-h1, 28px); font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: var(--sp-4, 16px);
}
@media (min-width: 1100px) { .page-head h1 { font-size: 44px; } }

/* Krokový indikátor */
.steps { list-style: none; display: flex; align-items: center; gap: var(--sp-2, 8px); flex-wrap: wrap; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: var(--sp-2, 8px); font-size: 13px; font-weight: 600; color: var(--text-muted, #6e6e73); }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  background: var(--surface, #f5f5f7); color: var(--text-muted, #6e6e73);
  font-variant-numeric: tabular-nums;
}
.steps li[aria-current="step"] { color: var(--text, #06070d); }
.steps li[aria-current="step"] .step-num { background: var(--accent, #0071e3); border-color: var(--accent, #0071e3); color: #fff; }
.step-sep { width: 22px; height: 1px; background: var(--hairline, rgba(6,7,13,.08)); flex-shrink: 0; }
@media (min-width: 480px) { .step-sep { width: 36px; } }

/* Dvousloupcový layout */
.checkout-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5, 24px); align-items: start; }
@media (min-width: 768px) {
  .checkout-grid { grid-template-columns: 1fr 340px; gap: var(--sp-6, 32px); }
}

/* Panely */
.panel {
  background: var(--bg, #ffffff);
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  border-radius: var(--radius-card, 18px);
  box-shadow: var(--shadow-rest, 0 1px 2px rgba(6,7,13,.04));
  padding: var(--sp-4, 16px);
  margin-bottom: var(--sp-5, 24px);
}
@media (min-width: 768px) { .panel { padding: var(--sp-5, 24px); } }
.panel > h2, .panel legend.panel-legend {
  font-size: var(--fs-h2, 22px); font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: var(--sp-4, 16px);
}
.panel fieldset { border: 0; min-width: 0; margin: 0; padding: 0; }

/* --- Doprava zdarma — hláška + progress --- */
.freeship { margin-bottom: var(--sp-4, 16px); }
.freeship-text { font-size: 13px; font-weight: 600; margin-bottom: var(--sp-2, 8px); }
.freeship-text .price { font-size: 13px; }
/* „Máte dopravu zdarma" — základní inkoust s modrou tečkou.
   Zelená --success je dle kitu VÝHRADNĚ pro dostupnost (Skladem). */
.freeship-ok { display: flex; align-items: center; gap: 6px; }
.freeship-ok .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent, #0071e3); flex-shrink: 0; }
.freeship-track {
  height: 8px; border-radius: var(--radius-pill, 980px);
  background: var(--surface, #f5f5f7); border: 1px solid var(--hairline, rgba(6,7,13,.08));
  overflow: hidden;
}
.freeship-fill {
  height: 100%;
  border-radius: var(--radius-pill, 980px);
  background: linear-gradient(90deg, var(--accent, #0071e3), var(--accent-hover, #2997ff));
}

/* --- Položky košíku --- */
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  grid-template-areas:
    "img info remove"
    "img qty  total";
  gap: var(--sp-1, 4px) var(--sp-3, 12px);
  align-items: start;
  padding: var(--sp-4, 16px) 0;
  border-top: 1px solid var(--hairline, rgba(6,7,13,.08));
}
.cart-item:first-child { border-top: 0; padding-top: 0; }
.ci-media {
  grid-area: img;
  width: 64px; height: 64px;
  background: #ffffff;
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  border-radius: var(--radius-tile, 12px);
  padding: 6px;
  display: block;
}
.ci-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ci-info { grid-area: info; min-width: 0; }
.ci-title { font-size: var(--fs-card-title, 15px); font-weight: 600; line-height: 1.35; margin: 0; }
.ci-title a { color: var(--text, #06070d); }
.ci-title a:hover { color: var(--accent, #0071e3); text-decoration: none; }
.ci-variant { font-size: var(--fs-meta, 12px); color: var(--text-muted, #6e6e73); margin: 2px 0 0; }
.ci-stock {
  font-size: var(--fs-meta, 12px); font-weight: 500; color: var(--success, #248a3d);
  display: flex; align-items: center; gap: 6px; margin: 2px 0 0;
}
.ci-stock .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success, #248a3d); flex-shrink: 0; }
.ci-qty { grid-area: qty; align-self: end; }
.ci-total { grid-area: total; align-self: end; justify-self: end; text-align: right; margin: 0; }
.ci-unit { display: block; font-size: var(--fs-meta, 12px); color: var(--text-muted, #6e6e73); }
.ci-remove-form { grid-area: remove; justify-self: end; margin: -8px -8px 0 0; }
.ci-remove {
  width: 40px; height: 40px;
  border: 0; background: transparent; color: var(--text-muted, #6e6e73);
  border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
}
.ci-remove:hover { color: var(--text, #06070d); background: var(--surface, #f5f5f7); }

/* Stepper množství — čistý HTML form (bez JS): −/+ jsou submit buttony
   s name="qty" a hodnotou qty−1 / qty+1; qty−1 = 0 položku odebere. */
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  border-radius: var(--radius-pill, 980px);
  background: var(--bg, #ffffff);
  height: 40px; overflow: hidden;
}
.qty-btn {
  width: 40px; height: 40px;
  border: 0; background: transparent; color: var(--text, #06070d);
  font: inherit; font-size: 18px; font-weight: 600; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.qty-btn:hover { background: var(--surface, #f5f5f7); }
.qty {
  min-width: 36px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: var(--text, #06070d);
}
.cart-actions { padding-top: var(--sp-4, 16px); border-top: 1px solid var(--hairline, rgba(6,7,13,.08)); }

/* --- Prázdný košík (kit §5 Prázdné stavy) --- */
.cart-empty { text-align: center; padding: var(--sp-6, 32px) var(--sp-4, 16px); }
.cart-empty svg { width: 64px; height: 64px; color: var(--text-muted, #6e6e73); margin: 0 auto var(--sp-4, 16px); display: block; }
.cart-empty h2 { font-size: var(--fs-h2, 22px); font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--sp-2, 8px); }
.cart-empty p { color: var(--text-muted, #6e6e73); margin-bottom: var(--sp-4, 16px); }

/* --- Volby dopravy a platby --- */
.opt-list { display: flex; flex-direction: column; gap: var(--sp-2, 8px); }
.opt {
  position: relative;
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  border-radius: var(--radius-tile, 12px);
  background: var(--bg, #ffffff);
  transition: border-color .15s ease, background .15s ease;
}
.opt:has(input:checked) { border-color: var(--accent, #0071e3); background: rgba(0, 113, 227, 0.04); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent, #0071e3); outline-offset: 2px; }
.opt-label {
  display: flex; align-items: center; gap: var(--sp-3, 12px);
  padding: var(--sp-3, 12px) var(--sp-4, 16px);
  cursor: pointer; min-height: 56px;
}
.opt input[type="radio"] {
  width: 18px; height: 18px; flex-shrink: 0;
  accent-color: var(--accent, #0071e3);
}
.opt-name { flex: 1; min-width: 0; }
.opt-name strong { display: block; font-size: 14px; font-weight: 600; }
.opt-name small { display: block; font-size: var(--fs-meta, 12px); color: var(--text-muted, #6e6e73); }
.opt-price { font-size: 14px; font-weight: 700; }

/* --- Formulář pokladny --- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4, 16px); }
@media (min-width: 768px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-field-full { grid-column: 1 / -1; }
}
.form-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: var(--sp-1, 4px); }
.form-field input {
  width: 100%; height: 44px;
  padding: 0 var(--sp-4, 16px);
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  border-radius: var(--radius-tile, 12px);
  background: var(--bg, #ffffff);
  font: inherit; font-size: 15px; color: var(--text, #06070d);
}
.form-field input::placeholder { color: var(--text-muted, #6e6e73); }
.form-field input:focus { outline: 2px solid var(--accent, #0071e3); outline-offset: 0; border-color: var(--accent, #0071e3); }
.form-hint { font-size: var(--fs-meta, 12px); color: var(--text-muted, #6e6e73); margin: var(--sp-1, 4px) 0 0; }
/* Serverová chybová hláška pokladny — dle kitu tmavý inkoust s ikonou,
   NIKDY červeně (--sale je vyhrazena penězům) */
.form-error {
  display: flex; align-items: center; gap: var(--sp-2, 8px);
  font-size: 14px; font-weight: 600; color: var(--text, #06070d);
  background: var(--surface, #f5f5f7);
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  border-radius: var(--radius-tile, 12px);
  padding: var(--sp-3, 12px) var(--sp-4, 16px);
  margin-bottom: var(--sp-4, 16px);
}
.form-error svg { flex-shrink: 0; }

/* --- Souhrn (sticky sloupec) --- */
.summary { position: static; }
@media (min-width: 768px) {
  .summary { position: sticky; top: calc(var(--header-h, 56px) + var(--sp-4, 16px)); }
}
.summary .panel { margin-bottom: var(--sp-4, 16px); }
.sum-rows { list-style: none; margin: 0 0 var(--sp-4, 16px); padding: 0; }
.sum-rows li {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3, 12px);
  padding: var(--sp-2, 8px) 0;
  font-size: 14px;
}
.sum-rows .sum-item-name { min-width: 0; }
.sum-rows .cart-sum { font-weight: 600; }
.sum-total {
  border-top: 1px solid var(--hairline, rgba(6,7,13,.08));
  margin-top: var(--sp-1, 4px); padding-top: var(--sp-3, 12px) !important;
  align-items: baseline;
}
.sum-total .sum-label { font-size: 15px; font-weight: 700; }
.sum-total .cart-sum { font-size: 28px; font-weight: 700; }
.sum-note { font-size: var(--fs-meta, 12px); color: var(--text-muted, #6e6e73); margin: -6px 0 var(--sp-4, 16px); text-align: right; }
.btn-order { width: 100%; }
.secure-note {
  display: flex; align-items: flex-start; gap: var(--sp-2, 8px);
  margin-top: var(--sp-3, 12px);
  font-size: var(--fs-meta, 12px); color: var(--text-muted, #6e6e73);
}
.secure-note svg { flex-shrink: 0; margin-top: 1px; }

/* --- Děkovná stránka --- */
.thanks-head { text-align: center; padding: var(--sp-6, 32px) 0 var(--sp-5, 24px); }
.thanks-head .thanks-ico {
  width: 64px; height: 64px; margin: 0 auto var(--sp-4, 16px);
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent, #0071e3);
  display: grid; place-items: center;
}
.thanks-head h1 {
  font-size: var(--fs-h1, 28px); font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: var(--sp-2, 8px);
}
@media (min-width: 1100px) { .thanks-head h1 { font-size: 44px; } }
.thanks-head p { color: var(--text-muted, #6e6e73); margin: 0 0 var(--sp-1, 4px); }
.order-no {
  display: inline-block; margin-top: var(--sp-3, 12px);
  font-size: var(--fs-h3, 17px); font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--hairline, rgba(6,7,13,.08));
  border-radius: var(--radius-pill, 980px);
  background: var(--surface, #f5f5f7);
  padding: var(--sp-2, 8px) var(--sp-4, 16px);
}
.thanks-panel { max-width: 560px; margin: 0 auto; }
.thanks-meta { font-size: 14px; color: var(--text-muted, #6e6e73); }
.thanks-meta strong { color: var(--text, #06070d); font-weight: 600; }
.thanks-actions {
  display: flex; gap: var(--sp-3, 12px); justify-content: center; flex-wrap: wrap;
  margin-top: var(--sp-5, 24px);
}
