/*
 * Faditec Protect - public header refinement
 * Authoritative finishing layer for the shared public header.
 * Loaded after the legacy public polish files to keep header behavior
 * centralized without disturbing inner-page/hero/footer styling.
 */
.fd-public-header--premium {
  --fd-header-ink: #0f172a;
  --fd-header-muted: #64748b;
  --fd-header-border: rgba(15, 23, 42, .085);
  --fd-header-surface: rgba(255, 255, 255, .965);
  --fd-header-soft: #f6f8fb;
  --fd-header-red: #e11d2e;
  --fd-header-red-strong: #b91522;
  --fd-header-red-soft: #fff1f3;
  position: sticky;
  top: 0;
  z-index: 1040;
  padding: .62rem 0;
  border: 0;
  background: rgba(248, 250, 252, .86);
  box-shadow: none;
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  transition: padding .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.fd-public-header--premium::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, .07) 18%, rgba(15, 23, 42, .07) 82%, transparent);
  pointer-events: none;
}

.fd-public-header--premium.is-scrolled {
  padding: .4rem 0;
  background: rgba(248, 250, 252, .94);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

.fd-public-header--premium .fd-public-header__inner {
  position: relative;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .48rem .62rem;
  border: 1px solid var(--fd-header-border);
  border-radius: 22px;
  background: var(--fd-header-surface);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .075), inset 0 1px 0 rgba(255, 255, 255, .82);
  transition: min-height .22s ease, border-color .22s ease, box-shadow .22s ease, border-radius .22s ease;
}

@media (min-width: 1200px) {
  .fd-public-header--premium .fd-public-header__inner {
    width: calc(100% - 2rem);
    max-width: 1380px;
  }
}

.fd-public-header--premium.is-scrolled .fd-public-header__inner {
  min-height: 62px;
  border-color: rgba(15, 23, 42, .10);
  box-shadow: 0 15px 38px rgba(15, 23, 42, .09), inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* Brand: keep the uploaded horizontal identity visible without a second card around it. */
.fd-public-header--premium .fd-public-brand {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-width: 0;
}

.fd-public-header--premium .fd-public-brand--logo {
  padding: .18rem .38rem !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.fd-public-header--premium .fd-public-brand__logo {
  width: min(var(--fd-public-logo-width, 220px), 205px) !important;
  max-width: min(21vw, 205px) !important;
  max-height: min(var(--fd-public-logo-max-height, 56px), 50px) !important;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .07));
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}

.fd-public-header--premium .fd-public-brand--logo:hover .fd-public-brand__logo,
.fd-public-header--premium .fd-public-brand--logo:focus-visible .fd-public-brand__logo {
  transform: translateY(-1px);
  filter: drop-shadow(0 9px 18px rgba(15, 23, 42, .11));
}

/* Desktop navigation is visually centered independently from the actions width. */
.fd-public-header--premium .fd-public-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  width: max-content;
  max-width: 48%;
  min-width: 0;
  padding: .28rem;
  border: 1px solid rgba(15, 23, 42, .055);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(248, 250, 252, .96), rgba(244, 247, 250, .88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 5px 14px rgba(15, 23, 42, .025);
}

.fd-public-header--premium .fd-public-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .52rem .76rem .56rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #334155;
  background: transparent;
  white-space: nowrap;
  word-break: keep-all;
  line-height: 1;
  font-size: clamp(.82rem, .72vw, .91rem);
  font-weight: 800;
  letter-spacing: -.012em;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.fd-public-header--premium .fd-public-nav a:hover {
  color: var(--fd-header-red-strong);
  background: rgba(255, 255, 255, .78);
  border-color: rgba(185, 21, 34, .08);
  transform: translateY(-1px);
}

.fd-public-header--premium .fd-public-nav a.is-active,
.fd-public-header--premium .fd-public-nav a[aria-current="page"] {
  color: var(--fd-header-red-strong);
  background: #fff;
  border-color: rgba(185, 21, 34, .11);
  box-shadow: 0 7px 18px rgba(15, 23, 42, .07), inset 0 -2px 0 rgba(225, 29, 46, .72);
}

.fd-public-header--premium .fd-public-nav a:focus-visible,
.fd-public-header--premium .fd-public-brand:focus-visible,
.fd-public-header--premium .fd-public-actions a:focus-visible,
.fd-public-header--premium .fd-public-menu-toggle:focus-visible,
.fd-public-header--premium .fd-currency-switcher select:focus-visible {
  outline: 3px solid rgba(225, 29, 46, .19);
  outline-offset: 2px;
}

/* Actions: compact utility controls plus one dominant CTA. */
.fd-public-header--premium .fd-public-actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .42rem;
  min-width: 0;
}

.fd-public-header--premium .fd-public-actions .btn {
  min-height: 42px;
  padding: .5rem .82rem;
  border-radius: 13px;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.fd-public-header--premium .fd-public-actions .btn i {
  font-size: .92rem;
}

.fd-public-header--premium .fd-public-actions .fd-public-login {
  color: #263244 !important;
  border-color: rgba(15, 23, 42, .10) !important;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .045);
}

