/* Sjednocené ikonové tlačítko v hlavním headeru */
#fmb-header .fmb-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
#fmb-header .fmb-icon-btn:hover,
#fmb-header .fmb-icon-btn:focus-visible {
  color: #23b1bf;
  border-color: #23b1bf;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(35, 177, 191, 0.18);
  outline: none;
}
#fmb-header .fmb-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  pointer-events: none;
}
#fmb-header .fmb-icon-btn svg.fmb-icon-fill {
  fill: currentColor;
  stroke: none;
}
#fmb-header .fmb-hdr-cart .fmb-cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #26c6da, #bd32d2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
#fmb-header .fmb-hdr-cart .fmb-cart-badge:empty {
  display: none;
}
/* Legacy cart button (before header template sync) */
#fmb-header .fmb-hdr-cart.fmb-ib {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #475569;
  text-decoration: none;
  padding: 0;
}
#fmb-header .fmb-hdr-cart.fmb-ib svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
#fmb-header [data-hdr-cart-dot] {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #26c6da, #bd32d2);
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
#fmb-header [data-hdr-cart-dot][hidden] {
  display: none;
}

#fmb-header .fmb-hdr-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Menu dropdown */
#fmb-hdr-menu-panel {
  position: fixed;
  top: calc(clamp(12px, 2vh, 20px) + 64px);
  right: clamp(12px, 2vw, 24px);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 10px;
  z-index: 2147482000;
  animation: fmbHdrFade 0.18s ease-out;
  font-family: 'Montserrat', 'Myriad Pro', sans-serif;
}
#fmb-hdr-menu-panel[hidden] {
  display: none !important;
}
@keyframes fmbHdrFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
#fmb-hdr-menu-panel nav {
  display: flex;
  flex-direction: column;
  min-width: 240px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  gap: 2px;
}
#fmb-hdr-menu-section {
  display: block;
  padding: 10px 12px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
#fmb-hdr-menu-panel a {
  padding: 9px 12px;
  color: #1e293b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
#fmb-hdr-menu-panel a:hover,
#fmb-hdr-menu-panel a:focus-visible,
#fmb-hdr-menu-panel a.is-active {
  background: linear-gradient(135deg, rgba(38, 198, 218, 0.1), rgba(189, 50, 210, 0.1));
  color: #23b1bf;
  outline: none;
}
#fmb-hdr-menu-panel a.is-active {
  font-weight: 700;
  color: #0f766e;
}
.fmb-hdr-menu-ostatni-toggle {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fmb-hdr-menu-ostatni-toggle::after {
  content: '›';
  color: #94a3b8;
  transition: transform 0.15s ease;
}
.fmb-hdr-menu-ostatni-toggle[aria-expanded='true']::after {
  transform: rotate(90deg);
}
.fmb-hdr-menu-ostatni-sub[hidden] {
  display: none;
}
.fmb-hdr-menu-ostatni-sub a {
  font-size: 13px;
  padding-left: 20px !important;
}

/* Mockup search v dropdownu headeru */
#fmb-header .fmb-hdr-search-dropdown .fmb-search-results {
  margin-top: 8px;
  max-height: min(50vh, 400px);
  overflow-y: auto;
}
#fmb-header .fmb-hdr-sr-hint {
  padding: 12px 10px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}
#fmb-header .fmb-hdr-sr-section[hidden] {
  display: none;
}
#fmb-header .fmb-hdr-sr-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
  border-top: 1px solid #f1f5f9;
}
#fmb-header .fmb-hdr-sr-section:first-of-type header {
  border-top: none;
}
#fmb-header .fmb-hdr-sr-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
}
#fmb-header .fmb-hdr-sr-pill-mock {
  background: linear-gradient(135deg, #26c6da, #1a9aaf);
}
#fmb-header .fmb-hdr-sr-pill-shop {
  background: linear-gradient(135deg, #bd32d2, #7a18a8);
}
#fmb-header .fmb-hdr-sr-meta {
  font-size: 11px;
  color: #94a3b8;
}
#fmb-header .fmb-hdr-sr-section ul {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}
#fmb-header .fmb-hdr-sr-section li > a,
#fmb-header .fmb-hdr-sr-section li > button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  text-decoration: none;
}
#fmb-header .fmb-hdr-sr-section li > a:hover,
#fmb-header .fmb-hdr-sr-section li > button:hover {
  background: rgba(38, 198, 218, 0.08);
  color: #23b1bf;
}
#fmb-header .fmb-hdr-sr-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #f1f5f9 center/contain no-repeat;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}
#fmb-header .fmb-hdr-sr-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #94a3b8;
}
#fmb-header .fmb-hdr-sr-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fmb-header .fmb-hdr-sr-empty {
  padding: 8px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  font-style: italic;
}

