/* Axello runtime CSS (schemaVersion 2)
   Vkládá se do Shoptetu jednou (inline <style>), v editoru do iframe náhledu.
   Vše je scoped pod .axello-article[data-axello="2"], kromě karty markeru (.axello-card), která se kreslí do <body>.
   CSS konkrétního článku (spany, mezery, výšky, carousel) jde zvlášť v <style> exportu a má vyšší specificitu. */

.axello-article[data-axello="2"] {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
}
.axello-article[data-axello="2"] *,
.axello-article[data-axello="2"] *::before,
.axello-article[data-axello="2"] *::after {
  box-sizing: border-box;
}

/* ---- Grid (12 sloupců; spany, pořadí a mezery doplňuje CSS článku) ---- */
.axello-article[data-axello="2"] .axello-article-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  width: 100%;
}
.axello-article[data-axello="2"] .axello-article-grid > * {
  min-width: 0;
}

/* ---- Text ---- */
.axello-article[data-axello="2"] .axello-article-rich-text {
  overflow-wrap: break-word;
}

/* ---- Tlačítko ---- */
.axello-article[data-axello="2"] .axello-align-left { text-align: left; }
.axello-article[data-axello="2"] .axello-align-center { text-align: center; }
.axello-article[data-axello="2"] .axello-align-right { text-align: right; }
/* Záložní vzhled bez motivu Shoptetu (nulová specificita, motiv .btn .btn-default ho přebije) */
:where(.axello-article[data-axello="2"] .axello-article-button > a) {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 4px;
  background: #161617;
  color: #fff;
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
:where(.axello-article[data-axello="2"] .axello-article-button > a):hover {
  background: #8c959d;
}

/* ---- Obrázek s markery ---- */
.axello-article[data-axello="2"] .axello-article-image-marker {
  display: block;
  max-width: 100%;
}
/* Wrapper obepíná přesně fotku, takže procentní pozice markerů sedí i v natažené buňce gridu */
.axello-article[data-axello="2"] .axello-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
}
.axello-article[data-axello="2"] .axello-image-wrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
}
.axello-article[data-axello="2"] .axello-image-link {
  display: block;
  line-height: 0;
}

