/* ══════════════════════════════════════════════════════════
   CITREA  —  Premium Navbar   (nv-*)
   Fully namespaced, zero Bootstrap conflicts.
   ══════════════════════════════════════════════════════════ */

/* ── 1. Custom Properties ── */
.nv-header {
  --nv-h:          72px;
  --nv-bg:         rgba(7, 7, 11, 0.84);
  --nv-bg-solid:   #07070b;
  --nv-border:     rgba(255,255,255,0.06);
  --nv-text:       #7a828c;
  --nv-text-hover: #f1f3f5;
  --nv-accent:     #F7E468;
  --nv-green:      #007136;
  --nv-dd-bg:      #0c0c11;
  --nv-dd-border:  rgba(255,255,255,0.08);
  --nv-shadow:     0 24px 72px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.4);
  --nv-radius:     10px;
}

/* ── 2. Header Shell ── */
.nv-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nv-h);
  background: var(--nv-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition:
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.nv-header--scrolled {
  background: #212529;
  border-bottom-color: var(--nv-border);
  box-shadow: 0 4px 40px #212529;
}

/* Top accent line */
.nv-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0,113,54,0.5) 20%,
    rgba(247,228,104,0.4) 50%,
    rgba(0,113,54,0.5) 80%,
    transparent 100%
  );
  pointer-events: none;
}

.nv-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 36px;
  gap: 0;
}

/* ── 3. Logo ── */
.nv-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  margin-right: 32px;
}

.nv-logo img {
  width: 152px;
  display: block;
  transition: opacity 0.2s;
}

.nv-logo:hover img { opacity: 0.82; }

/* ── 4. Desktop Nav ── */
.nv-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nv-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nv-item {
  position: relative;
}

/* Base link + button */
.nv-link,
.nv-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.015em;
  color: var(--nv-text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--nv-radius);
  position: relative;
  transition: color 0.22s, background 0.22s;
  white-space: nowrap;
  line-height: 1;
}

.nv-link:hover,
.nv-trigger:hover,
.nv-item--open > .nv-trigger {
  color: var(--nv-text-hover);
  background: rgba(255,255,255,0.045);
}

/* Active state */
.nv-link--active {
  color: var(--nv-text-hover) !important;
}

.nv-link--active::after,
.nv-trigger--active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 15px;
  right: 15px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--nv-green), var(--nv-accent));
  border-radius: 999px;
}

.nv-trigger--active {
  color: var(--nv-text-hover) !important;
}

/* Caret */
.nv-caret {
  flex-shrink: 0;
  display: inline-flex;
  font-size: 10px;
  opacity: 0.4;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.22s;
}

.nv-item--open > .nv-trigger > .nv-caret {
  transform: rotate(180deg);
  opacity: 0.8;
}

/* ── 5. Desktop Dropdowns ── */
.nv-dropdown {
  position: absolute;
  top: 100%;                /* flush — gap lives in padding-top below */
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  background: var(--nv-dd-bg);
  border: 1px solid var(--nv-dd-border);
  border-radius: 16px;
  padding: 12px 5px 5px;    /* 12px top padding = visual gap, no hover dead zone */
  box-shadow: var(--nv-shadow);
  display: none;            /* GSAP controls visibility */
  z-index: 200;
  overflow: visible;        /* must be visible so the padding area receives events */
}

/* Gradient top bar */
.nv-dropdown::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--nv-green) 0%, var(--nv-accent) 60%, transparent 100%);
  border-radius: 999px;
  margin: 0 10px 6px;
}

/* gap is now handled by padding-top: 12px on .nv-dropdown */

.nv-dd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Dropdown link item */
.nv-dd-link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s;
}

.nv-dd-link:hover,
.nv-dd-link--active {
  background: rgba(255,255,255,0.05);
}

.nv-dd-link:hover .nv-dd-icon,
.nv-dd-link--active .nv-dd-icon {
  background: rgba(0,113,54,0.25);
  color: #22cc66;
}

.nv-dd-link--active .nv-dd-text strong {
  color: #F7E468;
}

/* Icon box */
.nv-dd-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.04);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #3a3f45;
  transition: background 0.2s, color 0.2s;
}

/* Text block */
.nv-dd-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nv-dd-text strong {
  font-size: 13px;
  font-weight: 600;
  color: #e2e5ea;
  line-height: 1.3;
}

.nv-dd-text span {
  font-size: 11px;
  color: #3a3f45;
  line-height: 1.4;
}

/* ── 6. Right Area ── */
.nv-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 24px;
  flex-shrink: 0;
}

/* Language button (styled Bootstrap dropdown trigger) */
.nv-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px;
  cursor: pointer;
  color: var(--nv-text) !important;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none !important;
}

.nv-lang-btn::after {
  /* suppress Bootstrap caret */
  display: none !important;
}

.nv-lang-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14) !important;
  color: var(--nv-text-hover) !important;
}

