/* =============================================================================
   EMlines — Zastávky: hero + produktové karusely
   Prefixovanie: pz- (Product Zástavky).
   Načítavané po styles.css a products.css.
   ============================================================================= */

/* ============ HERO ============ */
.pz-hero {
  background: var(--em-grad-hero);
  padding-block: var(--em-sp-11) var(--em-sp-10);
  overflow: hidden;
}

.pz-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--em-sp-9);
  align-items: center;
}

.pz-hero-text h1 { max-width: 16ch; }

.pz-hero-text h1 em {
  font-style: normal;
  color: var(--em-teal);
}

.pz-hero-img {
  border-radius: var(--em-r-xl);
  overflow: hidden;
  box-shadow: var(--em-shadow-lg);
}

.pz-hero-img img { width: 100%; height: auto; transform: scale(1.08); transform-origin: center center; }

.pz-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--em-sp-2);
  margin-top: var(--em-sp-6);
}

.pz-hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--em-accent);
  border: 0;
  border-radius: var(--em-r-pill);
  font-family: var(--em-font-head);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  transition: background var(--em-dur-base) var(--em-ease);
}

.pz-hero-pill:hover {
  background: var(--em-teal-700);
  color: #fff;
}

/* Mobil: zmenši pills, aby sa všetky tri zmestili do jedného riadku */
@media (max-width: 559px) {
  .pz-hero-pills {
    flex-wrap: nowrap;
    gap: var(--em-sp-2);
  }
  .pz-hero-pill {
    padding: 8px 12px;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
}

@media (min-width: 860px) {
  .pz-hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--em-sp-11);
  }
}

/* ============ PRODUKTOVÉ SEKCIE ============ */
.pz-section { padding-block: var(--em-sp-10); }
.pz-section--alt { background: var(--em-surface-alt); }
.pz-section--muted { background: var(--em-n-25); }

/* ============ LAYOUT (2-stĺpcový) ============ */
.pz-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--em-sp-9);
  align-items: center;
}

/* Mobil: vždy najprv text (nadpis + popis), až potom obrázok –
   aby sa obrázky nelepili hneď za seba a každý blok mal kontext */
.pz-product > .pz-visual { order: 2; }
.pz-product > .pz-body   { order: 1; }

@media (min-width: 860px) {
  .pz-product {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    row-gap: 48px;
    column-gap: 80px;
  }

  /* Desktop: obnov pôvodné rozloženie vľavo/vpravo */
  .pz-product > .pz-visual { order: 1; }
  .pz-product > .pz-body   { order: 2; }
  .pz-product--reverse > .pz-visual { order: 2; }
  .pz-product--reverse > .pz-body  { order: 1; }

  /* Limit frame height on desktop so the full section fits in one viewport.
     Iba produktové rámy — showcase (landscape) si drží pomer strán obrázka. */
  .pz-product .pz-frame {
    aspect-ratio: unset;
    height: min(52vh, 460px);
  }
}

/* ============ VIZUÁLNA STRANA: obraz + palca ============ */
.pz-frame {
  position: relative;
  border-radius: var(--em-r-lg);
  overflow: hidden;
  background: var(--em-n-50);
  box-shadow: var(--em-shadow-md);
  aspect-ratio: 3 / 4;
}

/* Výraznejší rám pre Označník (svetlý teal nádych) */
.pz-frame--oznacnik {
  box-shadow: var(--em-shadow-md), 0 0 0 1px rgba(0,102,102,0.08);
}

.pz-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity var(--em-dur-slow) var(--em-ease),
              transform var(--em-dur-slow) var(--em-ease);
  pointer-events: none;
}

.pz-img.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Showcase (landscape) rám: vždy zobraz CELÝ obrázok — žiadne orezanie,
   žiadne biele okraje. Pomer strán rámu nastavuje JS podľa aktívneho obrázka
   (--pz-ar); default ~2.53 zodpovedá renderom aj bez JS. object-fit: contain
   je poistka, aby sa obrázok nikdy neorezal. */
.ip-showcase .pz-frame--landscape {
  aspect-ratio: var(--pz-ar, 2.53);
  height: auto;            /* preváži desktopovú fixnú výšku */
  max-width: 760px;
  background: var(--em-n-25);
}

.ip-showcase .pz-frame--landscape .pz-img {
  object-fit: contain;
}

/* ============ TEXTOVÁ STRANA ============ */
.pz-body { position: relative; }

