/**
 * Neo header — insertabile su pagine “live” (non Old/).
 * Prefisso .neo-* per evitare conflitti con .logo-block / .navbar di style.css.
 * Richiede: font Space Grotesk nel <head> + classe body.has-neo-header per --site-header-offset.
 * Barra full-bleed; riga interna a tutta larghezza (padding laterale fluido).
 */

body.has-neo-header {
  --neo-header-t-dur: 0.52s;
  --neo-header-t-ease: cubic-bezier(0.33, 1, 0.68, 1);
  --neo-header-offset: 96px;
  --neo-gold: #c9a03d;
  --neo-gold-soft: #f5e2b0;
  --site-header-offset: var(--neo-header-offset) !important;
}

@media (max-width: 780px) {
  body.has-neo-header {
    --neo-header-offset: 192px;
    --site-header-offset: var(--neo-header-offset) !important;
  }
}

@media (max-width: 560px) {
  body.has-neo-header {
    --neo-header-offset: 198px;
    --site-header-offset: var(--neo-header-offset) !important;
  }
}

@media (min-width: 781px) {
  body.has-neo-header {
    --neo-header-offset: 248px;
    --site-header-offset: var(--neo-header-offset) !important;
  }

  .neo-logo__titles {
    gap: 0.26rem;
  }

  .neo-header__inner {
    padding-top: 0.82rem;
    padding-bottom: 0.72rem;
    gap: 0.55rem 1rem;
    /* Riga alta quanto il logo: colonna destra centrata in Y (badge 24/7 al centro tra sopra e sotto). */
    align-items: stretch;
  }

  .neo-logo {
    align-self: center;
  }

  .neo-header__right {
    gap: 0.48rem;
    justify-content: center;
  }

  .neo-aside {
    align-items: center;
    gap: clamp(0.88rem, 1.45vw, 1.45rem);
  }

  .neo-divider {
    height: 3.35rem;
    align-self: center;
  }

  .neo-live {
    gap: 0.32rem;
  }
}

/* Header a scroll: offset leggermente più basso (solo blocco meteo tolto), logo/testi invariati */
body.has-neo-header.neo-header-is-compact {
  --neo-header-offset: 88px;
}

@media (max-width: 780px) {
  body.has-neo-header.neo-header-is-compact {
    --neo-header-offset: 162px;
  }
}

@media (max-width: 560px) {
  body.has-neo-header.neo-header-is-compact {
    --neo-header-offset: 168px;
  }
}

.neo-header-root {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 950;
  width: 100%;
  padding: 0;
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.neo-header-root * {
  pointer-events: auto;
}

.neo-header {
  width: 100%;
  max-width: none;
  margin: 0;
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  transition:
    box-shadow var(--neo-header-t-dur, 0.52s) var(--neo-header-t-ease, cubic-bezier(0.33, 1, 0.68, 1));
  font-family: "Space Grotesk", system-ui, sans-serif;
}

body.mc-cat-catalog.has-neo-header .neo-header {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

body.has-neo-header:not(.mc-cat-catalog) .neo-header {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.neo-header:hover {
  box-shadow: none;
}

body.mc-cat-catalog.has-neo-header .neo-header:hover {
  box-shadow: none;
}

.neo-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neo-gold),
    var(--neo-gold-soft),
    var(--neo-gold),
    transparent
  );
  border-radius: 0;
  opacity: 0.5;
  pointer-events: none;
}

.neo-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: min(140px, 28vw);
  height: 3px;
  background: radial-gradient(ellipse at center, var(--neo-gold) 0%, rgba(201, 160, 61, 0) 78%);
  border-radius: 0;
  pointer-events: none;
}

.neo-header__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.55rem clamp(0.85rem, 3.5vw, 3rem) 0.48rem;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  box-sizing: border-box;
}

.neo-header__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(42rem, 54vw);
}

.neo-aside__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 0.16rem;
  max-width: min(28rem, 100%);
}

.neo-logo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.neo-logo:hover {
  transform: translateY(-1px);
}

.neo-logo__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem 0.6rem;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  padding: 0.2rem 0.5rem 0.24rem;
  border-radius: 10px;
  border: none;
  box-shadow: none;
}

body.mc-cat-catalog.has-neo-header .neo-logo__brand {
  background-color: #fff;
  box-shadow: none;
}

body.has-neo-header:not(.mc-cat-catalog) .neo-logo__brand {
  background-color: #fff;
  box-shadow: none;
}

.neo-logo__titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.22rem;
  flex: 1 1 auto;
  min-width: 0;
}

