/* dnesdoma.sk — komponenty. Všetky farby, rozostupy a zaoblenia sú z tokens.css. */

.dd-root { font-family: var(--font-sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
.dd-root *, .dd-root *::before, .dd-root *::after { box-sizing: border-box; }

/* ---------- Button ---------- */
.dd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: 0 20px; border: 0; border-radius: var(--radius-md);
  font: 600 17px/22px var(--font-sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.dd-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.dd-btn:disabled, .dd-btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.dd-btn--primary { background: var(--brand); color: var(--on-brand); }
.dd-btn--primary:active { background: var(--brand-pressed); }
.dd-btn--secondary { background: var(--surface-2); color: var(--ink); }
.dd-btn--plain { background: transparent; color: var(--brand); padding: 0 var(--space-3); }
.dd-btn--block { width: 100%; }
.dd-btn--pos { min-height: var(--tap-pos); font-size: 20px; padding: 0 var(--space-5); }
.dd-btn:active:not(:disabled) { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .dd-btn { transition: none; } .dd-btn:active:not(:disabled) { transform: none; } }

/* ---------- StockBadge ---------- */
.dd-stock { display: inline-flex; align-items: center; gap: 6px; font: 600 15px/20px var(--font-sans); }
.dd-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dd-stock--in { color: var(--success); }
.dd-stock--order { color: var(--warning); }
.dd-stock--out { color: var(--danger); }
.dd-stock__detail { font-weight: 400; color: var(--ink-muted); }

/* ---------- EnergyLabel ---------- */
.dd-energy {
  display: inline-flex; align-items: center; height: 28px; min-width: 46px; padding: 0 18px 0 10px;
  font: 800 17px/1 var(--font-sans); color: var(--on-energy-dark);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}
.dd-energy--a { background: var(--energy-a); }
.dd-energy--b { background: var(--energy-b); }
.dd-energy--c { background: var(--energy-c); }
.dd-energy--d { background: var(--energy-d); }
.dd-energy--e { background: var(--energy-e); }
.dd-energy--f { background: var(--energy-f); }
.dd-energy--g { background: var(--energy-g); }

/* ---------- PriceTag ---------- */
.dd-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); font-variant-numeric: tabular-nums; }
.dd-price__now { font: 700 22px/28px var(--font-display); color: var(--ink); }
.dd-price--sale .dd-price__now { color: var(--accent); }
.dd-price__old { font: 400 15px/20px var(--font-sans); color: var(--ink-muted); text-decoration: line-through; }
.dd-price__badge { font: 700 13px/18px var(--font-sans); color: var(--on-accent); background: var(--accent); padding: 1px 8px; border-radius: var(--radius-pill); }
.dd-price__note { flex-basis: 100%; font: 400 13px/18px var(--font-sans); color: var(--ink-muted); }

/* ---------- ProductCard ---------- */
.dd-card {
  display: flex; flex-direction: column; gap: var(--space-3); width: 100%; max-width: 320px;
  padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: box-shadow .2s ease;
}
.dd-card:hover { box-shadow: var(--shadow-card); }
.dd-card__media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-md); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font: 400 13px/18px var(--font-sans); }
.dd-card__media .dd-energy { position: absolute; left: var(--space-2); bottom: var(--space-2); }
.dd-card__title { margin: 0; font: 600 17px/22px var(--font-sans); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dd-card__params { margin: 0; font: 400 16px/21px var(--font-sans); color: var(--ink-muted); }
.dd-card__actions { display: flex; gap: var(--space-2); margin-top: auto; }
.dd-card__actions .dd-btn { flex: 1; }

/* ---------- FilterChip ---------- */
.dd-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dd-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap-min); padding: 0 var(--space-4);
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
  font: 400 15px/20px var(--font-sans); color: var(--ink); cursor: pointer;
}
.dd-chip[aria-pressed="true"] { background: var(--brand-tint); border-color: var(--brand); font-weight: 600; }
.dd-chip[aria-pressed="true"]::before { content: "✓"; color: var(--brand); font-weight: 700; }
.dd-chip:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.dd-chip__count { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- SegmentedControl ---------- */
.dd-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius-pill); }
.dd-seg__item {
  min-height: 38px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill); background: transparent;
  font: 500 15px/20px var(--font-sans); color: var(--ink); cursor: pointer;
}
.dd-seg__item[aria-selected="true"] { background: var(--surface); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dd-seg__item:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }

