/* =========================================================
   HomeSystem – akciové cenovky a kupóny  (hs-akcie.css v10 · dizajn A)
   obchod.homesystem.sk · Shoptet šablóna 11
   Nahrať cez FTP do user/documents/, po zmene zvýšiť ?v=N
   ========================================================= */

/* ---------- Nastavenie textov ----------
   Nápis sa po dátume z hlavičky (KONIEC_BF) prepne sám
   cez triedu html.hs-po-bf. */
:root {
  --hs-akcia-nadpis: "Black Friday";
  --hs-kupon-nadpis: "Black Friday kupón";
  --hs-kupon-info: "Kód vložte v košíku do poľa Zľavový kupón.";
  --hs-bezna-cena: "Bežná cena ";

  --hs-ink: #1f1f1f;
  --hs-ink-muted: #4d4d4d;
  --hs-yellow: #ffc807;
  --hs-blue-600: #1478c2;
  --hs-blue-700: #1272b3;
  --hs-blue-500: #239ceb;
  --hs-blue-50: #f3f9fe;
  --hs-green: #008000;
  --hs-brand: #239ceb;
  --hs-brand-mid: #1b8fdc;
  --hs-brand-deep: #136fb0;
  --hs-tint: #f3f9fe;
  --hs-line: #e3eef7;
  --hs-red: #cc0000;
}
html.hs-po-bf {
  --hs-akcia-nadpis: "Skvelá cena";
  --hs-kupon-nadpis: "Cena s kupónom";
}

/* =========================================================
   1) DETAIL PRODUKTU – akciová cena v rámčeku  (v10 · dizajn A)
   Modrý pás so šikmou hranou a pruhom v rohu (ako pätička).
   Rozloženie:  [ Black Friday          –45 % ]
                [ €43,90                      ]
                [ Bežná cena €80,99   €35,69 bez DPH ]
                [ Ušetríte €37,09 ]
                [ Do konca akcie zostáva …    ]
   ========================================================= */
.p-detail .p-final-price-wrapper:has(.price-standard) {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 50px auto auto auto;
  align-items: baseline;
  column-gap: 12px;
  box-sizing: border-box;
  width: 400px;
  max-width: 100%;
  margin: 4px 0 14px;
  padding: 0 0 46px;
  border: 2px solid var(--hs-brand);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(to top, var(--hs-tint) 0, var(--hs-tint) 33px, var(--hs-line) 33px, var(--hs-line) 34px, #fff 34px);
}
/* modrý pás so šikmou hranou + pruh v rohu */
.p-detail .p-final-price-wrapper:has(.price-standard)::before {
  content: var(--hs-akcia-nadpis);
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: stretch;
  box-sizing: border-box;
  padding: 9px 16px 0;
  background: linear-gradient(112deg, var(--hs-brand-deep) 0, var(--hs-brand-deep) calc(100% - 130px), var(--hs-brand-mid) calc(100% - 130px));
  clip-path: polygon(0 0, 100% 0, 100% 76%, 0 100%);
  color: #fff;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 20px;
  line-height: 22px;
  white-space: nowrap;
}
/* % zľavy – žltý štítok v páse vpravo */
.p-detail .p-final-price-wrapper:has(.price-standard) .price-save {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 8px 14px 0 0;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--hs-yellow);
  color: var(--hs-ink);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 20px;
  white-space: nowrap;
}
/* nová cena */
.p-detail .p-final-price-wrapper:has(.price-standard) .price-final {
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 2px 16px 0;
  color: var(--hs-ink);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
}
/* „Bežná cena €80,99“ */
.p-detail .p-final-price-wrapper:has(.price-standard) .price-standard {
  grid-column: 1;
  grid-row: 3;
  display: block;
  padding: 2px 0 0 16px;
  color: var(--hs-ink-muted);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.p-detail .p-final-price-wrapper:has(.price-standard) .price-standard::before {
  content: var(--hs-bezna-cena);
}
.p-detail .p-final-price-wrapper:has(.price-standard) .price-standard > span {
  text-decoration: line-through;
}
.p-detail .p-final-price-wrapper:has(.price-standard) .price-additional {
  grid-column: 2;
  grid-row: 3;
  justify-self: end;
  padding: 2px 16px 0 0;
  color: var(--hs-ink-muted);
  font-size: 14px;
  white-space: nowrap;
}
/* jednotková cena sa v rámčeku nezobrazuje */
.p-detail .p-final-price-wrapper:has(.price-standard) .price-measure {
  display: none;
}
/* „Ušetríte €37,09“ – miesto rezervované, skript doplní text */
.p-detail .p-final-price-wrapper:has(.price-standard)::after {
  content: attr(data-hs-usetrite);
  grid-column: 1 / -1;
  grid-row: 4;
  justify-self: start;
  display: block;
  min-height: 26px;
  margin: 6px 16px 0;
  padding: 0 8px;
  border-radius: 8px;
  color: #006b00;
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 26px;
}
.p-detail .p-final-price-wrapper[data-hs-usetrite]:has(.price-standard)::after {
  background: #e6f4e6;
}
/* svetlomodrý pás s odpočtom / textom dole */
.p-detail .p-final-price-wrapper .hs-odpocet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 33px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--hs-brand-deep);
}