.neo-logo__name {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.32rem, 3.65vw, 2.45rem);
  letter-spacing: 0.018em;
  word-spacing: 0.05em;
  line-height: 1.06;
  color: #0a0a0a;
  width: 100%;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.neo-logo__img {
  /* Immagine marchio nascosta: in header restano solo i testi (nome + desk + tagline). */
  display: none !important;
  height: 0;
  width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

body.has-neo-header .neo-logo__brand {
  gap: 0;
}

.neo-logo__line {
  font-size: clamp(0.74rem, 1.42vw, 0.95rem);
  font-weight: 600;
  letter-spacing: clamp(0.26em, 1.5vw, 0.56em);
  word-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #2a2a2a, #0a0a0a);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  position: relative;
  white-space: nowrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.neo-logo__line::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--neo-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.neo-logo:hover .neo-logo__line::after {
  transform: scaleX(1);
}

.neo-logo__titles > .neo-logo__tagline {
  display: block;
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: clamp(0.88rem, 1.42vw, 1.08rem);
  font-weight: 500;
  font-style: italic;
  color: #353537;
  line-height: 1.38;
  letter-spacing: 0.012em;
  word-spacing: 0.04em;
  margin: 0;
  margin-top: 0.06rem;
  max-width: min(22rem, 100%);
  text-align: left;
}

.neo-logo__heritage {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(0.6rem, 1.05vw, 0.74rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c5348;
  margin: 0;
  line-height: 1.32;
  max-width: 100%;
  text-align: right;
}

/* Desktop: heritage su una sola riga; column header più larga. */
@media (min-width: 992px) {
  .neo-header__right {
    max-width: min(52rem, 62vw);
  }

  .neo-aside__copy {
    max-width: none;
  }

  .neo-logo__heritage {
    white-space: nowrap;
  }
}

@media (min-width: 781px) and (max-width: 991px) {
  .neo-aside__copy {
    max-width: min(36rem, 100%);
  }
}

.neo-logo__pill24 {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  padding: 0.14rem 0.48rem 0.14rem 0.42rem;
  border-radius: 999px;
  font-size: clamp(0.68rem, 1.1vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #141312;
  background: rgba(201, 160, 61, 0.14);
  border: 1px solid rgba(201, 160, 61, 0.32);
}

.neo-logo__pill24 i {
  font-size: 1.05em;
  color: var(--neo-gold);
}

a.neo-logo__pill-wa {
  text-decoration: none;
  color: #1a6b42;
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.45);
  transition: background 0.15s ease, border-color 0.15s ease;
}

a.neo-logo__pill-wa:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: rgba(37, 211, 102, 0.65);
}

a.neo-logo__pill-wa i {
  font-size: 1.2rem;
  color: #25d366;
}

.neo-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.2rem;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
}

.neo-nav__pill {
  background: transparent;
  border: none;
  color: #121212;
  padding: 0.45rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  transition: color 0.22s ease, transform 0.22s ease;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.neo-nav__pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #0a0a0a;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.28s ease;
  z-index: -1;
}

.neo-nav__pill:hover {
  color: #fff;
  transform: translateY(-2px);
}

.neo-nav__pill:hover::before {
  opacity: 1;
}

.neo-nav__pill.is-active {
  background: #0a0a0a;
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.28);
}

.neo-nav__pill.is-active::before {
  display: none;
}

.neo-aside {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.neo-live {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #1a1a1a;
  background: transparent;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  max-height: 10rem;
  opacity: 1;
  visibility: visible;
}

.neo-live__meteo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.055);
  padding: 0.32rem 0.95rem 0.34rem;
  border-radius: 999px;
}

.neo-live__temp {
  font-size: 1.55rem;
  font-weight: 600;
  color: #0a0a0a;
  line-height: 1;
  position: relative;
}

.neo-live__temp sup {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--neo-gold);
  position: relative;
  top: -0.35em;
  margin-left: 0.05em;
}

