/* Runtime glue: what Elementor's frontend JS normally provides
   (sticky pinning, dialogs, preloader, background video sizing, Lenis). */

/* ---------- Lenis ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Background video (Elementor sizes it with JS) ---------- */
.nzr-root .nzr-background-video-hosted {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Homepage heroes: a dark blue behind the video (sampled from its first frames), so the white
   hero text is readable from the moment the preloader lifts, before the video has a frame, or
   where it can't play at all. page.css gives these containers no background or overlay. */
.nzr-page-home .nzr-element.nzr-hero-mobile,
.nzr-page-home .nzr-element.nzr-hero { background-color: #0b274d; }

/* Elementor shrinks linked SVGs to 48px; logos here should size like raster images */
.nzr-widget-image a img[src$=".svg"] { width: auto; }

/* ---------- Sticky pinning ---------- */
/* Header: sticky top, offset 0, on every device it is visible */
.nzr-element.js-sticky-header { position: sticky; top: 0; }

@media (min-width: 768px) {
  /* Intro badge: offset 120, bounded by its column */
  .nzr-element.js-sticky-120 { position: sticky; top: 120px; }
  /* Stacking gallery: each card pins at 63px and the next one slides over it */
  .nzr-element.nzr-gallery-sticky-card,
  .nzr-element.nzr-gallery__card-retail { position: sticky; top: 63px; }
}

/* Features column: offset 20 (laptop 25), bounded by its section */
.nzr-element.js-sticky-features { position: sticky; top: 20px; }
@media (max-width: 1366px) and (min-width: 1025px) {
  .nzr-element.js-sticky-features { top: 25px; }
}

/* Mobile CTA bar: sticky to the bottom of the viewport */
.nzr-element.js-sticky-bottom { position: sticky; bottom: 0; }

/* Unbounded pin (address headline): fixed by JS once it reaches its offset;
   later sections (z-index 18) slide over it. */
.nzr-element.js-sticky-pin.nzr-is-pinned { position: fixed; z-index: 10; }

/* ---------- Dialog / popup base ---------- */
.nzr-dialog-widget.nzr-dialog-type-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  display: none;
}
.nzr-dialog-widget.nzr-is-open { display: flex; }
.nzr-dialog-widget .nzr-dialog-widget-content { position: relative; margin: auto; }
.nzr-dialog-widget [data-nzr-type=popup]:not(.nzr-edit-area) { display: block; }
.nzr-dialog-widget .nzr-dialog-close-button {
  position: absolute;
  cursor: pointer;
  line-height: 1;
}
.nzr-dialog-widget.nzr-is-open .nzr-dialog-widget-content { animation: popupFadeIn .6s ease both; }
.nzr-dialog-widget.nzr-is-closing .nzr-dialog-widget-content { animation: popupFadeOut .3s ease both; }
@keyframes popupFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popupFadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Off-canvas ---------- */
.nzr-widget-off-canvas .nzr-off-canvas[aria-hidden=false] { opacity: 1; visibility: visible; }
.nzr-widget-off-canvas .nzr-off-canvas[aria-hidden=false] .nzr-off-canvas__main { animation: popupFadeIn .6s ease both; }
.nzr-widget-off-canvas .nzr-off-canvas__overlay { cursor: pointer; }
.nzr-widget-off-canvas .nzr-off-canvas__content { cursor: auto; }

/* ---------- Page transition / preloader ----------
   The logo shows from the first paint. The overlay fades out when the script printed after it
   (natuzzi_page_transition() in inc/acf.php) adds --exiting once the logo has been painted, or
   1s after the first paint at the latest: the animation below, which also covers visitors
   without JavaScript. */
.nzr-page-transition {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--nzr-global-color-d1fd4c3, #fff);
  transition: opacity .3s ease, visibility .3s ease;
  animation: pageTransitionOut .3s ease 1s forwards;
}
/* animation: none, so the 1s fallback can't run the fade a second time */
.nzr-page-transition--exiting { opacity: 0; visibility: hidden; pointer-events: none; animation: none; }
.nzr-page-transition__preloader {
  width: 181px;
  max-width: 30vw;
  height: auto;
  animation: preloaderPulse var(--nzr-preloader-animation-duration, 3500ms) ease-in-out infinite;
}
@keyframes preloaderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@keyframes pageTransitionOut {
  to { opacity: 0; visibility: hidden; }
}

/* ---------- Forms ---------- */

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  /* no fade: the overlay goes at once (the 1s fallback jumps straight to its end) */
  .nzr-page-transition { transition: none; animation-duration: 0s; }
  .nzr-dialog-widget .nzr-dialog-widget-content,
  .nzr-off-canvas__main { animation: none !important; }
}