@media (max-width: 480px) {
  .p-detail .p-final-price-wrapper:has(.price-standard) { width: 100%; }
  .p-detail .p-final-price-wrapper:has(.price-standard)::before { font-size: 18px; }
  .p-detail .p-final-price-wrapper:has(.price-standard) .price-save { font-size: 15px; padding: 2px 8px; }
  .p-detail .p-final-price-wrapper:has(.price-standard) .price-final { font-size: 30px; }
}

/* =========================================================
   2) VÝPIS KATEGÓRIE – akciová cena v malom rámčeku  (v10 · dizajn A)
   Rozloženie:  [ Black Friday  (modrý pás)  ]
                [ €43,90          –45 %   ]
                [ €80,99                  ]
                [ Končí za 2 dni 05:44:19 ]
   ========================================================= */
html.hs-js .product .flags .flag-discount {
  display: none;
}
.product:has(.flag-discount) .prices,
.product.hs-akcia .prices {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 26px auto 18px;
  align-items: center;
  box-sizing: border-box;
  border: 2px solid var(--hs-brand);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.product:has(.flag-discount) .prices::before,
.product.hs-akcia .prices::before {
  content: var(--hs-akcia-nadpis);
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: stretch;
  box-sizing: border-box;
  padding: 3px 10px 0;
  background: linear-gradient(112deg, var(--hs-brand-deep) 0, var(--hs-brand-deep) calc(100% - 60px), var(--hs-brand-mid) calc(100% - 60px));
  clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
  color: #fff;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 13px;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
}
.product:has(.flag-discount) .prices .price-final,
.product.hs-akcia .prices .price-final {
  grid-column: 1;
  grid-row: 2;
  padding: 2px 10px 0;
  color: var(--hs-ink);
  font-weight: 700;
  white-space: nowrap;
}
.product.hs-akcia .prices .price-standard {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
  padding: 0 10px;
  color: var(--hs-ink-muted);
  font-size: 13px;
  line-height: 16px;
  white-space: nowrap;
  text-decoration: line-through;
}
.product.hs-akcia .prices .price-save {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: center;
  margin-right: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--hs-yellow);
  color: var(--hs-ink);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 18px;
  white-space: nowrap;
}
.product:has(.flag-discount) .prices .price-measure,
.product.hs-akcia .prices .price-measure {
  display: none;
}

/* menšia medzera medzi názvom a cenou */
.product .ratings-wrapper {
  min-height: 0;
  padding-bottom: 6px;
}
.product a.name {
  margin-bottom: 6px;
}

/* =========================================================
   3) KUPÓN – blok z krátkeho popisu produktu
   <div class="hs-kupon" data-kod="KOD"><p>Kúp s kupónom za <strong>€17,99</strong></p></div>
   ========================================================= */
.hs-kupon {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  grid-template-rows: auto auto 46px;
  column-gap: 10px;
  row-gap: 10px;
  box-sizing: border-box;
  width: 440px;
  max-width: 100%;
  margin: 16px 0;
  padding: 0 22px 16px;
  border: 2px dashed var(--hs-blue-600);
  border-radius: 8px;
  background: var(--hs-blue-50);
  color: var(--hs-ink-muted);
  font-family: "Source Sans 3", sans-serif;
}
/* štítok hore */
.hs-kupon::before {
  content: var(--hs-kupon-nadpis);
  grid-column: 1 / -1;
  justify-self: start;
  margin: 0 0 2px -22px;
  padding: 4px 10px;
  border-radius: 6px 0 8px 0;
  background: var(--hs-brand-deep);
  color: #fff;
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: 13px;
  line-height: 18px;
}
/* „Kúp s kupónom za €17,99“ + pokyn */
.hs-kupon > p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--hs-blue-700);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
}
.hs-kupon > p strong {
  margin-left: 6px;
  color: var(--hs-ink);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}