.neo-live__flag {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.neo-flag-mc {
  width: 1rem;
  height: 1.2rem;
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.neo-flag-es {
  width: 1.05rem;
  height: 0.7rem;
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.neo-flag-it {
  width: 1.05rem;
  height: 0.7rem;
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.neo-live__place {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #0a0a0a, #2a2a2a);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  width: 100%;
  text-align: right;
  line-height: 1.25;
  padding-top: 0.02rem;
}

.neo-divider {
  display: block;
  width: 1px;
  height: 40px;
  background: rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
  align-self: center;
}

.neo-coord {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: #3a3a3a;
  font-weight: 600;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  background: transparent;
  padding: 0;
  border-radius: 0;
  line-height: 1.35;
  text-align: right;
}

.neo-coord__star {
  color: var(--neo-gold);
  font-size: 0.84rem;
  flex-shrink: 0;
  line-height: 1;
}

.neo-coord__geo {
  letter-spacing: inherit;
  font-weight: inherit;
  color: inherit;
}

/* Desktop: layout verticale (colonne) — è il default.
   Mobile (≤780px): layout orizzontale con pill unica e divider. */
@media (min-width: 781px) {
  .neo-coord__geo {
    display: inline;
    white-space: nowrap;
  }
}

.neo-cta {
  background: linear-gradient(135deg, #141414, #000);
  border: 1px solid #000;
  color: #fff;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.78rem 1.75rem;
  position: relative;
  overflow: hidden;
  transition:
    background 0.35s cubic-bezier(0.2, 0.9, 0.4, 1),
    color 0.25s ease,
    padding 0.3s ease,
    box-shadow 0.3s ease,
    letter-spacing 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  white-space: nowrap;
}

.neo-cta::after {
  content: "→";
  margin-left: 0.35rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.22s ease, transform 0.28s ease;
  font-weight: 300;
  font-size: 1rem;
}

.neo-cta:hover {
  background: #fff;
  color: #0a0a0a;
  border-color: #0a0a0a;
  padding-right: 2.1rem;
  letter-spacing: 0.22em;
  box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.22);
}

.neo-cta:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.neo-cta:active {
  transform: scale(0.98);
}

@media (max-width: 900px) {
  .neo-header__inner {
    padding-left: clamp(0.85rem, 4vw, 2.75rem);
    padding-right: clamp(0.85rem, 4vw, 2.75rem);
  }
}

@media (max-width: 780px) {
  .neo-header__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem clamp(0.75rem, 3.5vw, 2.25rem) 0.45rem;
    position: relative;
  }

  .neo-header__right {
    width: 100%;
    max-width: none;
    align-items: stretch;
    gap: 0.45rem;
  }

  .neo-aside__copy {
    position: absolute;
    top: 50%;
    right: clamp(0.75rem, 4vw, 2.5rem);
    transform: translateY(-50%);
    z-index: 6;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
  }

  .neo-aside__copy .neo-logo__heritage {
    display: none !important;
  }

  .neo-aside__copy .neo-logo__pill24 {
    pointer-events: auto;
    font-size: 0.9rem;
    padding: 0.4rem 0.62rem 0.42rem 0.55rem;
    letter-spacing: 0.07em;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
  }

  .neo-aside__copy .neo-logo__pill24 i {
    font-size: 1.15rem;
  }

  .neo-aside__copy a.neo-logo__pill-wa {
    padding: 0.42rem 0.48rem;
  }

  .neo-aside__copy a.neo-logo__pill-wa i {
    font-size: 1.35rem;
  }

  .neo-logo__titles > .neo-logo__tagline {
    font-size: clamp(0.76rem, 2.9vw, 0.92rem);
    line-height: 1.32;
    letter-spacing: 0.01em;
    word-spacing: 0.035em;
    max-width: min(17.5rem, calc(100vw - 6.5rem));
  }

  .neo-logo__brand {
    padding-right: 5.5rem;
    box-sizing: border-box;
  }

  .neo-logo__titles {
    gap: 0.1rem;
  }

  .neo-aside {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .neo-header-root .neo-aside > .neo-live {
    display: none !important;
  }

  .neo-divider {
    height: 32px;
  }

  .neo-coord {
    background: rgba(0, 0, 0, 0.055);
    padding: 0.34rem 0.82rem;
    border-radius: 999px;
    justify-content: flex-start;
    text-align: left;
  }

  .neo-logo__img {
    height: clamp(2.65rem, 7.5vw, 4rem);
    max-width: min(380px, 86vw);
  }

  .neo-logo__name {
    font-size: clamp(1.14rem, 3.45vw, 1.52rem);
    letter-spacing: 0.014em;
    word-spacing: 0.04em;
  }
}

@media (max-width: 560px) {
  .neo-aside {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
  }

  .neo-coord {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    padding: 0.28rem 0.65rem;
    max-width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .neo-logo__brand {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
  }

  .neo-logo__titles {
    flex: 1 1 auto;
    min-width: min(12rem, 100%);
  }

  .neo-logo__line {
    letter-spacing: clamp(0.18em, 2.5vw, 0.38em);
  }
}

/* Scroll compat: solo su mobile (≤780px) nasconde la colonna meteo; da PC resta tutto visibile */
@media (max-width: 780px) {
  body.neo-header-is-compact .neo-header {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.07);
  }

  body.neo-header-is-compact .neo-aside {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.has-neo-header {
    --neo-header-t-dur: 0.01ms;
    --neo-header-t-ease: linear;
  }

  .neo-header,
  .neo-logo,
  .neo-nav__pill,
  .neo-cta {
    transition: none;
  }
}

/* Coordinate nascoste solo su viewport strette; da PC (≥781px) restano visibili */
@media (max-width: 780px) {
  .neo-header-root .neo-aside > .neo-divider,
  .neo-header-root .neo-aside .neo-coord {
    display: none !important;
  }
}