.fd-public-header--premium .fd-public-actions .fd-public-login:hover,
.fd-public-header--premium .fd-public-actions .fd-public-login:focus {
  color: var(--fd-header-red-strong) !important;
  border-color: rgba(225, 29, 46, .20) !important;
  background: var(--fd-header-red-soft) !important;
  transform: translateY(-1px);
}

.fd-public-header--premium .fd-public-actions .fd-public-cta-main,
.fd-public-header--premium .fd-public-actions .btn-primary {
  padding-inline: .96rem;
  border: 1px solid rgba(159, 18, 35, .18) !important;
  background: linear-gradient(135deg, #f02840 0%, #dc1f35 45%, #a90f1b 100%) !important;
  box-shadow: 0 10px 24px rgba(190, 24, 40, .22), inset 0 1px 0 rgba(255, 255, 255, .20);
}

.fd-public-header--premium .fd-public-actions .fd-public-cta-main:hover,
.fd-public-header--premium .fd-public-actions .fd-public-cta-main:focus {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(190, 24, 40, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.fd-public-header--premium .fd-currency-switcher--public {
  min-height: 42px;
  padding: .25rem .42rem;
  gap: .28rem;
  border: 1px solid rgba(15, 23, 42, .085);
  border-radius: 13px;
  color: #1e293b;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .045);
}

.fd-public-header--premium .fd-currency-switcher--public .fd-currency-switcher__icon {
  width: 25px;
  height: 25px;
  color: var(--fd-header-red-strong);
  background: var(--fd-header-red-soft);
  font-size: .75rem;
}

.fd-public-header--premium .fd-currency-switcher--public select {
  min-width: 84px;
  max-width: 102px;
  padding: 0 .05rem;
  color: #334155;
  font-size: .76rem;
  font-weight: 800;
}

.fd-public-header--premium .fd-notification-dropdown--public .fd-notification-btn,
.fd-public-header--premium .fd-public-menu-toggle {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 13px;
  color: #1e293b;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}

.fd-public-header--premium .fd-public-menu-toggle:hover,
.fd-public-header--premium .fd-public-menu-toggle[aria-expanded="true"] {
  color: var(--fd-header-red-strong);
  border-color: rgba(225, 29, 46, .20);
  background: var(--fd-header-red-soft);
}

/* Mobile/tablet dropdown: a deliberate menu surface, not loose cards below the bar. */
.fd-public-header--premium .fd-public-mobile {
  margin-top: .5rem;
  padding: .58rem;
  border: 1px solid rgba(15, 23, 42, .09);
  border-radius: 20px;
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .12);
}

.fd-public-header--premium .fd-public-mobile.is-open {
  animation: fdPublicMenuReveal .18s ease-out both;
}

.fd-public-header--premium .fd-public-mobile__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .42rem;
}

.fd-public-header--premium .fd-public-mobile__currency {
  padding: .18rem;
  border: 0;
  border-radius: 14px;
  background: var(--fd-header-soft);
}

.fd-public-header--premium .fd-currency-switcher--mobile {
  min-height: 44px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 12px;
  box-shadow: none;
}

.fd-public-header--premium .fd-public-mobile a {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: .52rem;
  padding: .68rem .78rem;
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 13px;
  color: #334155;
  background: #f8fafc;
  font-size: .86rem;
  font-weight: 800;
  box-shadow: none;
}

.fd-public-header--premium .fd-public-mobile a i {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--fd-header-red-strong);
  background: var(--fd-header-red-soft);
}

.fd-public-header--premium .fd-public-mobile a:hover,
.fd-public-header--premium .fd-public-mobile a.is-active,
.fd-public-header--premium .fd-public-mobile a[aria-current="page"] {
  color: var(--fd-header-red-strong) !important;
  border-color: rgba(225, 29, 46, .14) !important;
  background: #fff6f7 !important;
}

.fd-public-header--premium .fd-public-mobile__primary {
  color: #fff !important;
  border-color: rgba(159, 18, 35, .16) !important;
  background: linear-gradient(135deg, #f02840, #b91522) !important;
  box-shadow: 0 10px 22px rgba(190, 24, 40, .18) !important;
}

.fd-public-header--premium .fd-public-mobile__primary i {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

@keyframes fdPublicMenuReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1399.98px) {
  .fd-public-header--premium .fd-public-header__inner {
    gap: .7rem;
  }

  .fd-public-header--premium .fd-public-brand__logo {
    width: min(var(--fd-public-logo-width, 220px), 186px) !important;
    max-width: 18vw !important;
  }

  .fd-public-header--premium .fd-public-nav {
    max-width: 44%;
  }

  .fd-public-header--premium .fd-public-nav a {
    padding-inline: .6rem;
    font-size: .81rem;
  }

  .fd-public-header--premium .fd-public-actions .btn {
    padding-inline: .68rem;
    font-size: .8rem;
  }

  .fd-public-header--premium .fd-public-actions .fd-public-cta-main {
    padding-inline: .78rem;
  }

  .fd-public-header--premium .fd-currency-switcher--public select {
    min-width: 74px;
    max-width: 88px;
  }
}

@media (max-width: 1199.98px) {
  .fd-public-header--premium {
    padding: .5rem 0;
  }

  .fd-public-header--premium .fd-public-header__inner,
  .fd-public-header--premium.is-scrolled .fd-public-header__inner {
    min-height: 60px;
    padding: .42rem .52rem;
    border-radius: 18px;
  }

  .fd-public-header--premium .fd-public-nav,
  .fd-public-header--premium .fd-public-actions .fd-public-login,
  .fd-public-header--premium .fd-currency-switcher--public {
    display: none;
  }

  .fd-public-header--premium .fd-public-menu-toggle {
    display: inline-grid;
  }

  .fd-public-header--premium .fd-public-brand__logo {
    width: min(var(--fd-public-logo-mobile-width, 160px), 172px) !important;
    max-width: 34vw !important;
    max-height: 44px !important;
  }
}

@media (max-width: 767.98px) {
  .fd-public-header--premium {
    padding: .38rem 0;
  }

  .fd-public-header--premium .fd-public-header__inner,
  .fd-public-header--premium.is-scrolled .fd-public-header__inner {
    min-height: 56px;
    border-radius: 16px;
    padding: .36rem .42rem;
  }

  .fd-public-header--premium .fd-public-actions .fd-public-cta-main {
    min-height: 40px;
    padding: .46rem .7rem;
    border-radius: 12px;
    font-size: .78rem;
  }

  .fd-public-header--premium .fd-public-menu-toggle,
  .fd-public-header--premium .fd-notification-dropdown--public .fd-notification-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
  }

  .fd-public-header--premium .fd-public-mobile {
    margin-top: .38rem;
    border-radius: 17px;
    padding: .48rem;
  }
}

@media (max-width: 575.98px) {
  .fd-public-header--premium .fd-public-brand--logo {
    padding: .1rem .2rem !important;
  }

  .fd-public-header--premium .fd-public-brand__logo {
    width: min(var(--fd-public-logo-mobile-width, 160px), 148px) !important;
    max-width: 43vw !important;
    max-height: 40px !important;
  }

  .fd-public-header--premium .fd-public-actions {
    gap: .34rem;
  }

  .fd-public-header--premium .fd-public-actions .fd-public-cta-main {
    display: none;
  }

  .fd-public-header--premium .fd-public-mobile__grid {
    grid-template-columns: 1fr;
  }
}



/* P4.5.2 Guest public header anti-overlap
 * The desktop header must remain in normal document flow. The previous
 * absolute-centered nav could visually collide with currency/login/CTA when
 * guest actions became wider. Keep the brand, navigation, and actions as one
 * responsive row, and reserve the hamburger only for tablet/mobile layouts.
 */
@media (min-width: 1200px) {
  .fd-public-header--premium .fd-public-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(.58rem, .85vw, 1rem);
  }

  .fd-public-header--premium .fd-public-brand {
    flex: 0 0 auto;
  }

  .fd-public-header--premium .fd-public-nav {
    position: static;
    inset: auto;
    transform: none;
    flex: 1 1 auto;
    width: auto;
    max-width: min(560px, 42vw);
    margin-inline: auto;
    overflow: visible;
  }

  .fd-public-header--premium .fd-public-actions {
    flex: 0 0 auto;
    gap: clamp(.32rem, .55vw, .5rem);
  }

  .fd-public-header--premium .fd-public-menu-toggle {
    display: none !important;
  }
}

