:root {
  --bg: #fff;
  --text: #0a0a0a;
  --muted: #4b5563;
  --border: #e5e7eb;
  --brand: #cf1844;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090910;
    --text: #e6edf6;
    --muted: #9fb0c7;
    --border: #22304a;
  }
}

.c-hdr {
  position: relative;
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--brand);
}

.c-hdr__bar {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
}

.c-hdr__brand {
  min-width: 0;
}

.c-hdr__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: flex-end;
  margin-right: -.75rem;
}

@media (min-width: 408px) {
  .c-hdr__actions {
    margin-right: inherit;
  }
}

/* Language selector and hamburger both visible on mobile. */
.c-hdr__lang {
  display: inline-flex;
  order: 1;
  z-index: 100;
}

.c-hdr__hamburger {
  display: inline-flex;
  order: 2;
  z-index: 102;
}

@media (max-width: 408px) {
  .c-hdr__lang {
    display: inline-flex;
    order: 1;
    margin-right: -.75rem;
  }
}

.c-hdr__cta {
  position: absolute;
  left: 50%;
  top: .6rem;
  transform: translateX(-50%);
  z-index: 2;
}

/* Hidden panel for mobile menu + CTA. */
.c-hdr__panel {
  display: none !important;
}

/* Hide desktop menu on mobile */
@media (max-width: 969px) {
  .c-hdr__menu {
    display: none !important;
  }

  .c-hdr__panel {
    display: block !important;
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    height: 100%;
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px); /* Safari prefix */
    z-index: 99;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
  }

  .c-hdr__panel.open {
    transform: translateX(0);
  }

  .c-hdr__panel-inner {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
  }

  /* Mobile overlay background with blur - applied to all color schemes */
  @media (max-width: 969px) {
    @media (prefers-color-scheme: light) {
      /* Main menu overlay */
      .c-hdr__panel {
        background-color: rgba(239, 240, 255, 0.85);
      }
    }

    @media (prefers-color-scheme: dark) {
      /* Main menu overlay */
      .c-hdr__panel {
        background-color: rgba(10, 10, 22, 0.8);
      }
    }
  }
}

/* Desktop: put menu center, CTA + lang on right, hide hamburger. */
@media (min-width: 970px) {
  .c-hdr__bar {
    grid-template-columns: auto 1fr auto;
  }

  .c-hdr__panel {
    display: none !important;
  }

  .c-hdr__menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    min-height: 44px;
  }

  .c-hdr__actions {
    gap: .75rem;
  }

  .c-hdr__actions,
  .c-hdr__menu {
    align-self: center;
  }

  .c-hdr__cta {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    z-index: auto;
  }

  .c-hdr__lang {
    order: 0;
  }

  .c-hdr__hamburger {
    display: none;
  }
}

/* Placeholder blocks (remove when you plug real components) */
.ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: .4rem .6rem;
  color: #fff;
  font-weight: 700;
}

.ph--brand {
  background: #111;
}

.ph--menu {
  background: #0ea5e9;
}

.ph--cta {
  background: #10b981;
}

.ph--lang {
  background: #ef4444;
}
