/* Sticky header, mobile menu and floating WhatsApp button */
body>header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111113e6;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s
}

body>header.stuck,
body>header.menu-open {
  box-shadow: 0 10px 24px #0007
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1500px;
  margin: auto;
  padding: 12px var(--gutter)
}

/* Logo: wordmark first, mark second (direction is ltr inside .logo) */
.logo-img {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none
}

.logo-img img {
  display: block;
  height: 52px;
  width: auto
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 1rem
}

.header-nav a {
  color: #f7f4f5cc;
  font-weight: 600;
  transition: color .2s
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  background: var(--pink);
  color: var(--on-pink);
  font-weight: 800;
  transition: background .2s
}

.header-cta {
  min-width: 150px;
  min-height: 44px;
  padding: 0 24px;
  font-size: 15px
}


.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  /* Square, like the "יצירת קשר" button (brand corners) */
  border-radius: var(--radius);
  background: var(--pink);
  color: var(--on-pink);
  font-size: 18px;
  transition: background .2s
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-size: 26px;
  cursor: pointer
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-open {
  display: none
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block
}

.mobile-menu,
.menu-backdrop {
  display: none
}

/* While the mobile menu is open the page behind it does not scroll.
   Only <html> is locked: locking <body> too would make it a scroll container and the sticky
   header would jump to the top of the document (the menu then opened off-screen mid-page).
   iOS touch scrolling is additionally blocked in js/header.js. */
html.menu-locked {
  overflow: hidden;
  overscroll-behavior: none
}

.whatsapp-float {
  position: fixed;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 90;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  border: 1.5px solid var(--pink);
  border-radius: 50%;
  box-shadow: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
  font-size: 26px;
  transition: transform .15s ease, opacity .25s ease, visibility .25s
}

/* Hidden at the very bottom of the page (js/contact.js): the footer has its own WhatsApp icon there,
   and the centred authorship bar stays uncovered */
.whatsapp-float.is-away {
  opacity: 0;
  visibility: hidden;
  pointer-events: none
}

.whatsapp-float:focus-visible {
  transform: scale(1.05)
}

@media (hover: hover) and (pointer: fine) {

  .header-cta:hover,
  .header-icon:hover {
    background: var(--pink-hover)
  }

  .whatsapp-float:hover {
    transform: scale(1.05)
  }
}

.whatsapp-float:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px
}

@media(max-width:800px) {

  /* A live backdrop blur repaints on every scroll frame on phones; a solid bar is smooth */
  body>header {
    background: #111113f7;
    -webkit-backdrop-filter: none;
    backdrop-filter: none
  }

  .header-bar {
    padding: 10px 16px
  }

  /* Phones: the bar shows the "יצירת קשר" button; the social icons move into the burger menu */
  .header-nav,
  .header-icon {
    display: none
  }

  .header-cta {
    min-width: 0;
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px
  }

  /* Burger in a pink square next to the button */
  .menu-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--pink);
    color: var(--on-pink);
    font-size: 22px
  }

  .logo-img {
    gap: 8px
  }

  .logo-img img {
    height: 44px
  }

  .mobile-menu {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height .3s, opacity .3s
  }

  body>header.menu-open .mobile-menu {
    max-height: calc(100vh - 64px);
    max-height: calc(var(--app-height, 100svh) - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 1;
    pointer-events: auto
  }

  .menu-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 95;
    background: #0009;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px)
  }

  .mobile-menu nav {
    padding: 4px 24px 24px
  }

  .mobile-menu nav a {
    display: block;
    padding: 14px 0;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid var(--line)
  }

  /* Social icons in the open menu: black squares with a pink border and pink icon */
  .menu-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 24px 24px
  }

  .menu-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--pink);
    border-radius: var(--radius);
    background: #000;
    color: var(--pink);
    font-size: 20px
  }

  .menu-social-link[hidden] {
    display: none
  }

  .whatsapp-float {
    width: 56px;
    height: 56px;
    font-size: 23px
  }
}

/* Very narrow phones (≈320px): tighten the bar so everything fits on one line */
@media(max-width:380px) {
  .header-bar {
    gap: 8px;
    padding-inline: 12px
  }

  .header-actions {
    gap: 4px
  }

  .header-cta {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px
  }

  .menu-toggle {
    width: 36px;
    height: 36px;
    font-size: 20px
  }

  .header-bar .logo {
    font-size: 1.15rem
  }

  .logo-img img {
    height: 38px
  }
}
