/*
 * Boční košík a let kusu do košíku.
 *
 * Panel vyjíždí zprava posunem (`transform`), ne změnou šířky:
 * posun prohlížeč animuje na grafické kartě a nepřepočítává kvůli
 * němu layout.
 */

/* ------------------------------------------------------------------ */
/* Letící fotka                                                        */
/* ------------------------------------------------------------------ */

.ls-letec {
  position: fixed;
  z-index: 90;
  overflow: hidden;
  pointer-events: none;

  background: var(--ls-surface);
  box-shadow: 0 10px 24px -12px rgb(0 0 0 / 0.35);
  will-change: transform, opacity;
}

.ls-letec img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
 * Cíl letu sedí přesně na ikoně košíku v hlavičce. Je to samostatný
 * prvek, ne sama ikona: ikonu po přidání kusu PrestaShop překresluje,
 * takže by cíl zmizel uprostřed letu.
 */
.ls-cil-letu {
  position: fixed;
  top: 4.5rem;
  right: 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  pointer-events: none;
}

@media (max-width: 1023.98px) {
  .ls-cil-letu {
    top: 3.75rem;
    right: 1.5rem;
  }
}

/* ------------------------------------------------------------------ */
/* Panel                                                               */
/* ------------------------------------------------------------------ */

.ls-kosik-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.ls-kosik-panel__stin {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;

  background: rgb(0 0 0 / 0.45);
  opacity: 0;
  transition: opacity 250ms ease;
}

.ls-kosik-panel[data-otevreno] .ls-kosik-panel__stin {
  opacity: 1;
}

.ls-kosik-panel__obsah {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;

  width: min(92vw, 25rem);
  display: flex;
  flex-direction: column;

  background: var(--ls-bg);
  box-shadow: -4px 0 20px -8px rgb(0 0 0 / 0.3);

  transform: translateX(100%);
  transition: transform 300ms ease;
}

.ls-kosik-panel[data-otevreno] .ls-kosik-panel__obsah {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .ls-kosik-panel__stin,
  .ls-kosik-panel__obsah {
    transition-duration: 1ms;
  }
}

.ls-kosik-panel__hlavicka {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ls-line);
}

.ls-kosik-panel__titulek {
  margin: 0;
  font-family: var(--ls-font-heading);
  font-size: 1.25rem;
  color: var(--ls-ink);
}

.ls-kosik-panel__zavrit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ls-ink);
}

.ls-kosik-panel__zavrit:hover {
  color: var(--ls-gold-text);
}

/* Jediná část, která se posouvá -- hlavička a patka zůstávají na očích. */
.ls-kosik-panel__telo {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 1.25rem;
}

.ls-kosik-panel__prazdno {
  margin: 2.5rem 0;
  text-align: center;
  font-family: var(--ls-font-body);
  color: var(--ls-body);
}

/* ------------------------------------------------------------------ */
/* Řádky košíku                                                        */
/* ------------------------------------------------------------------ */

.ls-kosik-radky {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ls-kosik-radek {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--ls-line);
}

.ls-kosik-radek__foto {
  flex: none;
  display: block;
  width: 4rem;
  height: 4rem;
  overflow: hidden;
  background: var(--ls-surface);
}

.ls-kosik-radek__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ls-kosik-radek__popis {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--ls-font-body);
}

.ls-kosik-radek__nazev {
  font-family: var(--ls-font-heading);
  font-size: 0.9375rem;
  color: var(--ls-ink);
  text-decoration: none;
}

.ls-kosik-radek__nazev:hover {
  color: var(--ls-gold-text);
}

.ls-kosik-radek__cena {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ls-ink);
}

.ls-kosik-radek__odebrat {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--ls-muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.ls-kosik-radek__odebrat:hover {
  color: var(--ls-ink);
}

/* ------------------------------------------------------------------ */
/* Patka panelu                                                        */
/* ------------------------------------------------------------------ */

.ls-kosik-panel__patka {
  padding: 1.25rem;
  border-top: 1px solid var(--ls-line);
  background: var(--ls-surface);
  font-family: var(--ls-font-body);
}

.ls-kosik-panel__celkem {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--ls-ink);
}

.ls-kosik-panel__celkem strong {
  font-size: 1.125rem;
}

/* Doprava je vysvetlivka pod mezisouctem, ne dalsi radek uctu. */
.ls-kosik-panel__doprava {
  margin: -0.5rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--ls-muted);
}

/*
 * Odpocet pod tlacitkem, ne nad nim: je to ujisteni ("kus je vas"),
 * ne podminka, kterou by mel clovek cist driv, nez klikne.
 */
.ls-kosik-panel__rezervace {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ls-muted);
}

/* Bez `tabular-nums` se radek pri kazde zmene cislice o kousek posune. */
.ls-kosik-panel__rezervace strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ls-ink);
}

.ls-kosik-panel__rezervace[data-ls-dochazi],
.ls-kosik-panel__rezervace[data-ls-dochazi] strong {
  color: var(--ls-gold-text);
}

.ls-kosik-panel__pokladna {
  display: block;
  padding: 0.875rem 1rem;
  text-align: center;

  background: var(--ls-gold);
  color: var(--ls-ink);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.ls-kosik-panel__pokladna:hover {
  background: var(--ls-gold-dark);
  color: var(--ls-ink);
}

.ls-kosik-panel__prehled {
  display: block;
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ls-body);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ls-kosik-panel__prehled:hover {
  color: var(--ls-gold-text);
}