/* ---------- CompareTable ---------- */
.dd-compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.dd-compare { border-collapse: collapse; width: 100%; min-width: 560px; font: 400 15px/20px var(--font-sans); font-variant-numeric: tabular-nums; }
.dd-compare th, .dd-compare td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.dd-compare tr:last-child th, .dd-compare tr:last-child td { border-bottom: 0; }
.dd-compare thead th { font: 600 15px/20px var(--font-sans); color: var(--ink); background: var(--surface); }
.dd-compare tbody th { position: sticky; left: 0; background: var(--surface); font-weight: 400; color: var(--ink-muted); white-space: nowrap; }
.dd-compare .is-best { font-weight: 700; color: var(--ink); }
.dd-compare .is-best::after { content: " · najlepšie"; font-weight: 400; color: var(--success); font-size: 13px; }
.dd-compare tr.is-diff td { background: var(--brand-tint); }

/* ---------- PosLine ---------- */
.dd-pos-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.dd-pos-line {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--space-4);
  min-height: var(--tap-pos); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line);
}
.dd-pos-line:last-child { border-bottom: 0; }
.dd-pos-line[aria-selected="true"] { background: var(--brand-tint); }
.dd-pos-line__name { font: 600 17px/22px var(--font-sans); min-width: 0; }
.dd-pos-line__meta { display: block; font: 400 13px/18px var(--font-sans); color: var(--ink-muted); }
.dd-pos-line__meta .is-discount { color: var(--accent); font-weight: 600; }
.dd-pos-line__total { font: 700 20px/24px var(--font-display); font-variant-numeric: tabular-nums; text-align: right; min-width: 110px; }
.dd-qty { display: inline-flex; align-items: center; gap: var(--space-1); }
.dd-qty button {
  width: 48px; height: 48px; border: 0; border-radius: var(--radius-md); background: var(--surface-2);
  font: 600 22px/1 var(--font-sans); color: var(--ink); cursor: pointer;
}
.dd-qty button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.dd-qty output { min-width: 32px; text-align: center; font: 600 20px/24px var(--font-sans); font-variant-numeric: tabular-nums; }

/* ---------- PosTotal ---------- */
.dd-pos-total { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.dd-pos-total__rows { display: flex; flex-direction: column; gap: var(--space-2); font: 400 17px/22px var(--font-sans); font-variant-numeric: tabular-nums; }
.dd-pos-total__row { display: flex; justify-content: space-between; color: var(--ink-muted); }
.dd-pos-total__row.is-discount { color: var(--accent); font-weight: 600; }
.dd-pos-total__sum { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.dd-pos-total__label { font: 600 17px/22px var(--font-sans); }
.dd-pos-total__amount { font: 700 48px/56px var(--font-display); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.dd-pos-total__pay { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-2); }

/* ---------- BottomSheet ---------- */
.dd-sheet { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-2) var(--space-4) var(--space-5); background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-sheet); }
.dd-sheet__grabber { align-self: center; width: 36px; height: 5px; border-radius: var(--radius-pill); background: var(--line-strong); }
.dd-sheet__title { margin: 0; font: 700 22px/28px var(--font-display); }
.dd-option {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center;
  min-height: var(--tap-min); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer;
}
.dd-option:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.dd-option input { width: 22px; height: 22px; accent-color: var(--brand); margin: 0; }
.dd-option__title { font: 600 17px/22px var(--font-sans); }
.dd-option__desc { display: block; font: 400 15px/20px var(--font-sans); color: var(--ink-muted); }
.dd-option__price { font: 600 17px/22px var(--font-sans); font-variant-numeric: tabular-nums; }
.dd-option__price.is-free { color: var(--success); }