.hs-kupon > p::after {
  content: var(--hs-kupon-info);
  display: block;
  margin-top: 6px;
  color: var(--hs-ink-muted);
  font-family: "Source Sans 3", sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
}
/* kód kupónu */
.hs-kupon::after {
  content: attr(data-kod);
  grid-column: 1;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 46px;
  border: 2px dashed var(--hs-ink);
  border-radius: 5px;
  background: #fff;
  color: var(--hs-ink);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .12em;
  overflow: hidden;
  white-space: nowrap;
}
/* tlačidlo Kopírovať (pridá ho hs-akcie.js do rezervovaného miesta) */
.hs-kupon .hs-kupon-btn {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 12px;
  border: 2px solid var(--hs-blue-500);
  border-radius: 8px;
  background: #fff;
  color: var(--hs-blue-700);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  cursor: pointer;
}
.hs-kupon .hs-kupon-btn:hover,
.hs-kupon .hs-kupon-btn.is-copied {
  background: var(--hs-blue-700);
  border-color: var(--hs-blue-700);
  color: #fff;
}
.hs-kupon .hs-kupon-btn:focus-visible {
  outline: 3px solid var(--hs-ink);
  outline-offset: 2px;
}
.hs-kupon .hs-kupon-btn svg { flex-shrink: 0; }

@media (max-width: 480px) {
  .hs-kupon { width: 100%; padding: 0 16px 14px; grid-template-columns: minmax(0, 1fr) 132px; }
  .hs-kupon::before { margin-left: -16px; }
  .hs-kupon::after { font-size: 17px; letter-spacing: .08em; }
  .hs-kupon > p strong { font-size: 28px; }
}

/* =========================================================
   4) VEĽKOOBCHOD – kupóny sa nezobrazujú
   Trieda html.hs-vo sa nastaví v hlavičke podľa skupiny zákazníka.
   Ak vytvoríte príznak „Black Friday kupón“, doplňte jeho triedu
   (napr. .flag-custom5) do zoznamu nižšie.
   ========================================================= */
html.hs-vo .hs-kupon,
html.hs-vo .flag.flag-hs-kupon {
  display: none !important;
}

/* =========================================================
   5) ODPOČET A TEXT POD CENOU  (v9)
   ========================================================= */
.hs-odpocet strong {
  color: var(--hs-ink);
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hs-odpocet.is-dlhodobo strong { display: none; }

/* pás v karte produktu – pripravený vopred */
html:not(.hs-po-bf) .product:has(.flag-discount) .prices,
html:not(.hs-po-bf) .product.hs-akcia .prices,
.product.hs-akcia .prices.hs-ma-odpocet {
  padding-bottom: 24px;
  background: linear-gradient(to top, var(--hs-tint) 0, var(--hs-tint) 23px, var(--hs-line) 23px, var(--hs-line) 24px, #fff 24px);
}
.product .prices .hs-odpocet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 23px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--hs-brand-deep);
  white-space: nowrap;
  overflow: hidden;
}

/* kupón */
.hs-kupon {
  grid-template-rows: auto auto 46px 20px;
}
.hs-kupon .hs-odpocet {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  color: var(--hs-ink);
}

/* posledných 24 hodín */
.p-detail .p-final-price-wrapper .hs-odpocet.is-posledny-den,
.product .prices .hs-odpocet.is-posledny-den {
  background: var(--hs-yellow);
  color: var(--hs-ink);
}
.hs-kupon .hs-odpocet.is-posledny-den strong {
  color: #b00000;
}

/* po Black Friday: kupón bez vlastného dátumu bez odpočtu */
html.hs-po-bf .hs-kupon:not([data-do]) .hs-odpocet {
  display: none !important;
}
html.hs-po-bf .hs-kupon:not([data-do]) {
  grid-template-rows: auto auto 46px;
}

/* =========================================================
   6) VEĽKÁ ZĽAVA (od HS_VELKA_ZLAVA %, predvolene 40 %)
   Len farebne: červený štítok s percentom.
   ========================================================= */
.p-detail .p-final-price-wrapper.hs-velka-zlava:has(.price-standard) .price-save,
.product.hs-velka-zlava .prices .price-save {
  background: var(--hs-red);
  color: #fff;
}

/* =========================================================
   7) Štítok „Zľava“ (príznak Akcia) pri akciovom rámčeku skrytý
   ========================================================= */
.product:has(.flag-discount) .flags .flag-action,
.product.hs-akcia .flags .flag-action,
.p-detail:has(.p-final-price-wrapper .price-standard) .flags .flag-action {
  display: none;
}
