/* SCARLETT.CZ – AKCE X+Y (1+1, 2+1 …) V1
 * Design karty akce na detailu produktu (vykresluje scarlett-akce-xy-v1.js)
 * + výraznější štítek „1 + 1“ u fotek a ve výpisu produktů.
 */

/* původní Shoptet banner schovat až ve chvíli, kdy je nový design hotový */
.xyDiscount__banner.sc-xy-native { display: none !important; }

.sc-xy {
  --sc-xy-red: var(--sc-red, #C8232B);
  --sc-xy-green: var(--sc-green, #4E6352);
  position: relative;
  margin: 18px 0 6px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(200, 35, 43, .10) 0%, rgba(200, 35, 43, 0) 60%),
    #FFF7F4;
  border: 1.5px solid rgba(200, 35, 43, .28);
  box-shadow: 0 10px 28px rgba(120, 30, 20, .08);
  font-family: var(--sc-font-body, "Nunito Sans", Arial, sans-serif);
  color: #2A2A2A;
  overflow: hidden;
}
.sc-xy p { margin: 0 !important; }

/* ---------- horní část: odznak + nadpis ---------- */
.sc-xy__top { display: flex; gap: 14px; align-items: flex-start; }
.sc-xy__badge {
  flex: 0 0 auto;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--sc-xy-red);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(200, 35, 43, .35), inset 0 0 0 3px rgba(255, 255, 255, .25);
  transform: rotate(-8deg);
  animation: scXyPop .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
.sc-xy__badge span {
  font-family: var(--sc-font-head, "Nunito", Arial, sans-serif);
  font-size: 25px; font-weight: 900; line-height: 1; letter-spacing: -.02em;
}
.sc-xy__badge small {
  margin-top: 3px;
  font-size: 9.5px; font-weight: 900; letter-spacing: .12em; line-height: 1;
}
@keyframes scXyPop {
  from { transform: rotate(-8deg) scale(.4); opacity: 0; }
  to   { transform: rotate(-8deg) scale(1); opacity: 1; }
}

.sc-xy__head { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.sc-xy__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--sc-xy-red);
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.sc-xy__eyebrow svg { width: 15px; height: 15px; flex: 0 0 auto; }
.sc-xy__title {
  font-family: var(--sc-font-head, "Nunito", Arial, sans-serif);
  font-size: 21px; font-weight: 900; line-height: 1.2; color: #1F1F1F;
}
.sc-xy__text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; color: #4A4A4A; }

/* ---------- vizuál: dlaždice produktů + výpočet ---------- */
.sc-xy__deal {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.sc-xy__tiles { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.sc-xy__tile {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 12px;
  background: #F4F1EC;
  border: 1.5px solid rgba(0, 0, 0, .08);
  overflow: hidden;
  flex: 0 0 auto;
}
.sc-xy__tile img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.sc-xy__tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2px 0;
  background: rgba(40, 40, 40, .72);
  color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-align: center; text-transform: uppercase;
}
.sc-xy__tile.is-free {
  border-color: var(--sc-xy-red);
  box-shadow: 0 0 0 3px rgba(200, 35, 43, .14);
}
.sc-xy__tile.is-free .sc-xy__tag { background: var(--sc-xy-red); font-size: 10px; font-weight: 900; }
/* dárek = jiný produkt zdarma */
a.sc-xy__tile { text-decoration: none !important; }
.sc-xy__tile.is-gift { background: #FFF1EE; display: flex; align-items: center; justify-content: center; }
.sc-xy__gift-ico { display: flex; padding-bottom: 14px; color: var(--sc-xy-red); }
.sc-xy__gift-ico svg { width: 30px; height: 30px; }
.sc-xy__gift-line { font-size: 13.5px; font-weight: 800; color: var(--sc-xy-red); line-height: 1.35; }
.sc-xy.is-gift-self .sc-xy__deal,
.sc-xy.is-gift-self .sc-xy__btn { display: none !important; }
.sc-xy__plus {
  font-family: var(--sc-font-head, "Nunito", Arial, sans-serif);
  font-size: 20px; font-weight: 900; color: #9A9A9A;
}

.sc-xy__math { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sc-xy__math:empty { display: none; }
.sc-xy__total { font-size: 14px; color: #3A3A3A; }
.sc-xy__total strong {
  font-family: var(--sc-font-head, "Nunito", Arial, sans-serif);
  font-size: 20px; font-weight: 900; color: var(--sc-xy-red); white-space: nowrap;
}
.sc-xy__total s { margin-left: 4px; color: #9A9A9A; font-size: 13px; white-space: nowrap; }
.sc-xy__save {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sc-xy-green);
  color: #fff;
  font-size: 12.5px; font-weight: 800;
}
.sc-xy__per { font-size: 12.5px; color: #6A6A6A; }

/* ---------- odpočet ---------- */
.sc-xy__timer {
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13.5px; font-weight: 700; color: #3A3A3A;
}
.sc-xy__timer svg { width: 18px; height: 18px; color: var(--sc-xy-red); flex: 0 0 auto; }
.sc-xy__count {
  padding: 2px 10px;
  border-radius: 8px;
  background: #2A2A2A;
  color: #fff;
  font-family: var(--sc-font-head, "Nunito", Arial, sans-serif);
  font-weight: 900; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.sc-xy__until { color: #7A7A7A; font-weight: 600; font-size: 12.5px; }

/* ---------- tlačítko ---------- */
.sc-xy__actions { margin-top: 14px; display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.sc-xy__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--sc-xy-red);
  color: #fff;
  font-family: var(--sc-font-head, "Nunito", Arial, sans-serif);
  font-size: 15px; font-weight: 900; letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(200, 35, 43, .28);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.sc-xy__btn::after { content: "→"; }
.sc-xy__btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(200, 35, 43, .34); background: #B11E25; }
.sc-xy__btn:focus-visible { outline: 3px solid rgba(200, 35, 43, .4); outline-offset: 2px; }
.sc-xy__cond { font-size: 12.5px; color: #6A6A6A !important; text-decoration: underline !important; }
.sc-xy__cond:hover { color: var(--sc-xy-red) !important; }

.sc-xy.is-debug { outline: 2px dashed #0a7cff; outline-offset: 3px; }

/* ---------- mobil ---------- */
@media (max-width: 575px) {
  .sc-xy { padding: 15px 14px 14px; border-radius: 16px; }
  .sc-xy__badge { width: 60px; height: 60px; }
  .sc-xy__badge span { font-size: 21px; }
  .sc-xy__title { font-size: 18px; }
  .sc-xy__tile { width: 54px; height: 54px; }
  .sc-xy__btn { width: 100%; }
  .sc-xy__actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-xy__badge { animation: none; }
}

/* ---------- oznámení „Do košíku jsme přidali dárek“ ---------- */
/* výrazná bílá karta s červeným dárkem – musí být vidět i přes tmavé okno „Přidáno do košíku“ */
.sc-xy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2147483000;
  display: flex; align-items: center; gap: 14px;
  width: max-content;
  max-width: min(680px, calc(100vw - 24px));
  padding: 14px 22px 14px 14px;
  border-radius: 18px;
  background: #fff;
  border: 2px solid var(--sc-red, #C8232B);
  color: #1F1F1F;
  font-family: var(--sc-font-head, "Nunito", Arial, sans-serif);
  font-size: 16.5px; font-weight: 800; line-height: 1.3;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 6px rgba(200, 35, 43, .18);
  opacity: 0;
  transform: translate(-50%, 30px) scale(.9);
  transition: opacity .3s ease, transform .45s cubic-bezier(.2, 1.5, .4, 1);
  pointer-events: none;
}
.sc-xy-toast.is-in { opacity: 1; transform: translate(-50%, 0) scale(1); }
.sc-xy-toast svg {
  width: 44px; height: 44px; flex: 0 0 auto;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--sc-red, #C8232B);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(200, 35, 43, .5);
}
.sc-xy-toast.is-in svg { animation: scXyToastPulse 1.4s ease-out .3s 2; }
@keyframes scXyToastPulse {
  0%   { box-shadow: 0 0 0 0 rgba(200, 35, 43, .55); transform: rotate(0); }
  15%  { transform: rotate(-12deg); }
  30%  { transform: rotate(10deg); }
  45%  { transform: rotate(0); }
  100% { box-shadow: 0 0 0 16px rgba(200, 35, 43, 0); }
}
@media (max-width: 767px) {
  .sc-xy-toast {
    bottom: 90px; /* nad spodní lištou detailu */
    width: calc(100vw - 24px);
    font-size: 15px;
    padding: 12px 16px 12px 12px;
  }
  .sc-xy-toast svg { width: 40px; height: 40px; padding: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-xy-toast, .sc-xy-toast.is-in svg { transition: opacity .2s; animation: none; }
}

/* ---------- štítek „1 + 1“ u fotky a ve výpisu ---------- */
.flags .flag.flag-xy-discount {
  background: var(--sc-red, #C8232B) !important;
  color: #fff !important;
  font-weight: 900 !important;
  letter-spacing: .02em !important;
  box-shadow: 0 3px 10px rgba(200, 35, 43, .3) !important;
}
