/* ============================================================
   NAV v2 — Navbar moderna agriturismi.it
   Sfondo bianco, palette teal, leggera e pulita
   2026-03
   ============================================================ */

/* --- Navbar container ---------------------------------------- */
.agri-nav {
  position: relative;
  z-index: 1030;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  margin-bottom: 16px;
}

.agri-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* --- Logo ---------------------------------------------------- */
.agri-nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.agri-nav-brand img {
  height: 40px;
  width: auto;
}

/* --- Menu desktop -------------------------------------------- */
.agri-nav-menu {
  align-items: center;
  gap: 4px;
  /* CLS: previene shift al breakpoint lg quando icone Font-Awesome/SVG si idratano */
  min-height: 48px;
}

/* --- Link singolo -------------------------------------------- */
.agri-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: .875rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.agri-nav-link:hover,
.agri-nav-link:focus {
  background: #f3f4f6;
  color: #0d9488;
  text-decoration: none;
}

/* --- CTA button ---------------------------------------------- */
.agri-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #e8710a);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s ease;
}

.agri-nav-cta:hover,
.agri-nav-cta:focus {
  background: linear-gradient(135deg, #e8710a, #cf6509);
  box-shadow: 0 4px 12px rgba(232,113,10,.35);
  color: #fff;
  text-decoration: none;
}

/* --- Dropdown lingua ----------------------------------------- */
.agri-nav-lang {
  position: relative;
}

.agri-nav-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  transition: border-color .15s, background .15s;
}

.agri-nav-lang-btn:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.agri-nav-lang-btn img {
  border-radius: 2px;
}

.agri-nav-lang-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 1050;
}

.agri-nav-lang-drop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.agri-nav-lang-drop a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: background .12s;
}

.agri-nav-lang-drop a:hover {
  background: #f3f4f6;
  color: #0d9488;
}

.agri-nav-lang-drop a img {
  border-radius: 2px;
  flex-shrink: 0;
}

/* --- Dropdown Accedi (Profilo + Area Gestori, IT) ------------ */
.agri-nav-access {
  display: inline-flex;
  align-items: center;
}

.agri-nav-access-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #374151;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.agri-nav-access-btn:hover,
.agri-nav-access-btn:focus,
.agri-nav-access-btn[aria-expanded="true"] {
  color: #0d9488;
  background: #f3f4f6;
}

.agri-nav-access-drop {
  /* Position: fixed → posizione assoluta rispetto al viewport, niente
     dipendenze da flex/parent. Top/right vengono calcolati da JS al click
     usando getBoundingClientRect() del bottone "Accedi". */
  position: fixed;
  top: 0;
  left: 0;
  min-width: 170px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 1050;
}

.agri-nav-access-drop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.agri-nav-access-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .9rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: background .12s, color .12s;
}

.agri-nav-access-item:hover,
.agri-nav-access-item:focus {
  background: #f3f4f6;
  color: #0d9488;
  text-decoration: none;
}

.agri-nav-access-item i {
  width: 16px;
  text-align: center;
  color: #6b7280;
  flex-shrink: 0;
}

.agri-nav-access-item:hover i {
  color: #0d9488;
}

/* --- Hamburger mobile ---------------------------------------- */
.agri-nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
}

.agri-nav-toggle:hover {
  background: #f3f4f6;
}

.agri-nav-toggle svg {
  display: block;
  width: 24px;
  height: 24px;
}


/* ============================================================
   OFFCANVAS — Menu mobile slide-in da destra
   ============================================================ */

.nav-offcanvas-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.4);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.nav-offcanvas-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.nav-offcanvas-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #fff;
  z-index: 1050;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-offcanvas-panel.show {
  transform: translateX(0);
}

/* Header */
.nav-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.nav-offcanvas-logo img {
  height: 30px;
  width: auto;
}

.nav-offcanvas-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.nav-offcanvas-close:hover {
  background: #e5e7eb;
  color: #111;
}

/* CTA in alto mobile */
.nav-oc-cta-wrap {
  padding: 16px 20px 8px;
}

.nav-oc-cta-wrap .agri-nav-cta {
  display: flex;
  width: 100%;
  padding: 12px 20px;
  font-size: .95rem;
  border-radius: 10px;
}

/* Body */
.nav-offcanvas-body {
  flex: 1;
  padding: 8px 0;
}

.nav-offcanvas-body .nav-oc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  font-size: .95rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: background .12s, color .12s;
}

.nav-offcanvas-body .nav-oc-link:hover,
.nav-offcanvas-body .nav-oc-link:focus {
  background: #f9fafb;
  color: #0d9488;
  text-decoration: none;
}

.nav-offcanvas-body .nav-oc-link i {
  width: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-offcanvas-body .nav-oc-link:hover i {
  color: #0d9488;
}

.nav-oc-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 6px 20px;
}

/* Bandiere lingua */
.nav-oc-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
}

.nav-oc-langs a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  transition: border-color .15s, transform .15s;
}

.nav-oc-langs a:hover {
  border-color: #0d9488;
  transform: scale(1.08);
}

.nav-oc-langs a.active {
  border-color: #0d9488;
  background: #f0fdfa;
}

.nav-oc-langs a img {
  width: 22px;
  height: 14px;
  border-radius: 2px;
}

/* Blocca scroll body */
body.nav-offcanvas-open {
  overflow: hidden;
}

/* --- Responsive: nascondi offcanvas su desktop --------------- */
@media (min-width: 992px) {
  .nav-offcanvas-overlay,
  .nav-offcanvas-panel {
    display: none !important;
  }
}

/* --- Responsive: logo piccolo su mobile ---------------------- */
@media (max-width: 575px) {
  .agri-nav-brand img {
    height: 32px;
  }
  .agri-nav-inner {
    height: 56px;
  }
}

/* ── Dropdown "Esplora" desktop (Esperienze / Itinerari / Fattorie didattiche) */
.agri-nav-explora {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.agri-nav-explora-btn {
    background: none;
    border: 0;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .15s;
}
.agri-nav-explora-btn:hover { color: #0d9488; }
.agri-nav-explora-btn[aria-expanded="true"] { color: #0d9488; }
.agri-nav-explora-drop {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
    padding: 6px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, transform .15s, visibility .15s;
    z-index: 1050;
}
.agri-nav-explora-drop.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.agri-nav-explora-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.agri-nav-explora-item:hover {
    background: #f0fdfa;
    color: #0d9488;
    text-decoration: none;
}
.agri-nav-explora-item i {
    width: 18px;
    color: #0d9488;
    font-size: 14px;
    text-align: center;
}