@media (min-width: 1200px) and (max-width: 1439.98px) {
  .fd-public-header--premium .fd-public-brand__logo {
    width: min(var(--fd-public-logo-width, 220px), 178px) !important;
    max-width: 16vw !important;
  }

  .fd-public-header--premium .fd-public-nav {
    max-width: min(500px, 41vw);
  }

  .fd-public-header--premium .fd-public-nav a {
    min-height: 38px;
    padding-inline: .54rem;
    font-size: .79rem;
  }

  .fd-public-header--premium .fd-public-actions .btn {
    min-height: 40px;
    padding-inline: .64rem;
    font-size: .78rem;
  }

  .fd-public-header--premium .fd-currency-switcher--public {
    min-height: 40px;
    padding-inline: .36rem;
  }

  .fd-public-header--premium .fd-currency-switcher--public select {
    min-width: 70px;
    max-width: 82px;
  }
}

@media (min-width: 1200px) and (max-width: 1280px) {
  .fd-public-header--premium .fd-public-actions .fd-public-login {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fd-public-header--premium,
  .fd-public-header--premium .fd-public-header__inner,
  .fd-public-header--premium .fd-public-nav a,
  .fd-public-header--premium .fd-public-brand__logo,
  .fd-public-header--premium .fd-public-actions .btn {
    transition: none !important;
  }

  .fd-public-header--premium .fd-public-mobile.is-open {
    animation: none !important;
  }
}
