/* assets/css/tfa-nav.css */

/* ========== Base helpers ========== */
:root{
  --tfa-border: rgba(0,0,0,.12);
  --tfa-shadow: 0 14px 34px rgba(0,0,0,.14);
  --tfa-radius: 14px;

  /* fallback */
  --tfa-header-fallback: 110px;
  --tfa-announce-fallback: 28px;

  /* ✅ ALTERNATIVA PULITA:
     altezza della riga NAV dove sta "Collection"
     (regola questo valore finché il mega parte appena sotto) */
  --tfa-nav-row-h: 0px;
}

/* blocco scroll quando drawer/search aperti */
html.tfa-lock,
html.tfa-lock body{
  overflow: hidden;
}

/* =====================================================
   FIX HEADER + ANNOUNCE (NO “fixed a tappeto”)
   - Announce fixed in alto
   - Header fixed subito sotto
   - Niente trasparenze/backdrop che creano effetto “vedo sotto”
   ===================================================== */

/* barra announce — fissa in cima */
.mc-announce{
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100020;
}

/* header del tema sotto la announce — scorre con la pagina */
header.nav-wrap{
  position: relative;
  width: 100%;
  margin-top: 25px;
  z-index: 100010;
  overflow: visible;
  isolation: isolate;

  background: #fff;
  opacity: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* se il tema usa overlay/pseudo-elementi sul header */
header.nav-wrap::before,
header.nav-wrap::after{
  background: transparent !important;
  opacity: 1 !important;
}

/* Header non più fixed: nessun compenso necessario */

/* =====================================================
   HERO/SLIDER sotto l’header/mega
   ===================================================== */
.hero,
.slider,
.banner,
.home-slider,
.rev_slider_wrapper,
.elementor-slides,
.swiper,
.swiper-container{
  position: relative;
  z-index: 0;
}

/* ========== Burger (visibile solo mobile/tablet) ========== */
.tfa-burger{
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
  margin-right: 8px;
  cursor: pointer;
  position: relative;
  color: #333;
}

.tfa-burger__lines{
  width: 24px;
  height: 18px;
  position: relative;
  display: block;
}

.tfa-burger__lines > span{
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 0;
  display: block;
  transition: transform .25s ease, opacity .2s ease, top .25s ease, bottom .25s ease;
}

.tfa-burger__lines > span:nth-child(1){ top: 0; }
.tfa-burger__lines > span:nth-child(2){ top: 50%; transform: translateY(-50%); }
.tfa-burger__lines > span:nth-child(3){ bottom: 0; }

/* Animazione X quando il drawer è aperto */
.tfa-burger[aria-expanded="true"] .tfa-burger__lines > span:nth-child(1){
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.tfa-burger[aria-expanded="true"] .tfa-burger__lines > span:nth-child(2){
  opacity: 0;
}
.tfa-burger[aria-expanded="true"] .tfa-burger__lines > span:nth-child(3){
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* =====================================================
   DESKTOP NAV (TFA)
   ===================================================== */
.tfa-nav{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.tfa-nav__list{
  list-style: none;
  margin: 0;
  padding: 0 0 10px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  grid-column: 2;
}

.tfa-nav__list--right{
  grid-column: 3;
  justify-content: flex-end;
  gap: 14px;
}

/* Mega menu: tutti i contenitori tra header e .tfa-mega devono essere static
   così il mega si posiziona rispetto a header.nav-wrap (position:relative) */
.tfa-nav__item{ position: static; }
.header-bottom.grid{ position: static !important; }
nav.tfa-nav{ position: static !important; }
.tfa-nav__list{ position: static !important; }

/* ================================================================
   IMPORTANT: niente “bridge” sul LI
   - altrimenti l’hover scatta anche fuori dal bottone Collection
   ================================================================ */
.tfa-nav__item.has-children::after,
.tfa-nav__item.has-mega::after{
  content: none !important;
}

/* Link / trigger */
.tfa-nav__link{
  appearance: none;
  background: none;
  border: 0;
  padding: 5px 6px 5px;
  margin: 0;
  font: inherit;
  color: #333;
  text-transform: none;
  letter-spacing: .02em;
  font-weight: 300;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.tfa-nav__link:hover,
.tfa-nav__trigger:hover{
  color: #333;
}

/* niente freccia TFA */
.tfa-nav__chev{ display: none !important; }

/* niente caret del tema */
header.nav-wrap nav a[data-toggle="dropdown"]::after,
header.nav-wrap nav .dropdown-toggle::after{
  content: none !important;
  display: none !important;
}

header.nav-wrap .tfa-nav__item.has-children > .tfa-nav__trigger::before{
  content: none !important;
  display: none !important;
}

/* UNDERLINE */
.tfa-nav__link,
.tfa-nav__trigger{
  position: relative;
  display: inline-block;
}

.tfa-nav__link::after,
.tfa-nav__trigger::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-6px;
  width:100%;
  height:2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s ease;
  opacity: .95;
  pointer-events: none;
}

.tfa-nav__item:hover > .tfa-nav__link::after,
.tfa-nav__item:hover > .tfa-nav__trigger::after{
  transform: scaleX(1);
}

/* =====================================================
   MEGA MENU DESKTOP
   ===================================================== */
.tfa-mega{
  position: fixed;
  left: 0;
  right: 0;
  width: 100vw;

  top: var(--tfa-mega-top, 300px);

  height: auto;

  max-height: calc(100vh - var(--tfa-mega-top, 300px) - 10px);

  overflow: auto;

  background: #fff;
  border-top: 1px solid var(--tfa-border);
  box-shadow: none;
  padding: 34px 60px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);

  transition:
    opacity .6s cubic-bezier(.22,.61,.36,1),
    transform .45s cubic-bezier(.22,.61,.36,1),
    visibility 0s linear .6s;

  z-index: 100050;
}

/* micro-ponte SOLO sul pannello (anti sfarfallio trigger->pannello) */
.tfa-mega::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-12px;
  height:12px;
  background:transparent;
}

/* =====================================================
   APERTURA SOLO SU TRIGGER (Collection)
   ===================================================== */
@supports selector(:has(*)){

  .tfa-nav__item:has(> .tfa-nav__trigger:hover) > .tfa-mega,
  .tfa-nav__item:has(> .tfa-nav__trigger:focus) > .tfa-mega{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
      opacity .6s cubic-bezier(.22,.61,.36,1),
      transform .45s cubic-bezier(.22,.61,.36,1),
      visibility 0s;
  }

  .tfa-nav__item:has(> .tfa-mega:hover) > .tfa-mega,
  .tfa-nav__item:has(> .tfa-mega:focus-within) > .tfa-mega{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
      opacity .6s cubic-bezier(.22,.61,.36,1),
      transform .45s cubic-bezier(.22,.61,.36,1),
      visibility 0s;
  }
}


/* =====================================================
   Mega grid
   ===================================================== */
.tfa-mega__grid{
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 28px;
  align-items: start;
}

.tfa-mega__heading{
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #111;
  margin-bottom: 10px;
}

.tfa-mega__list{
  list-style: none;
  margin: 0;
  padding: 0;
  display:flex;
  flex-direction: column;
  gap: 0;
}

.tfa-mega__a{
  color: #333;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .02em;
}

.tfa-mega__a:hover{
  color: #497e60;
  text-decoration: underline;
}

/* =====================================================
   DRAWER MOBILE (fullscreen)
   ===================================================== */
.tfa-drawer{
  position: fixed;
  inset: 0;
  z-index: 200000; /* sopra header (100010) e announce (100020) */

  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity .25s ease, visibility .25s ease;
}

.tfa-drawer.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tfa-drawer__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.42);
  z-index: 0;
}