/* ---- Marker: bílé kolečko 15 px + pulzující prstenec 25 px, střed přesně na souřadnici ---- */
.axello-article[data-axello="2"] .axello-marker {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  z-index: 2;
  width: 25px;
  height: 25px;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Větší zásahová plocha pro prst */
.axello-article[data-axello="2"] .axello-marker::after {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;
}
.axello-article[data-axello="2"] .axello-marker:focus-visible {
  outline: 2px solid #161617;
  outline-offset: 3px;
  border-radius: 50%;
}
/* Skrytí výplňové tečky ve spanech (editor Shoptetu prázdné spany maže) */
.axello-article[data-axello="2"] .axello-marker-ring,
.axello-article[data-axello="2"] .axello-marker-dot {
  font-size: 0;
  line-height: 0;
  color: transparent;
  overflow: hidden;
}
.axello-article[data-axello="2"] .axello-marker-ring {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 3px solid #d1d5db;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
  animation: axello-marker-pulse 2s ease-out infinite;
}
.axello-article[data-axello="2"] .axello-marker-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: transform 0.15s ease;
}
.axello-article[data-axello="2"] .axello-marker:hover .axello-marker-dot,
.axello-article[data-axello="2"] .axello-marker[aria-expanded="true"] .axello-marker-dot {
  transform: scale(1.18);
}
@keyframes axello-marker-pulse {
  0% { transform: scale(0.85); opacity: 1; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ---- Carousel: scroll-snap track funguje bez JS (swipe), runtime přidá šipky a tečky ---- */
.axello-article[data-axello="2"] .axello-article-carousel {
  position: relative;
  max-width: 100%;
}
.axello-article[data-axello="2"] .axello-carousel-track {
  display: flex;
  align-items: flex-start;
  gap: var(--ax-gap, 12px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.axello-article[data-axello="2"] .axello-article-carousel[data-ax-init] .axello-carousel-track {
  scrollbar-width: none;
}
.axello-article[data-axello="2"] .axello-article-carousel[data-ax-init] .axello-carousel-track::-webkit-scrollbar {
  display: none;
}
.axello-article[data-axello="2"] .axello-carousel-slide {
  flex: 0 0 calc((100% - (var(--ax-per-view, 1) - 1) * var(--ax-gap, 12px)) / var(--ax-per-view, 1));
  min-width: 0;
  scroll-snap-align: start;
}
.axello-article[data-axello="2"] .axello-carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
}
.axello-article[data-axello="2"] .axello-carousel-link {
  display: block;
  text-decoration: none;
}
.axello-article[data-axello="2"] .axello-carousel-link:hover,
.axello-article[data-axello="2"] .axello-carousel-link:focus {
  text-decoration: none;
}
/* Titulek pod fotkou (název produktu): na střed, 14 px, tmavý text, nejvýš 2 řádky */
.axello-article[data-axello="2"] .axello-carousel-caption {
  display: -webkit-box;
  margin: 8px 0 0;
  padding: 0;
  overflow: hidden;
  color: #161617;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.axello-article[data-axello="2"] .axello-carousel-nav {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.axello-article[data-axello="2"] .axello-carousel-nav:hover {
  background: #fff;
}
.axello-article[data-axello="2"] .axello-carousel-nav:focus-visible {
  outline: 2px solid #161617;
  outline-offset: 2px;
}
.axello-article[data-axello="2"] .axello-carousel-nav::before {
  content: "";
  width: 10px;
  height: 10px;
  border: solid #161617;
  border-width: 0 2px 2px 0;
}
.axello-article[data-axello="2"] .axello-carousel-prev { left: 8px; }
.axello-article[data-axello="2"] .axello-carousel-next { right: 8px; }
.axello-article[data-axello="2"] .axello-carousel-prev::before { transform: translateX(2px) rotate(135deg); }
.axello-article[data-axello="2"] .axello-carousel-next::before { transform: translateX(-2px) rotate(-45deg); }
.axello-article[data-axello="2"] .axello-carousel-nav[disabled] {
  opacity: 0;
  pointer-events: none;
}
.axello-article[data-axello="2"] .axello-carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  line-height: 0;
}
.axello-article[data-axello="2"] .axello-carousel-dot {
  all: unset;
  box-sizing: border-box;
  position: relative;
  width: 8px;
  height: 8px;
  margin: 0 4px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.axello-article[data-axello="2"] .axello-carousel-dot::after {
  content: "";
  position: absolute;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -8px;
}
.axello-article[data-axello="2"] .axello-carousel-dot[aria-current="true"] {
  background: #161617;
  transform: scale(1.25);
}
.axello-article[data-axello="2"] .axello-carousel-dot:focus-visible {
  outline: 2px solid #161617;
  outline-offset: 3px;
}
.axello-article[data-axello="2"] .axello-article-carousel.axello-carousel--static .axello-carousel-nav,
.axello-article[data-axello="2"] .axello-article-carousel.axello-carousel--static .axello-carousel-dots {
  display: none;
}

/* ---- Video: responzivní 16:9 (funguje i bez JS) ---- */
.axello-article[data-axello="2"] .axello-article-video {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
}
.axello-article[data-axello="2"] .axello-article-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Mezera ---- */
.axello-article[data-axello="2"] .axello-article-spacer {
  display: block;
  width: 100%;
  height: 0;
}

/* ---- Karta markeru (renderuje se do <body>, proto mimo scope článku) ---- */
.axello-card {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  width: max-content;
  max-width: min(340px, calc(100vw - 16px));
  margin: 0;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  color: #161617;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.axello-card.axello-card--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}
.axello-card *,
.axello-card *::before,
.axello-card *::after {
  box-sizing: border-box;
}
/* Neviditelný most mezi markerem a kartou, aby se při přejetí myší nezavřela */
.axello-card::before {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  height: 18px;
}
.axello-card[data-placement="top"]::before { bottom: -18px; }
.axello-card[data-placement="bottom"]::before { top: -18px; }
.axello-card .axello-card-image {
  flex: 0 0 100px;
  width: 100px;
  max-height: 150px;
  overflow: hidden;
  border-radius: 8px 0 0 8px;
  background: #f3f4f6;
}
.axello-card .axello-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100px;
  margin: 0;
  border: 0;
  object-fit: cover;
}
.axello-card .axello-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
}
.axello-card .axello-card-title {
  margin: 0;
  color: #161617;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.axello-card .axello-card-desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #666;
  font-size: 14px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.axello-card .axello-card-btn {
  display: inline-block;
  align-self: flex-start;
  margin: 2px 0 0;
  padding: 7px 16px;
  border: 0;
  border-radius: 4px;
  background: #000;
  color: #fff !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s ease;
}
.axello-card .axello-card-btn:hover,
.axello-card .axello-card-btn:focus-visible {
  background: #8c959d;
}
/* Štítek u vyprodaného produktu (doplňuje runtime podle produktové stránky, cena se nikde nezobrazuje) */
.axello-card .axello-card-badge {
  align-self: flex-start;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fdecea;
  color: #9a1f19;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.axello-card .axello-card-arrow {
  position: absolute;
  left: var(--ax-arrow-x, 50%);
  width: 12px;
  height: 12px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
}
.axello-card[data-placement="top"] .axello-card-arrow {
  bottom: -6px;
  box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.07);
}
.axello-card[data-placement="bottom"] .axello-card-arrow {
  top: -6px;
  box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.07);
}

@media (prefers-reduced-motion: reduce) {
  .axello-article[data-axello="2"] .axello-marker-ring { animation: none; }
  .axello-card,
  .axello-card.axello-card--open { transition: none; transform: none; }
}