/* ---------- OrderStepper ---------- */
.dd-steps { display: grid; grid-template-columns: repeat(var(--ex-steps, 3), 1fr); list-style: none; margin: 0; padding: 0; }
.dd-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; }
.dd-step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.dd-step:first-child::before { display: none; }
.dd-step.is-done::before, .dd-step.is-current::before { background: var(--brand); }
.dd-step__dot {
  position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong); font: 700 15px/1 var(--font-sans); color: var(--ink-muted);
}
.dd-step.is-done .dd-step__dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.dd-step.is-current .dd-step__dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.dd-step__label { font: 600 15px/20px var(--font-sans); }
.dd-step:not(.is-done):not(.is-current) .dd-step__label { font-weight: 400; color: var(--ink-muted); }
.dd-step__time { font: 400 13px/18px var(--font-sans); color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- Logo ---------- */
.dd-logo { display: inline-flex; align-items: center; gap: var(--space-2); height: 32px; color: var(--brand); text-decoration: none; }
.dd-logo svg { display: block; height: 100%; width: auto; overflow: visible; }
.dd-logo__roof { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.dd-logo__sun { fill: var(--gold); }
.dd-logo__word { fill: currentColor; }
.dd-logo__sk { fill: var(--ink); }
.dd-logo__caret { fill: none; stroke: var(--gold); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.dd-logo--on-brand { color: var(--on-brand); }
.dd-logo--on-brand .dd-logo__sk { fill: var(--gold); }
.dd-logo--mono .dd-logo__sun, .dd-logo--mono .dd-logo__sk { fill: currentColor; }
.dd-logo--mono .dd-logo__caret { stroke: currentColor; }
.dd-logo--animate .dd-logo__sun { transform-box: fill-box; transform-origin: center; animation: dd-logo-rise .3s cubic-bezier(.3, 1.3, .5, 1) both; }
.dd-logo--animate .dd-logo__roof { stroke-dasharray: 46; animation: dd-logo-draw .36s ease-in-out .35s both; }
.dd-logo--animate .dd-logo__caret { stroke-dasharray: 26; animation: dd-logo-draw .3s ease-in-out .71s both; }
@keyframes dd-logo-rise { from { transform: translateY(14px); opacity: 0; } }
@keyframes dd-logo-draw { from { stroke-dashoffset: 46; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .dd-logo--animate .dd-logo__sun, .dd-logo--animate .dd-logo__roof, .dd-logo--animate .dd-logo__caret { animation: none; } }

/* ---------- ShelfLabel (100 × 50 mm; na obrazovke 378 × 189 px) ---------- */
.dd-shelf {
  display: flex; flex-direction: column; gap: 4px; width: 378px; height: 189px; padding: 10px 12px;
  background: #fff; color: #1d1d1f; border: 1px solid var(--line); border-radius: 6px; font-family: var(--font-sans);
}
.dd-shelf__head { display: flex; align-items: center; gap: 8px; }
.dd-shelf__head .dd-logo { height: 18px; color: #1d1d1f; }
.dd-shelf__cat { font: 600 11px/14px var(--font-sans); letter-spacing: .5px; text-transform: uppercase; color: #5a5a60; }
.dd-shelf__title { margin: 0; font: 700 15px/18px var(--font-sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dd-shelf__params { margin: 0; font: 400 12px/16px var(--font-sans); color: #5a5a60; }
.dd-shelf__price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; font-variant-numeric: tabular-nums; }
.dd-shelf__price .dd-price__now { font: 800 34px/36px var(--font-display); color: #1d1d1f; letter-spacing: -.5px; }
.dd-shelf--sale .dd-price__now { color: #1d1d1f; }
.dd-shelf__price .dd-price__old { font: 400 14px/18px var(--font-sans); color: #5a5a60; text-decoration: line-through; }
.dd-shelf__price .dd-price__badge { font: 700 12px/16px var(--font-sans); color: #1d1d1f; background: var(--gold); padding: 1px 8px; border-radius: var(--radius-pill); }
.dd-shelf__foot { display: flex; align-items: flex-end; gap: 10px; }
.dd-shelf__foot .dd-energy { height: 24px; min-width: 40px; font-size: 15px; }
.dd-shelf__meta { flex: 1; font: 400 10px/13px var(--font-sans); color: #5a5a60; }
.dd-shelf__qr { width: 44px; height: 44px; flex: none; background:
  linear-gradient(#1d1d1f, #1d1d1f) 0 0/14px 14px no-repeat, linear-gradient(#1d1d1f, #1d1d1f) 100% 0/14px 14px no-repeat,
  linear-gradient(#1d1d1f, #1d1d1f) 0 100%/14px 14px no-repeat, repeating-linear-gradient(90deg, #1d1d1f 0 4px, #fff 4px 8px) 18px 18px/26px 26px no-repeat; }
@media print { .dd-shelf { width: 100mm; height: 50mm; border: 0; border-radius: 0; page-break-inside: avoid; } }
