/**
 * HECmania — „Sestav Si svuj Set" (DV2)
 *
 * Vzhled drží stejný systém jako `widget.css` — bílá karta, oranžové
 * steppery, zelené tlačítko. Barvy se berou z `:root` proměnných,
 * které widget definuje; kdyby konfigurátor běžel sám, mají fallback.
 */
.hec-set-panel {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 20px;
  box-shadow: 0 20px 45px -20px rgba(20, 40, 10, 0.18);
  padding: 22px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

.hec-set-heading {
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #16171a);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.hec-set-krok { display: flex; flex-direction: column; }
/**
 * `display:flex` PŘEBÍJÍ atribut `hidden` — prohlížeč ho překládá jen
 * na `[hidden]{display:none}` z UA stylesheetu, což autorský `display`
 * porazí. Bez tohohle byl krok „A nyní zvol Příchuť" vidět od začátku,
 * i když měl `hidden = true` (Lucky 2026-09-08). Stejná past jako
 * u registračního formuláře.
 */
.hec-set-krok[hidden] { display: none !important; }

/**
 * Popisek kroku — „NEJPRVE ZVOL BATERII" / „A NYNÍ ZVOL PŘÍCHUŤ".
 * Vycentrovaný, oranžový, velkými písmeny (Lucky 2026-09-08).
 */
.hec-set-krok-label {
  font-size: 16px;
  font-weight: 800;
  color: var(--orange, #fd7e14);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 8px 0 12px;
}

.hec-set-row {
  display: grid;
  grid-template-columns: 44px minmax(110px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  min-height: 56px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
}
.hec-set-row:last-child { border-bottom: none; }

/* Volba baterie je klikatelná celá — ne jen malé kolečko. */
.hec-set-row--volba { cursor: pointer; border-radius: 10px; }
.hec-set-row--volba:hover { background: rgba(253, 126, 20, 0.06); }
.hec-set-row--vybrana {
  background: linear-gradient(90deg, rgba(76,175,31,0.16), rgba(253,126,20,0.16));
  box-shadow: inset 3px 0 0 var(--green, #4caf1f);
}

/* Vyprodané zůstává VIDĚT, ale nedá se zvolit. */
.hec-set-row--nedostupny { opacity: 0.45; cursor: not-allowed; }
.hec-set-row--nedostupny:hover { background: none; }

.hec-set-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #eee; }
.hec-set-thumb--prazdny { background: #f4f4f2; border: 1px dashed var(--border, rgba(0,0,0,0.08)); display: block; }

.hec-set-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hec-set-name { font-size: 14px; font-weight: 700; color: var(--text, #16171a); overflow-wrap: break-word; }
.hec-set-stock { font-size: 12px; color: var(--green, #4caf1f); font-weight: 600; }
.hec-set-row--nedostupny .hec-set-stock { color: var(--muted, #5c5f63); }

.hec-set-price {
  font-family: "Source Sans 3", sans-serif;
  font-size: 17px; font-weight: 600; white-space: nowrap;
  color: var(--text, #16171a);
}

.hec-set-stepper { display: flex; align-items: center; gap: 4px; }
.hec-set-input {
  width: 36px; height: 36px; text-align: center;
  border: 1px solid var(--border, rgba(0,0,0,0.08)); border-radius: 6px;
  background: #fff; color: var(--text, #16171a); font-size: 18px; font-weight: 700;
}
.hec-set-input::-webkit-outer-spin-button,
.hec-set-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hec-set-pm { display: flex; flex-direction: column; gap: 2px; }
.hec-set-btn {
  width: 24px; height: 17px; border: none; border-radius: 5px;
  background: var(--orange, #fd7e14); color: #fff;
  font-size: 14px; font-weight: 800; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.hec-set-btn:hover { filter: brightness(1.08); }
.hec-set-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Bonus za celý set — stejný pruh jako hlášky ve widgetu. */
.hec-set-bonus {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(76, 175, 31, 0.14);
  color: #2f6b12;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.hec-set-souhrn {
  font-family: "Source Sans 3", sans-serif;
  font-size: 18px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em;
  text-align: right; color: var(--text, #16171a);
}

.hec-set-chyba {
  padding: 9px 12px; border-radius: 8px;
  background: rgba(179, 38, 30, 0.1); color: #b3261e;
  font-size: 13px; line-height: 1.4;
}

.hec-set-add {
  width: 100%; border: none; border-radius: 6px;
  /* `!important` — Apollo dává `btn-conversion` oranžovou. */
  background: var(--green, #4caf1f) !important; color: #fff !important;
  border: none !important;
  font-size: 15px; font-weight: 700; padding: 15px 20px; cursor: pointer;
  /* Shodné s `hec-xvariant-add-button` ve widget.css — šablona jinak
     tlačítkům `btn` nastavuje uppercase a prostrkání. */
  text-transform: none; letter-spacing: normal;
}
.hec-set-add:hover { filter: brightness(1.05); }
.hec-set-add:disabled { opacity: 0.35; cursor: not-allowed; }

@media (max-width: 600px) {
  .hec-set-panel { padding: 14px; border-radius: 14px; }
  .hec-set-heading { font-size: 17px; }
  .hec-set-row { grid-template-columns: 48px 1fr auto; grid-template-areas: "thumb info stepper" "thumb price stepper"; gap: 8px 12px; }
  .hec-set-thumb { grid-area: thumb; width: 48px; height: 48px; align-self: start; }
  .hec-set-info { grid-area: info; }
  .hec-set-price { grid-area: price; }
  .hec-set-stepper { grid-area: stepper; align-self: center; }
}

/* ---------- hlášky a tabulka pásem (jako ve widgetu) ---------- */
.hec-set-hlasky { display: flex; flex-direction: column; gap: 6px; }
.hec-set-hlaska {
  padding: 12px 16px; border-radius: 8px;
  background: rgba(253, 126, 20, 0.14); color: #b45f00;
  font-size: 15px; font-weight: 700; line-height: 1.45; text-align: center;
}
.hec-set-hlaska--darek { background: rgba(76,175,31,0.14); color: #2f6b12; }

/**
 * Tabulky pásem vedle sebe — vlevo baterie, vpravo příchutě
 * (Lucky 2026-09-08). Jedna skupina = jeden sloupec na plnou šířku,
 * dvě skupiny = půl na půl.
 */
.hec-set-tiers { display: grid; grid-template-columns: 1fr; gap: 10px; }
.hec-set-tiers--dva { grid-template-columns: 1fr 1fr; }

.hec-set-tiers-col {
  display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  min-width: 0;
}

.hec-set-tiers-nadpis {
  padding: 5px 10px;
  background: var(--orange, #fd7e14);
  color: #fff;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.04em; text-align: center;
}
.hec-set-tier {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 8px; padding: 6px 10px;
  font-size: 12px; background: #f4f4f2;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.hec-set-tier:last-child { border-bottom: none; }
.hec-set-tier-range { font-weight: 600; color: var(--text, #16171a); letter-spacing: 0.02em; }
.hec-set-tier-price { font-weight: 700; text-align: right; color: var(--text, #16171a); }
.hec-set-tier-save { font-size: 12.5px; font-weight: 700; color: #2f6b0f; text-align: right; min-width: 44px; }
.hec-set-tier--aktivni {
  background: linear-gradient(90deg, rgba(76,175,31,0.26), rgba(253,126,20,0.26));
  box-shadow: inset 3px 0 0 var(--green, #4caf1f);
}
.hec-set-tier--aktivni .hec-set-tier-range,
.hec-set-tier--aktivni .hec-set-tier-price { color: #16171a; font-weight: 800; }

/**
 * Panel je v pravém sloupci `hec-layout-root` (z widget.css), takže
 * šířku dostane od mřížky. `max-width` je pojistka pro případ, že se
 * sloupce nepostaví a panel skončí přes celou stránku
 * (Lucky 2026-09-08: „nesmí to být takhle široký").
 */
.hec-set-panel { max-width: 560px; }
.hec-layout-root .hec-set-panel { max-width: none; margin: 0; }
@media (max-width: 900px) { .hec-set-panel { max-width: none; } }

/**
 * Šipky galerie („další / předchozí fotka") jsou absolutně pozicované
 * vůči obalu fotky. Po přesunu do sloupce přesahovaly do panelu a
 * ležely přes řádky baterií (Lucky 2026-09-08: „plete se nám tlačítko
 * na přepínání fotek tam").
 *
 * Řešení: levý sloupec fotku ohraničí (`overflow` + `position`), takže
 * šipky zůstanou v něm, a panel dostane vyšší vrstvu.
 */
.hec-layout-root .hec-preview-col-left {
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.hec-layout-root .hec-preview-col-right {
  position: relative;
  z-index: 2;
}
.hec-set-panel { position: relative; z-index: 2; background: var(--card-bg, #fff); }

/* Název i fotka vedou na detail varianty — bez podtržení, barva textu. */
a.hec-set-name { text-decoration: none; color: var(--text, #16171a); }
a.hec-set-name:hover { text-decoration: underline; color: var(--orange, #fd7e14); }
.hec-set-thumb-link { display: block; line-height: 0; }

/**
 * „NEJPRVE ZVOL BATERII" bliká, dokud si zákazník baterii nevybere
 * (Lucky 2026-09-08) — upozorní ho, že tady se začíná. Po výběru se
 * blikání vypne (třída se odebere v `prepocitej()`).
 *
 * `prefers-reduced-motion` blikání vypne úplně — pro citlivé uživatele
 * je pulzování nepříjemné a text zůstane čitelný i bez něj.
 */
@keyframes hec-set-blik {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
.hec-set-krok-label--blika {
  animation: hec-set-blik 1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hec-set-krok-label--blika { animation: none; }
}

/**
 * Vysvětlení nad tabulkou pásem — set vs. samostatný nákup
 * (Lucky 2026-09-08). Stejný zelený pruh jako ostatní hlášky.
 */
.hec-set-vysvetleni {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(76, 175, 31, 0.14);
  color: #2f6b12;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.hec-set-vysvetleni strong { display: block; font-size: 15px; font-weight: 800; }
.hec-set-vysvetleni span { display: block; margin-top: 4px; font-size: 12.5px; opacity: 0.9; }

/* Dva sloupce jsou úzké — menší písmo a těsnější mřížka, ať se cena
   i procento vejdou bez zalomení. */
.hec-set-tiers--dva .hec-set-tier {
  grid-template-columns: auto 1fr auto;
  gap: 4px; padding: 5px 7px; font-size: 11px;
}
.hec-set-tiers--dva .hec-set-tier-save { min-width: 34px; font-size: 11px; }

@media (max-width: 600px) {
  /* Na mobilu pod sebe — vedle sebe by se nevešly. */
  .hec-set-tiers--dva { grid-template-columns: 1fr; }
  .hec-set-tiers--dva .hec-set-tier { font-size: 12px; padding: 8px 10px; }
}