.tfa-drawer__panel{
  position: absolute;
  inset: 0 auto 0 0;            /* ancorato al bordo SINISTRO */
  width: min(86vw, 400px);      /* pannello parziale, non fullscreen */
  height: 100%;
  background: #fff;
  z-index: 1; /* sopra al backdrop */

  transform: translateX(-100%); /* fuori schermo a sinistra */
  opacity: 1;

  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.18);
}

.tfa-drawer.is-open .tfa-drawer__panel{
  transform: translateX(0);     /* entra da sinistra */
  opacity: 1;
}

.tfa-drawer__close{
  border: 0;
  background: none;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 18px 18px;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,.12);
}

.tfa-drawer__list{
  list-style: none;
  margin: 0;
  padding: 9px 9px 9px;
}

.tfa-drawer__list > li{
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding: 0;

  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s ease, transform .35s ease;
  transition-delay: calc(var(--i, 0) * 45ms + 120ms);
}

.tfa-drawer.is-anim .tfa-drawer__list > li{
  opacity: 1;
  transform: translateY(0);
}

.tfa-drawer__list > li > a,
.tfa-drawer__list .tfa-acc__btn{
  display: block;
  padding: 2px 0;
  text-transform: none;
  letter-spacing: .02em;
  font-weight: 300;
  color: #111;
  text-decoration: none;
}