/* Button hover: change background and text colour */
:root {
  --nzr-btn-hover-bg: #201718;   /* background on hover (brand dark brown) */
  --nzr-btn-hover-text: #F4F0EB; /* text colour on hover (brand cream) */
}

.nzr-button {
  transition: background-color .3s ease, color .3s ease, fill .3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .nzr-button:hover,
  .nzr-button:focus-visible {
    background-color: var(--nzr-btn-hover-bg) !important;
    color: var(--nzr-btn-hover-text) !important;
    fill: var(--nzr-btn-hover-text) !important;
  }
}


/* ---------- Phone field: country dropdown (intl-tel-input) ---------- */
:root {
  --nzr-phone-dark: #201718;
  --nzr-phone-cream: #F4F0EB;
  --nzr-phone-taupe: #B3A593;

  --iti-icon-color: #fff;                          /* arrow next to the flag */
  --iti-border-color: #fff;
  --iti-hover-color: rgba(179, 165, 147, .3);      /* highlighted row */
  --iti-country-selector-bg: var(--nzr-phone-cream);
}

.nzr-form .iti { display: block; width: 100%; }

/* the flag button must not pick up the theme's pink focus/hover colour */
.nzr-form .iti__selected-country,
.nzr-form .iti__selected-country:hover,
.nzr-form .iti__selected-country:focus,
.nzr-form .iti__selected-country[aria-expanded="true"] {
  background-color: transparent;
  color: #fff;
}
.nzr-form .iti__selected-country:hover { background-color: rgba(255, 255, 255, .12); }

.nzr-form .iti__selected-dial-code {
  color: #fff;
  font-size: inherit;
  font-weight: 300;
}

/* ----- the country list (opens in <body>, so it is styled globally) ----- */
.iti__country-selector {
  font-family: var(--site-font), sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: var(--nzr-phone-dark);
  background: var(--nzr-phone-cream);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(32, 23, 24, .2);
  overflow: hidden;
  z-index: 100000;
}

/* search field: underlined, like the form fields */
.iti__country-selector .iti__search-input {
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: var(--nzr-phone-dark);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--nzr-phone-taupe);
  border-radius: 0;
  box-shadow: none;
  outline: none;
  padding: 14px 16px 12px 38px;
}
.iti__country-selector .iti__search-input:focus { border-bottom-color: var(--nzr-phone-dark); }
.iti__country-selector .iti__search-input::placeholder {
  color: rgba(32, 23, 24, .5);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.iti__country-selector .iti__search-icon-svg { stroke: var(--nzr-phone-dark); }

/* rows */
.iti__country-list {
  scrollbar-width: thin;
  scrollbar-color: var(--nzr-phone-taupe) transparent;
}
.iti__country { padding: 10px 16px; }
.iti__country-name { font-weight: 300; }
.iti__country[aria-selected="true"] .iti__country-name { font-weight: 400; }
.iti__country .iti__dial-code { color: rgba(32, 23, 24, .55); }
.iti__country-check-svg { stroke: var(--nzr-phone-dark); }

/* error message under the field */
.nzr-phone-error {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 8px;
  padding: 0 16px;
  font-family: var(--site-font), sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  color: #7a0c0c;
}
.nzr-form input[aria-invalid="true"] { border-bottom-color: #7a0c0c; }


/* ---------- Lead forms: sending, error message, spam trap ---------- */
.nzr-form.nzr-is-sending .nzr-button[type="submit"] { opacity: .6; cursor: progress; }

/* shown when the form could not be sent (same colour as the phone error) */
.nzr-form .nzr-message-error {
  font-family: var(--site-font), sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  color: #7a0c0c;
}
.nzr-form .nzr-message-error::before { content: none; }

/* honeypot field (inc/leads.php): off-screen, so people never see or reach it */
.nzr-lead-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
