/* =========================================================
   HEADER2 – MOBILE PATCH (same as the “fasza” header)
   Tedd a CSS LEGALJÁRA
   ========================================================= */
@media (max-width: 960px){

  /* 0) Kifolyás stop */
  html, body{ overflow-x: clip !important; }
  *, *::before, *::after{ box-sizing: border-box !important; }

  /* 1) Header padding mobilon */
  body .bd-site-header{ padding: 16px 10px 4px !important; }

  /* 2) Header kártya mobilon (ne vágjon, ne legyen max-height) */
  body .bd-site-header .bd-header-inner{
    width: calc(100vw - 20px) !important;
    max-width: 100vw !important;
    margin: 0 auto !important;

    border-radius: 32px !important;
    padding: 14px 14px 18px !important;
    gap: 18px !important;

    min-height: unset !important;
    height: auto !important;
    max-height: none !important;

    background-image: var(--hero-img) !important;
    background-size: cover !important;
    background-position: 55% 25% !important;
    background-repeat: no-repeat !important;

    overflow: visible !important; /* <<< EZ A LÉNYEG: dropdownok ne legyenek levágva */
    position: relative !important;
  }

  /* 3) Overlay sose takarjon */
  body .bd-site-header .bd-header-inner::before{
    z-index: 0 !important;
    pointer-events: none !important;
    background: linear-gradient(
      to bottom,
      rgba(242,239,234,0.92) 0%,
      rgba(242,239,234,0.72) 28%,
      rgba(242,239,234,0.18) 100%
    ) !important;
  }
  body .bd-site-header .bd-header-inner > *{
    position: relative !important;
    z-index: 1 !important;
  }

  /* 4) Mobil top grid: logo + ikonok, 2. sor search */
  body .bd-site-header .bd-header-top{
    display: grid !important;
    grid-template-columns: 1fr auto auto auto !important;
    grid-template-areas:
      "logo menu cart account"
      "search search search search" !important;

    align-items: center !important;
    column-gap: 1px !important;
    row-gap: 12px !important;

    position: relative !important;
    z-index: 5000 !important;
    max-width: 100% !important;
  }

  body .bd-site-header .bd-header-left{
    grid-area: logo !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body .bd-site-header .bd-logo-img{
    height: 54px !important;
    width: auto !important;
    max-width: 100% !important;
    display: block !important;
  }

  /* mobilon a nav ne látszódjon */
  body .bd-site-header .bd-header-nav{ display: none !important; }

  /* a right wrapper “eltűnik”, a gyerekek grid itemek */
  body .bd-site-header .bd-header-right{ display: contents !important; }

  body .bd-site-header .bd-menu-toggle{
    grid-area: menu !important;
    justify-self: end !important;
    display: flex !important;
  }

  body .bd-site-header .pp-cart-wrap{
    grid-area: cart !important;
    justify-self: end !important;
    position: relative !important;
    z-index: 999998 !important;
  }

  body .bd-site-header .bd-account{
    grid-area: account !important;
    justify-self: end !important;
    position: relative !important;
    z-index: 999997 !important;
  }

  body .bd-site-header .bd-icon-btn{
    width: 42px !important;
    height: 42px !important;
  }

  /* 5) SEARCH: mobilon jelenjen meg full width */
  body .bd-site-header .bd-search{
    grid-area: search !important;
    display: block !important;
    position: relative !important;

    width: 100% !important;
    height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;

    min-width: 0 !important;
    max-width: 100% !important;

    z-index: 999996 !important; /* <<< SEARCH mindig a legfelül legyen */
  }

  body .bd-site-header .bd-search-fly{
    position: relative !important;
    right: auto !important;
    top: auto !important;

    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;

    padding: 10px 10px 10px 12px !important;

    border-radius: 999px !important;
    border: 2px solid #111827 !important;
    background: rgba(255,255,255,.32) !important;
    box-shadow: 0 8px 20px rgba(148,163,184,.25) !important;

    overflow: hidden !important;
  }

  body .bd-site-header .bd-search-fly input{
    font-size: 15px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  /* dropdown full width + legfelül */
  body .bd-site-header .bd-search-dropdown{
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 999999 !important;
  }
  body .bd-site-header .bd-search-dd-inner{
    grid-template-columns: 1fr !important;
  }

  /* 6) MINI CART / ACCOUNT dropdown legyen nagyon felül */
  body .pp-cart-wrap .pp-mini-cart{
    left: auto !important;
    right: 0 !important;

    width: 360px !important;
    max-width: calc(100vw - 28px) !important;
    min-width: 280px !important;

    z-index: 2147483647 !important; /* max */
    transform: translateX(0) !important;
  }

  body .bd-account .bd-account-dd{
    left: auto !important;
    right: 0 !important;

    width: 260px !important;
    max-width: calc(100vw - 28px) !important;

    z-index: 999999 !important;
    transform: translateX(0) !important;
  }

  /* badge ne legyen negatív */
  body .bd-site-header .pp-cart-badge{ right: 0 !important; }

  /* 7) HERO tipó (opcionális – ha túl nagy/ kicsi a kártya) */
  body .bd-site-header .bd-header-hero{
    position: relative !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
    align-items: flex-start !important;
    padding-top: 4px !important;
    max-width: 100% !important;
  }

  /* double-tap fix maradhat */
  body .pp-cart-wrap,
  body .bd-account,
  body .pp-cart-wrap * ,
  body .bd-account *{
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  body .pp-mini-cart::before,
  body .bd-account-dd::before{
    display: none !important;
  }
  @media (max-width: 960px) {
    body .pp-cart-confirm__box
 {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: 100vw !important;
    }
}
}

@media (max-width: 560px){
  body .bd-site-header .bd-hero-text h1{ font-size: 1.75rem !important; }
}
  /* a te működő finomhangolásod (mobilon) */
  body .pp-cart-wrap.is-open .pp-mini-cart{
    margin-right: -120px !important;
  }

  /* =========================
   HAMBURGER + MOBILE MENU
   ========================= */

/* hamburger alapból rejtve (desktop) */
.bd-menu-toggle{ display:none; }

/* mobile menu alapból rejtve */
.bd-mobile-menu{ display:none; }

/* MOBIL */
@media (max-width: 960px){

  /* nav rejtve mobilon */
  .bd-header-nav{ display:none; }

  /* hamburger látszik */
  .bd-menu-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  /* ====== ITT A LÉNYEG: SORREND FIX ======
     Search → Kosár → Account → Hamburger  */
  .bd-header-right{
    display:flex !important;
    align-items:center !important;
    gap:10px !important;
  }

  .bd-header-right .bd-search{
    order:0 !important;
    flex:1 1 auto !important;
    min-width:0 !important;
  }

  .bd-header-right .pp-cart-wrap{
    order:10 !important;
  }

  .bd-header-right .bd-account,
  .bd-header-right #bdAccountWrap{
    order:20 !important;
  }

  .bd-header-right .bd-menu-toggle{
    order:30 !important; /* mindig a legvégén */
  }

  /* ====== MOBILE MENU PANEL ====== */
  body.bd-menu-open .bd-mobile-menu{
    display:block;
    position:fixed;
    inset:0;
    z-index:99998;
    padding:86px 16px 16px; /* hely a close gombnak */
    background:rgba(255,255,255,.92);
    backdrop-filter:blur(10px);
    overflow:auto;
  }

  /* X gomb */
  .bd-mobile-close{
    position:fixed;
    top:14px;
    right:14px;
    width:44px;
    height:44px;
    border-radius:999px;
    border:2px solid #111827;
    background:rgba(255,255,255,.75);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    z-index:99999;
    box-shadow:0 14px 30px rgba(15,23,42,.14);
  }

  /* lista */
  .bd-mobile-menu-list{
    list-style:none;
    margin:0;
    padding:0;
    display:flex;
    flex-direction:column;
    gap:10px;
  }

  .bd-mobile-menu-list a{
    display:block;
    padding:14px 16px;
    border-radius:16px;
    text-decoration:none;
    color:#111827;
    font-weight:800;
    background:rgba(255,255,255,.65);
    border:1px solid rgba(17,24,39,.10);
    box-shadow:0 10px 22px rgba(15,23,42,.08);
  }

  /* ne görgessen a body ha nyitva */
  body.bd-menu-open{ overflow:hidden; }
}
/* amikor a mobil menü nyitva van: háttér ne görögessen */
body.bd-menu-open{
  overflow: hidden;
  height: 100%;
  touch-action: none;            /* iOS/Android: ne “pan”-eljen a háttér */
}

/* a menü maga legyen görgethető */
#bdMobileMenu{
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;  /* ne “rántsa” a hátteret */
  max-height: 100dvh;
}
