/* ============================================================
   Rubicon AI — hero slider + „Podívejte se na rozdíl" karty
   Společná produktová karta: před→po (šedivá/mrtvá → barevná/wow).
   ============================================================ */

/* ============================================================
   SDÍLENÁ PRODUKTOVÁ KARTA (.rb-pc)
   Default = before (šedivá, mrtvá). .is-after = barevná wow.
   ============================================================ */
.rb-pc {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--spk-line);
  border-radius: var(--spk-r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  filter: grayscale(1) saturate(0.55) brightness(0.99);
  box-shadow: none;
  transition: box-shadow .55s var(--spk-ease), transform .55s var(--spk-ease),
              border-color .55s var(--spk-ease), filter .65s var(--spk-ease);
}
.rb-pc.is-after {
  filter: none;
  border-color: transparent;
  box-shadow: 0 32px 64px -30px rgba(17, 33, 111, 0.5);
  transform: translateY(-3px);
}
/* Karta je vždy bílá → v dark režimu přepiš ink proměnné lokálně na tmavé,
   jinak by text dědil světlé hodnoty z [data-theme="dark"] a byl nečitelný. */
:root[data-theme="dark"] .rb-pc {
  --spk-ink: #232733;
  --spk-ink-muted: #5C5F6B;
  --spk-ink-dim: #8A8D99;
}

/* media / fotka */
.rb-pc__media {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: var(--spk-bg-soft);
  overflow: hidden;
  transition: background .65s var(--spk-ease);
}
/* médium drž světlé (bílé) — fotky vždy překryjí; bez sytě barevného bg, který problikával */
.rb-pc.is-after .rb-pc__media { background: #fff; }
.rb-pc__icon { color: var(--spk-ink-dim); transition: color .65s var(--spk-ease), transform .65s var(--spk-ease); }
.rb-pc.is-after .rb-pc__icon { color: var(--spk-blue); transform: scale(1.08); }
.rb-pc__photo { width: 100%; height: 100%; object-fit: cover; display: block; }

/* badge (jen after) */
.rb-pc__badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  color: #fff; background: var(--spk-gradient);
  box-shadow: 0 8px 18px -8px rgba(17, 33, 111, .5);
  opacity: 0; transform: translateY(-8px) scale(.9);
  transition: opacity .45s var(--spk-ease) .12s, transform .45s var(--spk-ease) .12s;
}
.rb-pc.is-after .rb-pc__badge { opacity: 1; transform: none; }

/* světelný přejezd při proměně */
.rb-pc__shine {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .55) 50%, transparent 68%);
  transform: translateX(-130%);
  opacity: 0;
}
.rb-pc.is-after .rb-pc__shine { animation: rb-pc-shine 1s var(--spk-ease) .12s 1; }
@keyframes rb-pc-shine {
  0%   { opacity: 0; transform: translateX(-130%); }
  28%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(130%); }
}

/* tělo */
.rb-pc__body { padding: 17px 20px 20px; display: flex; flex-direction: column; gap: 9px; }
.rb-pc__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rb-pc__name {
  margin: 0; font-family: var(--spk-font-display);
  font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--spk-ink);
}
.rb-pc__price {
  font-size: 16px; font-weight: 800; white-space: nowrap;
  color: var(--spk-ink-dim); transition: color .5s var(--spk-ease);
}
.rb-pc.is-after .rb-pc__price { color: var(--spk-blue); }

/* hodnocení (jen after) */
.rb-pc__rating {
  display: flex; align-items: center; gap: 6px; min-height: 17px;
  opacity: 0; transform: translateY(5px);
  transition: opacity .45s var(--spk-ease) .08s, transform .45s var(--spk-ease) .08s;
}
.rb-pc.is-after .rb-pc__rating { opacity: 1; transform: none; }
.rb-pc__stars { display: inline-flex; color: #F2A900; }
.rb-pc__star { fill: currentColor; }
.rb-pc__rnum { font-size: 13px; font-weight: 700; color: var(--spk-ink); }
.rb-pc__rcount { font-size: 12px; color: var(--spk-ink-dim); }

/* popis — PEVNÁ výška (4 řádky), aby všechny karty (before/after, všechny produkty)
   měly stejnou výšku → žádné skákání při přepínání ani nesoulad overlay slideru */
.rb-pc__desc {
  margin: 0; font-size: 14px; line-height: 22px; height: 90px; overflow: hidden;
  color: var(--spk-ink-muted); transition: color .5s var(--spk-ease);
}
.rb-pc.is-after .rb-pc__desc { color: var(--spk-ink); }

/* wow chipy (jen after) */
.rb-pc__tags {
  display: flex; flex-wrap: wrap; gap: 7px; min-height: 26px;
  opacity: 0; transform: translateY(5px);
  transition: opacity .45s var(--spk-ease) .18s, transform .45s var(--spk-ease) .18s;
}
.rb-pc.is-after .rb-pc__tags { opacity: 1; transform: none; }
.rb-pc__tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700; color: var(--spk-blue);
  background: rgba(4, 111, 249, .09); padding: 4px 9px; border-radius: 999px;
}
.rb-pc__tag svg { width: 12px; height: 12px; }

/* ============================================================
   HERO — drag reveal slider
   ============================================================ */
