/* ===== SITE HEADER — TOP BAR + MAIN BAR ===== */

/* Outer wrapper: fixed, no padding, transparent */
#masthead,
.site-header {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  width: 100%;
  z-index: 9999;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  transition: none;
}

/* Admin bar offset */
.admin-bar #masthead,
.admin-bar .site-header { top: 32px !important; }
@media (max-width: 782px) {
  .admin-bar #masthead,
  .admin-bar .site-header { top: 46px !important; }
}

/* Remove pill shape from Kadence wrapper */
#main-header,
.site-header-wrap {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  max-width: none !important;
  margin: 0 !important;
  transition: background .3s ease-out, box-shadow .3s ease-out, backdrop-filter .3s ease-out;
}

/* Scrolled: white + blur + shadow on the inner Kadence wrap */
#masthead.header--scrolled #main-header,
#masthead.header--scrolled .site-header-wrap {
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 2px 20px rgba(15,36,56,.12) !important;
  backdrop-filter: saturate(160%) blur(12px) !important;
  -webkit-backdrop-filter: saturate(160%) blur(12px) !important;
}

/* Kadence's own top bar row: hidden (our custom bar replaces it) */
.site-top-bar,
.header-top-bar,
.header-top-row { display: none !important; }

/* ===== TOP BAR ===== */
.jf-top-bar {
  display: block;
  width: 100%;
  background: #0F2438;
  color: rgba(255,255,255,.85);
  font-family: var(--font-body);
  font-size: .8125rem;
  overflow: hidden;
  max-height: 48px;
  opacity: 1;
  transition: max-height .3s ease-out, opacity .3s ease-out;
  flex-shrink: 0;
}

.jf-top-bar__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 9px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.jf-top-bar__contacts {
  display: flex;
  align-items: center;
  gap: 28px;
}

.jf-top-bar__link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: color .15s ease-out;
}
.jf-top-bar__link:hover { color: #E08B2D; }

.jf-top-bar__area-personale {
  color: #E08B2D;
  text-decoration: none;
  font-weight: 600;
  transition: color .15s ease-out;
}
.jf-top-bar__area-personale:hover { color: rgba(255,255,255,.9); }

/* Collapse on scroll */
#masthead.header--scrolled .jf-top-bar {
  max-height: 0;
  opacity: 0;
}

/* ===== CUSTOM MAIN HEADER ROW ===== */
.jf-main-header {
  display: block;
  width: 100%;
}

.jf-main-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* LOGO */
.jf-logo {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.jf-logo__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: #1B3A5C;
  letter-spacing: .02em;
}

.jf-logo__sub {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .78rem;
  color: #E08B2D;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* NAV — larghezza naturale, distribuita con space-between come nel design */
.jf-nav {
  display: flex;
  align-items: center;
}

.jf-nav .jf-nav__list {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.jf-nav .jf-nav__list > li { position: relative; }

.jf-nav .jf-nav__list a {
  color: #1B3A5C;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  transition: color 150ms ease-out;
}

.jf-nav .jf-nav__list a:hover { color: #E08B2D; }

.jf-nav .jf-nav__list .current-menu-item > a,
.jf-nav .jf-nav__list .current_page_item > a {
  color: #E08B2D;
  font-weight: 700;
}

/* ACTIONS — carrello, account, CTA */
.jf-header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.jf-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1B3A5C;
  text-decoration: none;
  transition: color 150ms ease-out;
}

.jf-header-icon:hover { color: #E08B2D; }

.jf-header-icon:focus-visible {
  outline: 2px solid #E08B2D;
  outline-offset: 3px;
  border-radius: 4px;
}

.jf-header-cta {
  background: #1B3A5C;
  color: #FFFFFF;
  border: 2px solid #1B3A5C;
  border-radius: 30px;
  padding: 11px 30px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease-out, border-color .15s ease-out;
}

.jf-header-cta:hover {
  background: #0F2438;
  border-color: #0F2438;
  color: #FFFFFF;
}

.jf-header-cta:focus-visible {
  outline: 2px solid #E08B2D;
  outline-offset: 3px;
}

/* ===== PAGE OFFSET ===== */
/* Home: hero sotto header trasparente */
body.home,
body.home #page,
body.home .site {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Inner pages: top bar (~39px) + main bar (81px) = altezza reale header */
body:not(.home) { padding-top: 120px !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1199px) {
  .jf-top-bar__inner        { padding: 9px 48px; }
  .jf-main-header__inner    { padding: 14px 48px; }
}

@media (max-width: 1023px) {
  .jf-top-bar__inner        { padding: 8px 24px; }
  .jf-main-header__inner    { padding: 12px 24px; }
  .jf-nav .jf-nav__list     { gap: 20px; }
  .jf-header-cta            { padding: 10px 22px; }
}

@media (max-width: 767px) {
  .jf-top-bar               { display: none !important; }
  .jf-main-header           { display: none; }
  body:not(.home)            { padding-top: 64px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .jf-top-bar,
  #main-header,
  .site-header-wrap { transition: none !important; }
}