/* Language dropdown menu override */
.nv-lang-dd {
  background: var(--nv-dd-bg) !important;
  border: 1px solid var(--nv-dd-border) !important;
  border-radius: 12px !important;
  padding: 5px !important;
  box-shadow: var(--nv-shadow) !important;
  min-width: 160px !important;
}

.nv-lang-dd .dropdown-item {
  color: var(--nv-text) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  transition: background 0.18s, color 0.18s !important;
}

.nv-lang-dd .dropdown-item:hover {
  background: rgba(255,255,255,0.06) !important;
  color: var(--nv-text-hover) !important;
}

/* ── 7. Hamburger ── */
.nv-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  cursor: pointer;
  gap: 5px;
  padding: 0;
  transition: background 0.2s;
}

.nv-hamburger:hover { background: rgba(255,255,255,0.08); }

.nv-hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #ced4da;
  border-radius: 999px;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
  transform-origin: center;
}

/* ── 8. Mobile Overlay ── */
.nv-mob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1010;
  display: none;
  opacity: 0;
}

/* ── 9. Mobile Panel ── */
.nv-mob-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100dvh;
  background: #09090e;
  border-left: 1px solid rgba(255,255,255,0.07);
  z-index: 1020;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  /* Nascosto di default — GSAP gestisce l'animazione */
  transform: translateX(100%);
}

/* Panel header */
.nv-mob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.nv-mob-logo img { width: 126px; display: block; }

.nv-mob-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  color: #6c757d;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

.nv-mob-close:hover {
  background: rgba(255,255,255,0.09);
  color: #f1f3f5;
}

/* Panel body */
.nv-mob-body {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Plain link row */
.nv-mob-link {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #6c757d;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.nv-mob-link:hover,
.nv-mob-link--active {
  background: rgba(255,255,255,0.04);
  color: #f1f3f5;
}

/* Accordion trigger */
.nv-mob-acc-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #6c757d;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.nv-mob-acc-btn:hover { background: rgba(255,255,255,0.04); color: #f1f3f5; }
.nv-mob-acc-btn--open { color: #f1f3f5; }

.nv-mob-acc-label { flex: 1; text-align: left; }

.nv-mob-arrow {
  flex-shrink: 0;
  color: #343a40;
  font-size: 11px;
  transition: color 0.2s;
  display: inline-flex;
}

.nv-mob-acc-btn:hover .nv-mob-arrow,
.nv-mob-acc-btn--open .nv-mob-arrow { color: #495057; }

/* ── 10. Mobile Accordion Content ── */
.nv-mob-acc-content {
  overflow: hidden;
  height: 0;           /* GSAP animates this */
}

.nv-mob-acc-inner {
  padding: 4px 0 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nv-mob-sub-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 400;
  color: #7a8086;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.nv-mob-sub-link:hover,
.nv-mob-sub-link--active {
  background: rgba(255,255,255,0.04);
  color: #9aa0aa;
}

.nv-mob-sub-link:hover .nv-mob-sub-icon,
.nv-mob-sub-link--active .nv-mob-sub-icon {
  background: rgba(0,113,54,0.16);
  color: #22cc66;
}

.nv-mob-sub-link--active {
  color: #F7E468;
  font-weight: 600;
}

.nv-mob-sub-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.03);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #2a2e33;
  transition: background 0.2s, color 0.2s;
}

/* Divider */
.nv-mob-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 6px 16px;
}

/* Panel footer */
.nv-mob-footer {
  padding: 18px 22px 28px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.nv-mob-footer-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #2a2e33;
  margin-bottom: 12px;
}

/* ── 11. Focus States ── */
.nv-link:focus-visible,
.nv-trigger:focus-visible,
.nv-hamburger:focus-visible,
.nv-mob-close:focus-visible,
.nv-mob-acc-btn:focus-visible,
.nv-mob-link:focus-visible,
.nv-mob-sub-link:focus-visible,
.nv-lang-btn:focus-visible {
  outline: 2px solid var(--nv-accent);
  outline-offset: 3px;
}

/* ── 12. Media Queries ── */
@media (max-width: 1100px) {
  .nv-link, .nv-trigger { padding: 8px 11px; font-size: 13px; }
  .nv-inner { padding: 0 24px; }
}

/* ── Desktop: pannello e overlay mobile sempre invisibili ── */
@media (min-width: 992px) {
  .nv-mob-panel   { display: none !important; }
  .nv-mob-overlay { display: none !important; }
  .nv-hamburger   { display: none !important; }
}

@media (max-width: 991px) {
  .nv-nav       { display: none; }
  .nv-hamburger { display: flex; }
  .nv-inner     { padding: 0 20px; }
  .nv-logo img  { width: 136px; }
  /* Ripristina il pannello come flex per permettere l'animazione GSAP */
  .nv-mob-panel { display: flex; }
}

@media (max-width: 480px) {
  .nv-mob-panel { max-width: 100%; border-left: none; }
}