.rb-reveal { max-width: 480px; margin: 0 auto; }
.rb-reveal--hero { max-width: 400px; }
/* overflow hidden → svislá linka děliče se ořízne do rounded rohů karty */
.rb-reveal__stage { position: relative; user-select: none; touch-action: pan-y; border-radius: var(--spk-r-card); overflow: hidden; }
.rb-reveal .rb-pc { max-width: none; width: 100%; border-radius: 0; }
/* ve slideru obě vrstvy musí sedět 1:1 — zrušit zdvih/stín z .is-after (jinak after „uskakuje" o 3 px) */
.rb-reveal .rb-pc.is-after { transform: none; box-shadow: none; }
.rb-reveal__layer--after { position: relative; z-index: 1; }
.rb-reveal__layer--before {
  position: absolute; inset: 0; z-index: 2;
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}
/* chipy jsou UVNITŘ vrstev → klipují se spolu s nimi (Z feedu zmizí, když přejede polished) */
.rb-reveal__chip {
  position: absolute; top: 12px; z-index: 3;
  font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.rb-reveal__chip--before { left: 12px; background: rgba(39, 39, 39, .72); color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.rb-reveal__chip--after  { right: 12px; background: var(--spk-gradient); color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.rb-reveal__handle {
  position: absolute; top: 0; bottom: 0; left: 50%; z-index: 5;
  width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .92);
  cursor: ew-resize; touch-action: none;
}
.rb-reveal__grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 999px; background: #fff;
  box-shadow: var(--spk-shadow-card);
  display: flex; align-items: center; justify-content: center; color: var(--spk-blue);
}
.rb-reveal__grip svg { margin: 0 -3px; }
.rb-reveal__hint { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--spk-ink-dim); }

/* ============================================================
   „ROZDÍL" — karty vedle sebe (realistický e-shop)
   ============================================================ */
.rb-cards__panel {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 22px; align-items: center;
  max-width: 940px; margin: 0 auto;
}
.rb-cards__panel[hidden] { display: none; }
.rb-cards__panel .rb-pc { max-width: none; }
.rb-cards__bridge { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rb-cards__spark {
  width: 50px; height: 50px; border-radius: 999px; color: #fff;
  background: var(--spk-gradient); box-shadow: var(--spk-shadow-grad);
  display: flex; align-items: center; justify-content: center;
}
.rb-cards__bridge-lbl { font-size: 12px; font-weight: 800; letter-spacing: .4px; color: var(--spk-blue); }
/* směrová šipka můstku — desktop vodorovná, mobil svislá */
.rb-cards__bridge-arrow { color: var(--spk-blue); opacity: .9; display: none; }
.rb-cards__bridge-arrow--h { display: inline-flex; }

/* ============================================================
   HERO — produktový carousel (šipky + tečky)
   ============================================================ */
.rb-hcar { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.rb-hcar__track { position: relative; }
.rb-hcar__slide[hidden] { display: none; }
.rb-hcar__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 42px; height: 42px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: none; border: 0;
  opacity: .85; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
  transition: opacity .2s, transform .2s;
}
.rb-hcar__arrow:hover { opacity: 1; transform: translateY(-50%) scale(1.12); }
.rb-hcar__arrow--prev { left: -30px; }
.rb-hcar__arrow--next { right: -30px; }
.rb-hcar__dots { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 18px; }
.rb-hcar__dot {
  width: 7px; height: 7px; border-radius: 999px; padding: 0; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .38); transition: width .25s var(--spk-ease), background .25s var(--spk-ease);
}
.rb-hcar__dot:hover { background: rgba(255, 255, 255, .6); }
.rb-hcar__dot.is-active { width: 22px; background: #fff; }   /* aktivní širší — decentní */

/* ============================================================
   Kategorie (.rb-ba-tabs) — horizontální scroll strip, aktivní vystředěná
   ============================================================ */
/* width:max-content + margin auto → když se taby vejdou, jsou vystředěné (desktop);
   když přetečou, max-width:100% je zúží a scrollují se zleva (mobil). */
.rb-cards .rb-ba-tabs {
  flex-wrap: nowrap; justify-content: flex-start;
  width: max-content; max-width: 100%; margin-inline: auto;
  overflow-x: auto; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 4px 0; cursor: grab;
}
.rb-cards .rb-ba-tabs.is-grabbing { cursor: grabbing; scroll-behavior: auto; }
.rb-cards .rb-ba-tabs::-webkit-scrollbar { display: none; }
.rb-cards .rb-ba-tab { flex: 0 0 auto; }

/* ============================================================
   Responsivita
   ============================================================ */
@media (max-width: 780px) {
  .rb-cards__panel { grid-template-columns: 1fr; gap: 14px; }
  .rb-cards__bridge-arrow--h { display: none; }
  .rb-cards__bridge-arrow--v { display: inline-flex; }     /* mobil: tok shora dolů */
}

/* „Jak to funguje" — na úzkém mobilu diagonální 115° gradient tvořil svislý seam;
   přepnout na svislý směr (čistý tok shora dolů). */
@media (max-width: 760px) {
  .spk-howitworks { background: linear-gradient(168deg, #0E1A52 0%, #14246F 38%, #3A2766 74%, #6E2F58 100%); }
  .spk-howitworks__bg::before { width: 130%; height: 50%; left: -15%; }
}

/* ============================================================
   prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .rb-pc, .rb-pc * { transition: none !important; }
  .rb-pc__shine { animation: none !important; display: none; }
}