/* Veľké dekoratívne číslo */
.pz-num {
  font-family: var(--em-font-head);
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--em-teal-100);
  margin-bottom: var(--em-sp-1);
  pointer-events: none;
  user-select: none;
}

.pz-body > h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: var(--em-sp-7);
  letter-spacing: -0.02em;
}

/* Tlačidlá pod textom — na úzkych displejoch sa zalomia pod seba (celá šírka),
   aby dlhší text ako „Dohodnúť konzultáciu" nepretŕčal z tlačidla. */
.pz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--em-sp-3);
  margin-top: var(--em-sp-7);
  padding-top: var(--em-sp-6);
  border-top: 1px solid var(--em-border);
}

.pz-actions .btn {
  /* basis = šírka najdlhšieho textu, aby sa tlačidlo NIKDY nezmrštilo pod text.
     Keď sa dve tlačidlá nezmestia vedľa seba, zalomia sa na celú šírku riadku. */
  flex: 1 1 auto;
  padding-inline: var(--em-sp-4);
  font-size: 0.78rem;
}

/* ============ ZOBRAZOVANÉ INFORMÁCIE ============ */
.pz-info-section {
  margin-top: var(--em-sp-11);
  padding-top: var(--em-sp-9);
  border-top: 1px solid var(--em-border);
}

.pz-info-heading {
  font-family: var(--em-font-head);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--em-teal);
  margin-bottom: var(--em-sp-7);
}

.pz-info-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-start;
}

.pz-info-section--right .pz-info-grid {
  justify-content: flex-end;
}

.pz-info-section--right .pz-info-heading {
  text-align: right;
}

.pz-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 0;
  min-width: 0;
  max-width: 110px;
}

.pz-info-img {
  border-radius: var(--em-r-lg);
  overflow: hidden;
  box-shadow: var(--em-shadow-md);
  margin: 0 0 12px;
  width: 100%;
  aspect-ratio: 110 / 190;
}

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

@media (min-width: 560px) {
  .pz-info-grid {
    gap: 20px;
  }
  .pz-info-img {
    margin-bottom: 14px;
  }
}

/* Mobil: vyvážené rozloženie okienok podľa počtu –
   3/4 ks zostanú v 1 riadku, viac (napr. 7) sa rozdelí na vyvážené riadky
   bez osamoteného okienka (7 → 4 + 3). */
@media (max-width: 559px) {
  .pz-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
  }
  /* presne 4 ks → jeden riadok */
  .pz-info-grid:has(.pz-info-item:nth-child(4)):not(:has(.pz-info-item:nth-child(5))) {
    grid-template-columns: repeat(4, 1fr);
  }
  /* 7+ ks → 4 v riadku (7 → 4 + 3) */
  .pz-info-grid:has(.pz-info-item:nth-child(7)) {
    grid-template-columns: repeat(4, 1fr);
  }
  .pz-info-item {
    width: 100%;
  }
}

.pz-info-title {
  font-family: var(--em-font-head);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--em-text-primary);
  margin-bottom: 0;
  line-height: 1.3;
}

/* Mobil: úzke stĺpce → menší popisok, aby sa nezalamoval na priveľa riadkov */
@media (max-width: 559px) {
  .pz-info-title {
    font-size: 0.7rem;
    line-height: 1.2;
  }
}

.pz-info-desc {
  font-size: 0.88rem;
  color: var(--em-text-secondary);
  line-height: 1.65;
}

/* ============ TEAL AKCENTOVÁ LINKA ============ */
.pz-section--accent-left .container {
  border-left: 3px solid var(--em-teal);
  padding-left: calc(var(--em-container-pad) + 20px);
}

@media (min-width: 860px) {
  .pz-section--accent-left .container {
    padding-left: calc(var(--em-container-pad) + 28px);
  }
}

.pz-section--accent-right .container {
  border-right: 3px solid var(--em-teal);
  padding-right: calc(var(--em-container-pad) + 20px);
}

@media (min-width: 860px) {
  .pz-section--accent-right .container {
    padding-right: calc(var(--em-container-pad) + 28px);
  }
}

/* Mobil: keď sú text a obrázky pod sebou (nie vedľa seba), nestriedame
   ľavé/pravé zarovnanie — všetko zarovnáme vľavo, vrátane nadpisu
   „Zobrazované informácie", obrázkov aj akcentovej linky. */
