/* ===== WRAPPER TOP ===== */
/* quando l’header è fixed, spingo giù il contenuto */
body.has-fixed-header{
  padding-top: calc(var(--header-h, 68px) + var(--admin-offset, 0px));
}

/* Barra fissa a tutta larghezza */
.header-bar{
  position: fixed;
  top: var(--admin-offset, 0px);     /* gestito via JS se c'è la admin-bar */
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  background:#fff;
  box-shadow: none;
  transition: box-shadow .18s ease, background-color .18s ease;
}

/* Contenitore interno centrato */
.header-inner{
  max-width: 1200px;          /* larghezza contenuto */
  margin: 0 auto;             /* centro */
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:14px 32px;          /* spazio a destra e sinistra */
}

/* al primo scroll */
.is-scrolled .header-inner{
  padding:10px 32px;
  box-shadow:0 6px 18px rgba(0,0,0,.08);
}

/* Logo */
.header-logo img {
  height: 40px;
  max-height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* ===== MENU DESKTOP ===== */
.header-nav .menu{
  display:flex;
  gap:30px;
  list-style:none;
  margin:0;
  padding:0;
}
.header-nav .menu a{
  text-transform:uppercase;
  font-size:14px;
  letter-spacing:.02em;
  color:#111;
  text-decoration:none;
  line-height:1;
}
.header-nav .menu a:hover{
  color:#d5001c;
}

/* ===== AZIONI DESTRA (desktop) ===== */
.header-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

/* Lente desktop (collapsed) */
.search-toggle{
  background:transparent;
  border:0;
  padding:6px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
}
.header-actions .header-search{
  position:relative;
  width:0;
  overflow:hidden;
  transition:width .22s ease;
}
.header-actions .header-search .search-input{
  width:220px;
  height:34px;
  border:1px solid #ddd;
  border-radius:4px;
  padding:0 10px;
  font-size:14px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.header-actions .header-search.open{
  width:220px;
}
.header-actions .header-search.open .search-input{
  opacity:1;
  pointer-events:auto;
}

/* CTA */
.btn-cta{
  display:inline-block;
  padding:10px 16px;
  background:#e3071b;
  color:#fff;
  text-decoration:none;
  font-weight:700;
  text-transform:uppercase;
  font-size:13px;
  line-height:1;
  white-space:nowrap;
  border-radius:2px;
}
.btn-cta:hover{
  filter:brightness(0.92);
}

/* Dropdown Brand desktop */
.brands-desktop{
  position:relative;
}
.brands-toggle{
   border:1px solid #ddd;
   padding:8px 12px;
   font-size:13px;
   cursor:pointer;
   line-height:1;
   border-radius:2px;
}
.brands-toggle .chev{
  margin-left:6px;
}
.brands-menu{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:260px;
  background:#fff;
  border:1px solid #e5e5e5;
  box-shadow:0 10px 24px rgba(0,0,0,.08);
  list-style:none;
  margin:0;
  padding:8px 0;
  display:none;
  z-index:1003;
}
.brands-desktop.open .brands-menu{
  display:block;
}
.brands-menu li a{
  display:block;
  padding:10px 14px;
  color:#111;
  text-decoration:none;
  font-size:14px;
}
.brands-menu li a:hover{
  background:#f6f6f6;
}

/* Hamburger */
.hamburger{
  display:none;
  flex-direction:column;
  gap:4px;
  background:none;
  border:0;
}
.hamburger span{
  display:block;
  width:24px;
  height:2px;
  background:#111;
}

/* ====== BASE: nascondi sidebar/overlay su desktop ====== */
.mobile-sidebar{ 
  display:none;
}
.mobile-overlay{ 
  display:none;
}

/* ===== MOBILE ===== */
@media (max-width: 991px){
  /* Container: un po' meno padding sui lati in mobile */
  .header-inner{
    padding: 10px 16px;
  }
  .is-scrolled .header-inner{
    padding: 8px 16px;
  }

  /* Nella top-bar si vedono solo logo + hamburger */
  .header-nav{ display:none; }
  .header-actions{ display:none; }
  .hamburger{ display:flex; }

  /* Sidebar mobile */
  .mobile-sidebar{
    display:block;
    position:fixed;
    inset:0 0 0 auto;
    width:80%;
    max-width:340px;
    background:#121212;
    color:#fff;
    transform:translateX(100%);
    transition:transform .28s ease;
    padding:22px;
    z-index:1002;
    overflow-y:auto;
    box-shadow:-6px 0 18px rgba(0,0,0,.24);
  }
  .mobile-sidebar.active{
    transform:translateX(0);
  }

  .mobile-overlay{
    display:block;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    opacity:0;
    visibility:hidden;
    transition:opacity .28s ease, visibility .28s ease;
    z-index:1001;
  }
  .mobile-overlay.active{
    opacity:1;
    visibility:visible;
  }

  /* Ricerca mobile */
  .mobile-search-row{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:14px;
  }
  .mobile-search-row button{
    background:transparent;
    border:1px solid rgba(255,255,255,.3);
    padding:8px;
    border-radius:4px;
  }
  .mobile-search-row input{
    flex:1;
    height:40px;
    border:1px solid rgba(255,255,255,.25);
    background:#1b1b1b;
    color:#fff;
    border-radius:4px;
    padding:0 12px;
    font-size:15px;
  }

  /* Lista voci mobile */
  .mobile-menu-list{
    list-style:none;
    margin:10px 0 18px;
    padding:0;
  }
  .mobile-menu-list li{
    border-bottom:1px solid rgba(255,255,255,.12);
  }
  .mobile-menu-list a{
    display:block;
    padding:14px 0;
    color:#fff;
    text-decoration:none;
    text-transform:uppercase;
  }
  .mobile-menu-list a:hover{
    text-decoration:underline;
  }

  .btn-cta.mobile{
    width:100%;
    text-align:center;
    margin:10px 0 16px;
  }

  /* Brand – accordion */
  .mobile-brands{
    margin-top:6px;
  }
  .mobile-brands-title{
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-weight:700;
    text-transform:uppercase;
    font-size:13px;
    margin:10px 0 6px;
    opacity:.9;
    cursor:pointer;
    user-select:none;
  }
  .mobile-brands-title .chev{
    margin-left:6px;
    transition:transform .2s ease;
  }
  .mobile-brands:not(.open) ul{
    display:none;
  }
  .mobile-brands.open .mobile-brands-title .chev{
    transform:rotate(180deg);
  }
  .mobile-brands ul{
    list-style:none;
    padding:0;
    margin:0;
  }
  .mobile-brands li a{
    display:block;
    color:#fff;
    padding:8px 0;
    text-decoration:none;
  }
  .mobile-brands li a:hover{
    text-decoration:underline;
  }
}
