/**
 * Header - Medpro layout, Artimed colors
 */

.site-header {
  background: var(--color-hero-bg);
}

/* ── Top bar ── */
.header-top {
  background: var(--color-hero-bg);
  padding: 18px 0 16px;
}

.header-top-inner {
  max-width: 1285px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.header-top-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
}

.header-top-right {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.header-top-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-black);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.header-top .header-top-item:hover {
  color: var(--color-action);
}

.header-top-item .icon-map,
.header-top-item .icon-mail,
.header-top-item .icon-phone,
.header-top-item .icon-whatsapp {
  flex-shrink: 0;
}

.header-top-phone {
  display: none;
}

/* ── White navigation card — the ONLY sticky element ── */
.header-inner {
  position: sticky;
  top: 14px;
  z-index: 1000;
  display: grid;
  align-items: center;
  height: 100px;
  grid-template-columns: auto 1fr auto;
  padding: 0 32px;
  width: calc(100% - 48px);
  max-width: 1285px;
  margin: 0 auto 14px;
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px rgba(11, 16, 56, 0.05);
  transition: height 0.35s cubic-bezier(.4,0,.2,1),
              box-shadow 0.35s ease,
              border-radius 0.2s ease;
}

.header-inner.is-scrolled {
  height: 72px;
  box-shadow: 0 8px 32px rgba(11, 16, 56, 0.12);
}

.header-logo {
  grid-column: 1;
  display: flex;
  align-items: center;
}

.header-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
  transition: height 0.35s ease;
}

.header-inner.is-scrolled .header-logo img {
  height: 30px;
}

.header-nav {
  grid-column: 2;
  justify-self: start;
  display: flex;
  align-items: center;
  margin-left: 42px;
}

.header-nav .nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav .nav-menu a {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-black);
}

.header-nav .nav-menu a:hover {
  color: var(--color-brand);
}

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-black);
  white-space: nowrap;
}

.header-phone .icon-phone {
  flex-shrink: 0;
  color: var(--color-brand);
  transition: color var(--transition-fast);
}

.header-phone:hover {
  color: var(--color-action);
}

.header-actions .btn,
.header-actions .btn-arrow {
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-arrow.header-cta {
  --_btn-h: 42px;
  --_icon-size: 34px;
  font-size: var(--font-size-sm);
}

/* ── Mobile menu toggle ── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-sm);
  cursor: pointer;
  position: relative;
  width: 30px;
  height: 22px;
}

.menu-toggle span {
  display: block;
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-black);
  transition: var(--transition-base);
  transform-origin: center;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }

.menu-toggle.is-active span:nth-child(1) {
  top: 10px;
  transform: rotate(45deg);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  top: 10px;
  transform: rotate(-45deg);
}

/* ── Mobile ── */
@media (max-width: 991px) {
  .header-top {
    padding: 12px 0 10px;
  }

  .header-top-phone {
    display: inline-flex;
  }

  /* Hide address on mobile, keep mail + phone */
  .header-top-item:has(.icon-map) {
    display: none;
  }

  .header-inner {
    position: sticky;
    top: 10px;
    height: auto;
    min-height: 64px;
    width: calc(100% - 32px);
    padding: 16px 18px;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    transition: min-height 0.35s ease, box-shadow 0.35s ease, border-radius 0.2s ease;
  }

  /* border-radius handled by GSAP to sync with dropdown animation */

  .header-inner.is-scrolled {
    height: auto;
    min-height: 56px;
    padding: 12px 18px;
  }

  .header-logo {
    flex: 0 0 auto;
  }

  .header-inner.is-scrolled .header-logo img {
    height: 28px;
  }

  .header-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .header-phone {
    display: none !important;
  }

  .menu-toggle {
    display: block;
    flex-shrink: 0;
  }

  /* Nav dropdown — full-width extension of the white card */
  .header-nav {
    position: absolute;
    top: calc(100% - 10px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: -1;
    margin: 0;
    background: var(--color-white);
    border-radius: 0 0 10px 10px;
    box-shadow: none;
    height: 0;
    overflow: hidden;
    padding: 0 18px;
  }

  .header-nav .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 4px 0 16px;
  }

  .header-nav .nav-menu li {
    width: 100%;
  }

  .header-nav .nav-menu a {
    display: block;
    padding: 13px 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    border-bottom: none;
  }

  .btn-arrow.header-cta {
    --_btn-h: 36px;
    --_icon-size: 28px;
    font-size: var(--font-size-xs);
  }

  .btn-arrow.header-cta .btn-arrow__label {
    padding: 0 10px 0 14px;
  }

  .header-nav.is-open {
    height: auto;
    overflow: visible;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .header-nav.is-open .nav-menu li {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .header-top-inner {
    gap: 12px;
    padding: 0 16px;
  }

  .header-top-left {
    gap: 12px;
  }

  .header-top-item {
    font-size: var(--font-size-xs);
  }

  .header-inner {
    width: calc(100% - 24px);
    padding: 14px 14px;
  }

  .btn-arrow.header-cta {
    --_btn-h: 32px;
    --_icon-size: 24px;
    font-size: 11px;
  }

  .btn-arrow.header-cta .btn-arrow__label {
    padding: 0 8px 0 12px;
  }
}