@media (max-width: 859px) {
  .pz-info-section--right .pz-info-heading { text-align: left; }
  .pz-info-section--right .pz-info-grid { justify-content: flex-start; }

  .pz-section--accent-right .container {
    border-right: 0;
    padding-right: var(--em-container-pad);
    border-left: 3px solid var(--em-teal);
    padding-left: calc(var(--em-container-pad) + 20px);
  }
}

/* ============ IP — HERO TICKER ============ */
h1:has(.ip-ticker) {
  max-width: none;
  font-size: clamp(1.6rem, 2.5vw, 2.5rem);
  line-height: 1.1;
}
.ip-static {
  font-size: 1.45em;
  display: block;
}
.pz-hero-text:has(.ip-ticker) {
  min-width: 0;
}
.ip-ticker-wrap {
  display: block;
  overflow: hidden;
  height: 1.15em;
}
.ip-ticker {
  display: inline-block;
  font-style: normal;
  color: var(--em-teal);
  white-space: nowrap;
  will-change: transform, opacity;
}
.ip-tick-out {
  animation: ip-tick-out 0.48s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
.ip-tick-in {
  animation: ip-tick-in 0.48s cubic-bezier(0.2, 0, 0, 1) forwards;
}
@keyframes ip-tick-out {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(-110%); opacity: 0; }
}
@keyframes ip-tick-in {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ============ IP — LANDSCAPE SHOWCASE ============ */
.ip-showcase {
  padding-block: var(--em-sp-10);
  background:
    radial-gradient(circle at 20% 10%, rgba(0,102,102,0.18), transparent 32%),
    linear-gradient(135deg, #FFFFFF 0%, #F4F6F6 48%, #EAF7F7 100%);
}
.ip-showcase-wrap {
  max-width: 1060px;
  margin: 0 auto;
}

/* ============ IP — INTRO TEXT ============ */
.ip-intro {
  position: relative;
  overflow: hidden;          /* výrez, v ktorom sa pozadie posúva */
  padding-block: var(--em-sp-13);
  text-align: center;
  background: #075a5a;        /* fallback, kým sa načíta obrázok */
}
/* Vrstva pozadia je vyššia ako sekcia (headroom) a posúva sa cez JS transform.
   Transform funguje aj na iOS (na rozdiel od `background-attachment: fixed`,
   ktorý je na iOS Safari chybný) → „obrázok vo výreze pri scrollovaní" beží
   spoľahlivo aj na mobile. */
.ip-intro-bg {
  position: absolute;
  left: 0;
  right: 0;
  top: -14%;
  height: 128%;              /* headroom > posun → nikdy sa neodhalí medzera */
  background:
    linear-gradient(rgba(5,90,90,0.68), rgba(5,90,90,0.68)),
    url("assets/images/foto-zilina-namestie-infopoint.png") center/cover no-repeat;
  will-change: transform;
  z-index: 0;
}
.ip-intro-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.ip-intro-kicker {
  font-family: var(--em-font-head);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--em-sp-5);
  display: block;
}
.ip-intro-text {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  color: rgba(255,255,255,0.92);
  line-height: 1.75;
  margin: 0;
}

/* ============ IP — PRODUCTS SIDE-BY-SIDE ============ */
.ip-products { padding-block: var(--em-sp-10); background: var(--em-n-25); }
.ip-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--em-sp-7);
}
@media (min-width: 760px) {
  .ip-products-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--em-sp-8);
    align-items: start;
  }
}
.ip-product-card {
  background: var(--em-surface);
  border-radius: var(--em-r-lg);
  box-shadow: var(--em-shadow-sm);
  border: 1px solid var(--em-border);
  overflow: hidden;
  padding: var(--em-sp-7);
}
.ip-product-img {
  margin: 0 0 var(--em-sp-5);
  border-radius: var(--em-r-md);
  overflow: hidden;
  background: var(--em-n-50);
  text-align: center;
}
.ip-product-img img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
  padding: var(--em-sp-4);
}
.ip-product-card .pz-num { margin-bottom: 0; }
.ip-product-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: var(--em-sp-5);
  letter-spacing: -0.02em;
}

