/* =======================================================
   ALETTA NUTRITION - CUSTOM HEADER
======================================================= */

/* Hide the Astra header only when the custom PHP header
   has successfully added its body class. */

body.aletta-custom-header-active #masthead,
body.aletta-custom-header-active header.site-header,
body.aletta-custom-header-active .site-header:not(.aletta-custom-header) {
  display: none !important;
}

/* Main header */

.aletta-custom-header {
  position: sticky !important;
  z-index: 9998;
  top: 0;
  width: 100%;
  padding: 0 !important;
  border-bottom: 1px solid rgba(23, 55, 47, 0.07) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 8px 32px rgba(23, 55, 47, 0.045) !important;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

body.admin-bar .aletta-custom-header {
  top: 32px;
}

.aletta-custom-header.is-scrolled {
  background: rgba(255, 255, 255, 0.975) !important;
  box-shadow: 0 14px 42px rgba(23, 55, 47, 0.09) !important;
}

.aletta-custom-header__inner {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 38px;
  width: 100%;
  max-width: 1420px;
  min-height: 88px;
  margin: 0 auto;
  padding: 12px 70px;
  transition:
    min-height 0.3s ease,
    padding 0.3s ease;
}

.aletta-custom-header.is-scrolled
  .aletta-custom-header__inner {
  min-height: 76px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Logo */

.aletta-custom-header__brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.aletta-custom-header__brand .custom-logo-link {
  display: inline-flex !important;
  align-items: center;
  padding: 0 !important;
  background: transparent !important;
  text-decoration: none !important;
}

.aletta-custom-header__brand .custom-logo {
  display: block;
  width: auto !important;
  max-width: 230px !important;
  height: auto !important;
  max-height: 54px !important;
  opacity: 1 !important;
  transition: transform 0.25s ease;
}

.aletta-custom-header__brand .custom-logo-link:hover
  .custom-logo {
  transform: translateY(-1px);
}

.aletta-custom-header__text-logo {
  color: #17372f !important;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none !important;
}

/* Desktop navigation */

.aletta-custom-header__desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.aletta-custom-header__nav-link {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  min-height: 44px;
  padding: 4px 0 !important;
  background: transparent !important;
  color: #17372f !important;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.22s ease;
}

.aletta-custom-header__nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: #557565;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.aletta-custom-header__nav-link:hover,
.aletta-custom-header__nav-link.is-current {
  color: #557565 !important;
}

.aletta-custom-header__nav-link:hover::after,
.aletta-custom-header__nav-link.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Header actions */

.aletta-custom-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.aletta-custom-header__cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px !important;
  border-radius: 999px;
  background: #17372f !important;
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(23, 55, 47, 0.16);
  transition:
    transform 0.22s ease,
    background-color 0.22s ease,
    box-shadow 0.22s ease;
}

.aletta-custom-header__cta:hover {
  transform: translateY(-2px);
  background: #557565 !important;
  color: #ffffff !important;
  box-shadow: 0 16px 34px rgba(23, 55, 47, 0.2);
}

/* Cart */

.aletta-custom-header__cart {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0 !important;
  border: 1px solid rgba(23, 55, 47, 0.08);
  border-radius: 16px;
  background: #fbf8f2 !important;
  color: #17372f !important;
  text-decoration: none !important;
  box-shadow: 0 10px 24px rgba(23, 55, 47, 0.055);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease;
}

.aletta-custom-header__cart:hover {
  transform: translateY(-2px);
  border-color: rgba(95, 127, 111, 0.22);
  background: #e2eee8 !important;
  color: #17372f !important;
}

.aletta-custom-header__cart svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aletta-custom-header__cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #557565;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

/* Mobile menu button */

.aletta-custom-header__menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 16px;
  background: #17372f !important;
  box-shadow: none !important;
  cursor: pointer;
}

.aletta-custom-header__menu-button span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  transition:
    transform 0.28s ease,
    opacity 0.2s ease;
}

.aletta-custom-header__menu-button.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.aletta-custom-header__menu-button.is-open span:nth-child(2) {
  opacity: 0;
}

.aletta-custom-header__menu-button.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile panel */