.tfa-drawer__list > li > a:hover,
.tfa-drawer__list .tfa-acc__btn:hover{
  color: #497e60;
}

.tfa-acc__btn{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  border: 0;
  background: none;
  cursor:pointer;
  font: inherit;
}

.tfa-acc__chev{
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .7;
}

.tfa-drawer__list .sub-menu{
  list-style: none;
  margin: 0;
  padding: 0 0 14px 12px;
  display: none;
}

.tfa-drawer__list li.is-open > .sub-menu{
  display: block;
}

.tfa-drawer__list .sub-menu a{
  display: block;
  padding: 2px 0;
  text-transform: none;
  letter-spacing: .02em;
  font-weight: 300;
  color: #333;
  text-decoration: none;
  font-size: 13px;
}

.tfa-drawer__list .sub-menu a:hover{
  color: #E05039;
}

/* Disattiva overlay mobile su desktop */
@media (min-width: 1024px){
  .tfa-drawer-overlay,
  .tfa-nav-overlay,
  .menu-overlay,
  .drawer-overlay {
    display: none !important;
    pointer-events: none !important;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .tfa-drawer,
  .tfa-drawer__panel,
  .tfa-drawer__list > li,
  .tfa-mega,
  .tfa-mega-overlay{
    transition: none !important;
    transform: none !important;
  }
  .tfa-drawer__list > li{ opacity: 1 !important; }
}

/* ========== Responsive toggles ========== */
@media (max-width: 1023px){
  .tfa-burger{ display: inline-flex; align-items:center; justify-content:center; }
  .header-bottom{ display: none !important; }
  .tfa-mega,
  .tfa-mega[hidden]{ display: none !important; visibility: hidden !important; }
  .tfa-mega-overlay{ display: none !important; }

  /* NB: l'accordion del drawer è ATTIVO su mobile.
     Lo stile completo è nella sezione "DRAWER MOBILE — accordion" in fondo al file. */
}

@media (min-width: 1024px){
  .tfa-drawer{ display: none; }
}

/* Neutralizza vecchi dropdown legacy del tema (non TFA) */
header.nav-wrap nav.nav-container ul.primary > li.dropdown > ul.sub-menu,
header.nav-wrap nav.nav-container ul.primary > li.dropdown > ul.dropdown-menu,
header.nav-wrap nav.nav-container ul.primary > li.dropdown > .dropdown-menu,
header.nav-wrap nav.nav-container ul.primary > li.dropdown > .dropdown-content{
  position: static !important;
  display: none !important;
  pointer-events: none !important;
}

/* =====================================================
   Animazioni interne (ok lasciarle)
   ===================================================== */
@keyframes tfaFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tfa-nav__item.is-open > .tfa-mega .tfa-mega__col{
  animation: tfaFadeUp .75s cubic-bezier(.22,.61,.36,1) both;
}

.tfa-nav__item.is-open > .tfa-mega .tfa-mega__col:nth-child(1){ animation-delay: 80ms; }
.tfa-nav__item.is-open > .tfa-mega .tfa-mega__col:nth-child(2){ animation-delay: 140ms; }
.tfa-nav__item.is-open > .tfa-mega .tfa-mega__col:nth-child(3){ animation-delay: 200ms; }
.tfa-nav__item.is-open > .tfa-mega .tfa-mega__col:nth-child(4){ animation-delay: 260ms; }

.tfa-nav__item.is-open > .tfa-mega .tfa-mega__li{
  animation: tfaFadeUp .65s cubic-bezier(.22,.61,.36,1) both;
}

@media (prefers-reduced-motion: reduce){
  .tfa-nav__item.is-open > .tfa-mega .tfa-mega__col,
  .tfa-nav__item.is-open > .tfa-mega .tfa-mega__li{
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* FIX hidden — solo desktop: su mobile il [hidden] nasconde normalmente */
@media (min-width: 1024px){
  .tfa-mega[hidden]{
    display: block !important;
  }
}



/* pointer-events solo dove serve, senza forzare position su tutto */
header.nav-wrap,
header.nav-wrap .header-top,
header.nav-wrap .header-bottom,
header.nav-wrap .tfa-nav,
header.nav-wrap .tfa-nav__item,
header.nav-wrap .tfa-nav__trigger,
header.nav-wrap .tfa-nav__link{
  pointer-events: auto !important;
}


/* =====================================
   HEADER LOCK (anti shrink)
   ===================================== */

header.nav-wrap{
  height: var(--tfa-header-lock-h, auto);
  min-height: var(--tfa-header-lock-h, auto);
  transition: none !important;
}

@media (min-width:1024px){
  header.nav-wrap{
    min-height: 0 !important;
    height: auto !important;
  }
}


.tfa-nav__link,
.tfa-nav__trigger{
  position: relative;
  display: inline-block;
}

.tfa-nav__link::after,
.tfa-nav__trigger::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-6px;
  width:100%;
  height:2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s ease;
  opacity: .95;
  pointer-events: none;
}

.tfa-nav__item:hover > .tfa-nav__link::after,
.tfa-nav__item:hover > .tfa-nav__trigger::after{
  transform: scaleX(1);
}


/* base: chiuso */
.tfa-mega{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
}

/* aperto: quando JS mette .is-open sul LI */
.tfa-nav__item.is-open > .tfa-mega{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}


/* =====================================================================
   DRAWER MOBILE — accordion multi-livello + link utility + social
   Comportamento ispirato ai menu off-canvas, con font (Jost) e
   colore accento TFA (#E05039). Attivo solo su mobile/tablet.
   ===================================================================== */
@media (max-width: 1023px){

  /* ---- Barra superiore: brand "∞ FINE ART ∞" a sinistra, X a destra ---- */
  .tfa-drawer__bar{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 12px 18px;
    border-bottom: 1px solid var(--tfa-border);
    flex: 0 0 auto;
  }
  .tfa-drawer__brand{
    display: inline-flex;
    align-items: center;
    line-height: 0;
  }
  .tfa-drawer__brand img{
    height: 16px;
    width: auto;
    display: block;
  }
  .tfa-drawer__close{
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-bottom: 0;              /* annulla il vecchio stile testuale */
    background: none;
    cursor: pointer;
    color: #222;
  }
  .tfa-drawer__close-x{
    position: relative;
    width: 20px;
    height: 20px;
    display: block;
  }
  .tfa-drawer__close-x::before,
  .tfa-drawer__close-x::after{
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
  }
  .tfa-drawer__close-x::before{ transform: rotate(45deg); }
  .tfa-drawer__close-x::after{ transform: rotate(-45deg); }
  .tfa-drawer__close:hover{ color: #E05039; }

  /* ---- Lista primaria ---- */
  .tfa-drawer__list{
    padding: 6px 18px;
  }
  .tfa-drawer__list > li{
    border-bottom: 1px solid rgba(0,0,0,.08);
  }
  /* niente riga sotto l'ultima voce dell'accordion (es. "Featured") */
  .tfa-drawer__list:not(.tfa-drawer__list--secondary) > li:last-child{
    border-bottom: 0;
  }

  /* Voce con figli: link a sinistra + freccia a destra, sotto-livello sotto */
  .tfa-drawer__list .menu-item-has-children{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .tfa-drawer__list .menu-item-has-children > a{
    flex: 1 1 auto;
    min-width: 0;
  }
  .tfa-drawer__list .menu-item-has-children > .sub-menu{
    flex: 0 0 100%;
  }

  /* Tipografia voci */
  .tfa-drawer__list > li > a{
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 17px;
    letter-spacing: .02em;
    color: #222;
    padding: 4px 0;
  }
  .tfa-drawer__list .sub-menu a{
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: #555;
    padding: 3px 0;
  }
  .tfa-drawer__list a:hover{ color: #E05039; }

  /* ---- Freccia toggle (solo chevron, niente testo duplicato) ---- */
  .tfa-drawer .tfa-acc__btn{
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #333;
    cursor: pointer;
  }
  .tfa-drawer .tfa-acc__chev{
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);               /* chiuso: punta in basso */
    transition: transform .25s ease;
    opacity: .8;
  }
  .tfa-drawer .menu-item-has-children.is-open > .tfa-acc__btn .tfa-acc__chev{
    transform: rotate(-135deg);             /* aperto: punta in alto */
  }
  .tfa-drawer .tfa-acc__btn:hover{ color: #E05039; }

  /* ---- Sotto-livelli: chiusi di default, indentati ---- */
  .tfa-drawer__list .sub-menu{
    display: none;
    padding: 0 0 8px 14px;
    margin: 0;
    list-style: none;
  }
  .tfa-drawer__list li.is-open > .sub-menu{
    display: block;
  }

  /* Livello 2 (voci con figli dentro un sub-menu): freccia nel cerchietto */
  .tfa-drawer__list .sub-menu .menu-item-has-children > .tfa-acc__btn{
    width: 32px;
    height: 32px;
    border: 1px solid var(--tfa-border);
    border-radius: 50%;
  }
  .tfa-drawer__list .sub-menu .menu-item-has-children > .tfa-acc__btn .tfa-acc__chev{
    width: 7px;
    height: 7px;
  }

  /* ---- Lista secondaria (utility) su 2 colonne ---- */
  .tfa-drawer__list--secondary{
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
    row-gap: 0;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--tfa-border);
  }
  .tfa-drawer__list--secondary > li{
    border-bottom: 0;
  }
  .tfa-drawer__list--secondary > li > a{
    font-size: 15px;
    padding: 10px 0;
    color: #444;
  }

  /* ---- Titolo "Seguici sui social" + social in fondo al drawer ---- */
  .tfa-drawer__social-label{
    display: block;
    margin: auto 18px 8px;        /* auto: spinge il gruppo (titolo+icone) in fondo */
    padding-top: 18px;
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: .04em;
    color: #777;
  }
  .tfa-drawer__social{
    display: flex;
    gap: 10px;
    margin: 0 18px 22px;          /* l'auto-top ora è sul titolo qui sopra */
    padding-top: 0;
    flex: 0 0 auto;
  }
  .tfa-drawer__social-item{
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tfa-border);
    border-radius: 8px;
    color: #333;
    font-size: 18px;
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease;
  }
  .tfa-drawer__social-item svg{
    width: 17px;
    height: 17px;
    fill: currentColor;
  }
  .tfa-drawer__social-item:hover{
    color: #E05039;
    border-color: #E05039;
  }
}