/* ============ IP — ADVANTAGES ============ */
.ip-advantages { padding-block: var(--em-sp-10); background: var(--em-grad-dark); }
.ip-section-head { text-align: center; margin-bottom: var(--em-sp-8); }
.ip-section-head h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -0.02em; }
.ip-section-head p { color: var(--em-text-secondary); margin-top: var(--em-sp-3); }
.ip-advantages .ip-section-head h2 { color: #fff; }
.ip-advantages .ip-section-head p { color: rgba(255,255,255,0.6); }

.ip-adv-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--em-sp-4);
}
@media (min-width: 860px) {
  .ip-adv-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ip-adv-card {
  background: var(--em-teal-700);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--em-r-lg);
  padding: 28px 24px;
  box-shadow: none;
  transition: transform var(--em-dur-base) var(--em-ease),
              box-shadow var(--em-dur-base) var(--em-ease),
              border-color var(--em-dur-base) var(--em-ease);
}
.ip-adv-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  border-color: var(--em-teal-400);
}
.ip-adv-card .info-ico {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: var(--em-teal-300);
}
.ip-adv-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--em-sp-2);
  color: #fff;
}
.ip-adv-card p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.58);
  line-height: 1.6;
  margin: 0;
}

/* ============ IP — WHAT CAN BE DISPLAYED ============ */
.ip-display { padding-block: var(--em-sp-10); }

/* Na mobile (iba táto sekcia) — obrázky po 2 vedľa seba, aby boli väčšie
   a popisky sa neprekrývali. Selektor so :has prebíja všeobecné pravidlá
   pre 4/7 položiek vyššie (rovnaká alebo vyššia špecificita + neskoršie poradie). */
@media (max-width: 559px) {
  .ip-display .pz-info-grid,
  .ip-display .pz-info-grid:has(.pz-info-item:nth-child(4)),
  .ip-display .pz-info-grid:has(.pz-info-item:nth-child(7)) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
    justify-items: center;
    gap: 22px 18px;
  }
  .ip-display .pz-info-item {
    width: 100%;
    max-width: 116px;   /* menšie obrázky → menej viditeľné rozmazanie */
  }
  /* Posledná osamotená položka (nepárny počet) → cez obe kolóny, na stred */
  .ip-display .pz-info-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* ============ THUMBNAILS + CONTENT SLIDES ============ */
.pz-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--em-sp-4);
  justify-content: center;
}

.pz-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--em-surface);
  border: 1.5px solid var(--em-border);
  border-radius: var(--em-r-sm);
  padding: 6px 8px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  font-family: var(--em-font-head);
}

.pz-thumb:hover { border-color: var(--em-teal-300); }

.pz-thumb.is-active {
  border-color: var(--em-teal);
  background: var(--em-teal-50);
}

.pz-thumb-img {
  width: 52px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--em-n-100);
}

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

.pz-thumb-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--em-text-secondary);
  white-space: nowrap;
}

.pz-thumb.is-active .pz-thumb-label { color: var(--em-teal); }

/* Mobile: keep all 5 thumbnails on a single row */
@media (max-width: 559px) {
  .pz-thumbs {
    flex-wrap: nowrap;
    gap: 5px;
  }
  .pz-thumb {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 4px;
    gap: 4px;
  }
  .pz-thumb-img {
    width: 100%;
    height: auto;
    aspect-ratio: 52 / 36;
  }
  .pz-thumb-label {
    font-size: 0.6rem;
    white-space: normal;
    text-align: center;
    line-height: 1.1;
  }
}

/* Content slides: only active is shown */
.pz-content-slide { display: none; }
.pz-content-slide.is-active { display: block; }

.pz-content-tag {
  display: inline-block;
  font-family: var(--em-font-head);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--em-teal);
  margin-bottom: var(--em-sp-2);
}

.pz-content-title {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 800;
  margin-bottom: var(--em-sp-4);
  color: var(--em-text-primary);
  letter-spacing: -0.02em;
}

.pz-content-desc {
  font-size: 1rem;
  color: var(--em-text-secondary);
  line-height: 1.7;
}

/* ============ STACKED LAYOUT VARIANT (infopointy) ============ */
.pz-product--stacked {
  justify-items: center;
}

.pz-product--stacked .pz-visual {
  width: 100%;
  max-width: 420px;
}

.pz-product--stacked .pz-visual--wide {
  max-width: 760px;
}

.pz-product--stacked .pz-body {
  width: 100%;
  max-width: 760px;
}

@media (min-width: 860px) {
  .pz-product--stacked {
    grid-template-columns: 1fr;
    row-gap: var(--em-sp-8);
  }
  .pz-product--stacked .pz-frame {
    height: auto;
    aspect-ratio: 3 / 4;
  }
  .pz-product--stacked .pz-frame--landscape {
    aspect-ratio: 16 / 9;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .pz-img {
    transition: opacity 0.01s !important;
    transform: none !important;
  }
}
