/* ================================================================
   ZAVAROVACISKLO.CZ – GLOBAL HEUREKA HEADER + SLIDE PANEL
   Samostatné řešení pro celý web, nezávislé na PDP preview.
   ================================================================ */

.zs-heureka-global-badge {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  padding: 4px 9px 4px 5px;
  border: 1px solid #eadb8d;
  border-radius: 12px;
  background: #fffdf4;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5c4b16;
  cursor: pointer;
}

.zs-heureka-global-badge:hover,
.zs-heureka-global-badge[aria-expanded="true"] {
  border-color: #d6b948;
  background: #fff9df;
}

.zs-heureka-global-badge img {
  display: block;
  width: 36px;
  height: 36px;
  max-width: none;
  object-fit: contain;
}

.zs-heureka-global-copy {
  display: block;
  text-align: left;
}

.zs-heureka-global-copy strong,
.zs-heureka-global-copy small {
  display: block;
  white-space: nowrap;
  line-height: 1.15;
}

.zs-heureka-global-copy strong {
  font-size: 15px;
  font-weight: 700;
}

.zs-heureka-global-copy small {
  margin-top: 2px;
  color: #8b7a42;
  font-size: 15px;
}

/* Původní levý Heureka widget už na webu nezobrazujeme. */
#heurekaTableft.zs-heureka-original-hidden,
#heurekaIfrBoxleft.zs-heureka-original-hidden {
  display: none !important;
}

/* Vyjížděcí panel s oficiálním Heureka iframe obsahem. */
.zs-heureka-global-panel {
  position: fixed;
  left: 0;
  top: 68px;
  width: 320px;
  height: 317px;
  z-index: 2147483647;
  overflow: hidden;
  border-radius: 0 12px 12px 0;
  background: #fff;
  box-shadow: 0 18px 48px rgba(25, 38, 49, .24);
  transform: translateX(-105%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform .22s ease,
    opacity .18s ease,
    visibility .18s ease;
}

.zs-heureka-global-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.zs-heureka-global-iframe {
  display: block;
  float: none;
  position: static;
  width: 320px;
  height: 317px;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
}

.zs-heureka-global-close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: #334754;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* Desktop: logo + Heureka vedle sebe, ale BEZ zásahu do původní šířky
 * levého sloupce headeru. Shoptet si tak zachová své rozložení:
 * logo/Heureka vlevo, hledání uprostřed, košík u pravého okraje. */
@media (min-width: 768px) {
  #header .site-name-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
  }

  #header .site-name-wrapper .site-name {
    flex: 0 0 auto !important;
    margin: 0 !important;
  }
}


/*
 * TABLET / MENŠÍ DESKTOP 768–1199 px:
 * plný Heureka badge s textem už koliduje se středovým vyhledáváním.
 * Proto se v tomto jediném rozsahu zobrazuje kompaktní badge pouze s logem.
 * Nad 1200 px zůstává plný desktop badge, pod 768 px zůstává mobilní verze.
 */
@media (min-width: 768px) and (max-width: 1199px) {
  #header .site-name-wrapper {
    gap: 6px !important;
  }

  .zs-heureka-global-badge {
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 2px !important;
    gap: 0 !important;
  }

  .zs-heureka-global-badge img {
    width: 40px !important;
    height: 40px !important;
    max-width: none !important;
  }

  .zs-heureka-global-copy {
    display: none !important;
  }
}

/*
 * Mobil: stejný řádek jako logo.
 * Samotné zlaté logo bez borderu / paddingu / backgroundu.
 */
@media (max-width: 767px) {
  .zs-heureka-global-mobile-site-name {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    width: auto !important;
    max-width: none !important;
  }

  .zs-heureka-global-mobile-site-name > a[data-testid="linkWebsiteLogo"],
  .zs-heureka-global-mobile-site-name > a:first-child {
    flex: 0 0 auto !important;
  }

  .zs-heureka-global-badge {
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .zs-heureka-global-badge:hover,
  .zs-heureka-global-badge[aria-expanded="true"] {
    border: 0 !important;
    background: transparent !important;
  }

  .zs-heureka-global-badge img {
    width: 44px !important;
    height: 44px !important;
    max-width: none !important;
  }

  .zs-heureka-global-copy {
    display: none !important;
  }

  .zs-heureka-global-panel {
    top: 60px;
    width: min(320px, calc(100vw - 12px));
  }

  .zs-heureka-global-iframe {
    width: 320px;
    max-width: 100%;
  }
}

/* Header layout support moved from product CSS: Heureka owns its own placement globally. */
@media (max-width: 767px) {
  #header .search,
  .header-top > .search {
    flex: 1 1 auto !important;
    min-width: 38px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #header .navigation-buttons,
  .navigation-buttons {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
  }
}

.zs-heureka-global-benefit-trigger {
  cursor: pointer;
}

.zs-heureka-global-benefit-trigger:hover {
  border-color: #e0c65a !important;
  box-shadow: 0 6px 18px rgba(89, 72, 17, .10) !important;
}


/* V1.3: ochrana proti starým Heureka badge z předchozích preview verzí. */
.zs-header-heureka,
.zsg-header-heureka {
  display: none !important;
}

/* Aktuální globální badge musí zůstat viditelný. */
.zs-heureka-global-badge {
  display: flex !important;
}

@media (max-width: 767px) {
  .zs-heureka-global-badge {
    display: flex !important;
  }
}
