/* BookStar desktop headers share the same spacing without changing mobile menu behavior. */
@media (min-width: 1024px) {
  .site-header > .shell.header-inner,
  #bookstar-site-header .bs-header-inner {
    box-sizing: border-box;
    width: 100%;
    max-width: 1440px;
    min-height: 80px;
    height: auto;
    gap: clamp(12px, 1.5vw, 24px);
    padding-inline: clamp(16px, 2.5vw, 36px);
  }

  .site-header > .header-inner > .brand,
  #bookstar-site-header .bs-brand,
  #bookstar-site-header .bs-account-actions {
    flex: 0 0 auto;
  }


  .site-header > .header-inner > .main-navigation,
  #bookstar-site-header .bs-main-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: center;
    gap: 4px clamp(9px, 1vw, 18px);
    padding-block: 6px;
  }

  .site-header > .header-inner > .main-navigation > a,
  .site-header > .header-inner > .main-navigation > .nav-dropdown,
  #bookstar-site-header .bs-main-nav > .bs-nav-link,
  #bookstar-site-header .bs-main-nav > .bs-nav-group {
    flex: 0 0 auto;
    margin-inline: 0;
  }

  .site-header > .header-inner > .main-navigation > a,
  .site-header > .header-inner > .main-navigation > .nav-dropdown > summary,
  #bookstar-site-header .bs-main-nav > .bs-nav-link,
  #bookstar-site-header .bs-main-nav > .bs-nav-group > .bs-nav-link {
    white-space: nowrap;
  }
}

@media (min-width: 1024px) {
  #root header[data-bookstar-header="true"] > div:has(> nav[class~="lg:flex"]) {
    height: auto;
    min-height: 5.5rem;
    gap: clamp(12px, 1.5vw, 24px);
    padding-inline: clamp(16px, 2.5vw, 36px);
  }

  #root header[data-bookstar-header="true"] nav[class~="lg:flex"] {
    flex: 1 1 auto;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 4px clamp(9px, 1vw, 18px);
    min-width: 0;
    padding-block: 6px;
  }

  #root header[data-bookstar-header="true"] nav[class~="lg:flex"] > * {
    flex: 0 0 auto;
  }

  body > header.bar > nav[aria-label="BookStar"] {
    flex: 1 1 auto;
    justify-content: space-evenly;
  }
}


/* BookStar — reproduz o botão flutuante usado no site brasileiro. */
a.bookstar-floating-whatsapp {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #1f7a4d;
  color: #fff;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 10%), 0 8px 10px -6px rgb(0 0 0 / 10%);
  text-decoration: none;
  transition: transform 150ms ease;
}

a.bookstar-floating-whatsapp:hover {
  transform: scale(1.05);
}

a.bookstar-floating-whatsapp:focus-visible {
  outline: 2px solid #1f7a4d;
  outline-offset: 2px;
}

.bookstar-floating-whatsapp > img {
  display: block;
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
}

.bookstar-floating-whatsapp__caption {
  position: absolute;
  right: calc(100% + 12px);
  padding: 10px 14px;
  border: 1px solid #d7e7dc;
  border-radius: 999px;
  background: #fff;
  color: #126b36;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 639px) {
  a.bookstar-floating-whatsapp {
    width: 64px;
    height: 64px;
  }

  .bookstar-floating-whatsapp > img {
    width: 32px;
    height: 32px;
  }

  .bookstar-floating-whatsapp__caption {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.bookstar-floating-whatsapp {
    transition: none;
  }
}