@media (max-width: 900px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  #fmb-header {
    --fmb-pad-x: 14px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #fmb-header .fmb-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px var(--fmb-pad-x);
    box-sizing: border-box;
    grid-template-columns: unset;
  }

  #fmb-header .fmb-nav {
    display: none !important;
  }

  #fmb-header #fmb-dynamic-logo {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 132px);
  }

  #fmb-header #fmb-dynamic-logo img,
  #fmb-header #dynamic-logo img.dyn-logo {
    height: clamp(35px, 10.4vw, 46px);
    width: auto;
    max-width: min(46vw, 192px);
    object-fit: contain;
  }

  #fmb-header .fmb-hdr-menu-toggle svg line {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  #fmb-header .fmb-hdr-menu-toggle[aria-expanded='true'] svg line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  #fmb-header .fmb-hdr-menu-toggle[aria-expanded='true'] svg line:nth-child(2) {
    opacity: 0;
  }
  #fmb-header .fmb-hdr-menu-toggle[aria-expanded='true'] svg line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  #fmb-header .fmb-acc-cta--ghost,
  #fmb-header .fmb-acc {
    display: none !important;
  }

  #fmb-header .fmb-right {
    flex: 0 0 auto;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
    margin-left: auto;
  }

  #fmb-header .fmb-hdr-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  #fmb-header .fmb-icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  #fmb-header .fmb-hdr-search-slot {
    flex: 0 0 auto;
    max-width: none;
  }

  #fmb-hdr-menu-panel {
    inset: 0;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    border-radius: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 64px) 16px calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 2147483005;
    animation: none;
  }

  #fmb-hdr-menu-panel nav {
    max-height: none;
    min-width: 0;
  }

  #fmb-hdr-menu-panel a,
  #fmb-hdr-menu-panel .fmb-hdr-menu-ostatni-toggle {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 15px;
  }

  html.fmb-mobile-nav-open,
  body.fmb-mobile-nav-open {
    overflow: hidden;
  }

  /* Bricks mobilní header (skrytý #fmb-header na mobile_portrait) */
  #brx-header .brxe-nav-nested {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    gap: 0;
    padding: 12px 14px;
    box-sizing: border-box;
  }

  #brx-header #dynamic-logo,
  #brx-header #fmb-dynamic-logo,
  #brx-header .brxe-nav-nested > .brxe-code {
    flex: 0 1 auto;
    min-width: min(112px, 45vw);
    max-width: min(50vw, 208px) !important;
    margin-right: 0 !important;
    width: auto !important;
  }

  #brx-header #dynamic-logo img.dyn-logo,
  #brx-header #fmb-dynamic-logo img {
    height: clamp(38px, 11.2vw, 51px) !important;
    min-height: 38px;
    width: auto !important;
    max-width: 100%;
    object-fit: contain;
  }

  #brx-header .fmb-hdr-m-cart {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  #brx-header .brxe-nav-nested > .brxe-block:has(.fmb-hdr-m-cart) {
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 0 !important;
  }

  #brx-header .brxe-nav-nested > .brxe-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    --brxe-toggle-scale: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: #475569;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 6px;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }

  #brx-header .brxe-nav-nested > .brxe-toggle:hover,
  #brx-header .brxe-nav-nested > .brxe-toggle:focus-visible {
    color: #23b1bf;
    border-color: #23b1bf;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(35, 177, 191, 0.18);
    outline: none;
  }

  #brx-header .brxe-nav-nested > .brxe-toggle .brxa-wrap {
    width: 22px;
    height: 16px;
    transform: scale(1) !important;
  }

  #brx-header .brxe-nav-nested > .brxe-toggle .brxa-inner,
  #brx-header .brxe-nav-nested > .brxe-toggle .brxa-inner::before,
  #brx-header .brxe-nav-nested > .brxe-toggle .brxa-inner::after {
    width: 22px;
    height: 2.5px;
    border-radius: 2px;
  }

  #brx-header .brxe-nav-nested > .brxe-toggle .brxa-inner::before {
    top: -7px;
  }

  #brx-header .brxe-nav-nested > .brxe-toggle .brxa-inner::after {
    bottom: -7px;
  }

  #brx-header .brxe-nav-nested.brx-open > .brxe-toggle .brxa-inner {
    background-color: transparent;
  }

  #brx-header .brxe-nav-nested.brx-open > .brxe-toggle .brxa-inner::before {
    top: 0;
    transform: rotate(45deg);
  }

  #brx-header .brxe-nav-nested.brx-open > .brxe-toggle .brxa-inner::after {
    bottom: 0;
    transform: rotate(-45deg);
  }

  #brx-header .brxe-nav-nested.brx-open .brx-nav-nested-items > .brxe-toggle,
  #brx-header .brxe-nav-nested.brx-open .brx-nav-nested-items > .brx-toggle-div,
  #brx-header .brxe-nav-nested.brx-open .brx-nav-nested-items > li.brx-toggle-div,
  #brx-header .brxe-nav-nested.brx-open .brx-nav-nested-items .brxe-toggle.brx-toggle-div,
  #brx-header .brxe-nav-nested.brx-open .brx-nav-nested-items li.menu-item.brx-toggle-div {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
  }

  #brx-header .brxe-nav-nested.brx-open .brx-nav-nested-items {
    padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
  }
}

/* Legacy header: skrýt staré nesjednocené ikony po injekci pluginu */
#fmb-header.fmb-hdr-enhanced .fmb-right > .fmb-acc,
#fmb-header.fmb-hdr-enhanced .fmb-right > a.fmb-ib,
#fmb-header.fmb-hdr-enhanced .fmb-right > a.fmb-acc-icon:not(.fmb-icon-btn),
#fmb-header.fmb-hdr-enhanced .fmb-right > a.fmb-hdr-cart:not(.fmb-icon-btn) {
  display: none !important;
}

#fmb-header .fmb-hdr-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 92vw);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 12px;
  z-index: 2147481500;
}
#fmb-header .fmb-hdr-search-dropdown[hidden] {
  display: none !important;
}
#fmb-header .fmb-hdr-search-slot {
  position: relative;
}
#fmb-header .fmb-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