.aletta-custom-header__mobile-panel {
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  left: 0;
  display: none;
  max-height: calc(100vh - 78px);
  overflow-y: auto;
  padding: 28px 22px 34px;
  border-bottom: 1px solid rgba(23, 55, 47, 0.08);
  background:
    radial-gradient(
      circle at 88% 12%,
      rgba(185, 211, 198, 0.34),
      transparent 30%
    ),
    #ffffff;
  box-shadow: 0 30px 60px rgba(23, 55, 47, 0.13);
  opacity: 0;
  visibility: hidden;
  translate: 0 -12px;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    translate 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.aletta-custom-header__mobile-panel.is-open {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  pointer-events: auto;
}

.aletta-custom-header__mobile-nav {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.aletta-custom-header__mobile-nav
  .aletta-custom-header__nav-link {
  display: flex !important;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 8px 16px !important;
  border-bottom: 1px solid rgba(23, 55, 47, 0.07);
  font-size: 19px;
}

.aletta-custom-header__mobile-nav
  .aletta-custom-header__nav-link::before {
  content: "↗";
  order: 2;
  color: #8da59a;
  font-size: 15px;
  transition: transform 0.22s ease;
}

.aletta-custom-header__mobile-nav
  .aletta-custom-header__nav-link:hover::before {
  transform: translate(2px, -2px);
}

.aletta-custom-header__mobile-nav
  .aletta-custom-header__nav-link::after {
  display: none;
}

.aletta-custom-header__mobile-footer {
  width: 100%;
  max-width: 520px;
  margin: 26px auto 0;
  padding: 24px;
  border-radius: 24px;
  background: #fbf8f2;
  text-align: left;
}

.aletta-custom-header__mobile-footer p {
  margin: 0 0 18px;
  color: #566d66;
  font-size: 14px;
  line-height: 1.6;
}

.aletta-custom-header__mobile-cta {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 13px 20px !important;
  border-radius: 999px;
  background: #17372f !important;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
}

.aletta-custom-header__mobile-contact {
  display: table !important;
  margin: 18px auto 0;
  padding: 2px 0 !important;
  border-bottom: 1px solid rgba(23, 55, 47, 0.3);
  background: transparent !important;
  color: #17372f !important;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
}


/* Tablet and mobile */

@media (max-width: 1100px) {
  .aletta-custom-header__inner {
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
    gap: 22px;
    padding-right: 38px;
    padding-left: 38px;
  }

  .aletta-custom-header__desktop-nav {
    gap: 22px;
  }

  .aletta-custom-header__cta {
    padding-right: 18px !important;
    padding-left: 18px !important;
    font-size: 13px;
  }
}

@media (max-width: 921px) {
  .aletta-custom-header__inner {
    display: flex;
    justify-content: space-between;
    min-height: 78px;
    padding: 10px 22px;
  }

  .aletta-custom-header.is-scrolled
    .aletta-custom-header__inner {
    min-height: 70px;
    padding: 8px 22px;
  }

  .aletta-custom-header__brand {
    flex: 1 1 auto;
  }

  .aletta-custom-header__brand .custom-logo {
    max-width: 205px !important;
    max-height: 48px !important;
  }

  .aletta-custom-header__desktop-nav,
  .aletta-custom-header__cta {
    display: none !important;
  }

  .aletta-custom-header__actions {
    flex: 0 0 auto;
  }

  .aletta-custom-header__menu-button,
  .aletta-custom-header__mobile-panel {
    display: flex;
  }

  .aletta-custom-header__mobile-panel {
    display: block;
  }

  body.aletta-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 782px) {
  body.admin-bar .aletta-custom-header {
    top: 46px;
  }
}

@media (max-width: 480px) {
  .aletta-custom-header__inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .aletta-custom-header__brand .custom-logo {
    max-width: 180px !important;
  }

  .aletta-custom-header__actions {
    gap: 8px;
  }

  .aletta-custom-header__cart,
  .aletta-custom-header__menu-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 15px;
  }

  .aletta-custom-header__mobile-panel {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aletta-custom-header *,
  .aletta-custom-header *::before,
  .aletta-custom-header *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Remove false admin-bar space above custom header */

body.admin-bar .aletta-custom-header {
  top: 0 !important;
}

@media (max-width: 782px) {
  body.admin-bar .aletta-custom-header {
    top: 0 !important;
  }
}
