/* =====================================================================
   BYITALY 2 - header.css
   Barra annunci | header (logo, ricerca, icone, sandwich) | categorie
   | menu laterale (drawer). Markup: _partials/header.tpl + ff_home.
   ===================================================================== */

/* Solo la riga .ff-head resta fissa in alto; annunci e categorie
   scorrono via. display:contents toglie i contenitori intermedi. */
#header,
.ff-top { display: contents; }

/* ---------------------------------------------------------------------
   1. BARRA ANNUNCI
--------------------------------------------------------------------- */
.ff-ann {
  background: var(--ff-navy-dark);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
}
.ff-ann__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 38px;
}
.ff-ann__left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.ff-ann a,
.ff-ann a:hover { color: #fff; }
.ff-ann__tel { font-weight: 700; white-space: nowrap; }
.ff-ann i { margin-right: 7px; font-size: 0.8em; opacity: 0.85; }
.ff-ann__hours { white-space: nowrap; }
.ff-ann__note { letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.75rem; opacity: 0.9; }

/* ---------------------------------------------------------------------
   2. HEADER FISSO: logo | ricerca | icone
--------------------------------------------------------------------- */
.ff-head {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  border-bottom: 1px solid var(--ff-border);
  box-shadow: var(--ff-shadow-sm);
}
.ff-head__in {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 76px;
}
.ff-head__logo { display: block; line-height: 0; }
.ff-head__logo img { height: 46px; width: auto; max-width: 220px; }

/* Ricerca larga (ps_searchbar) */
.ff-head__search { min-width: 0; }
.ff-head__search #search_widget,
.ff-head__search .search-widgets { width: 100%; max-width: 640px; margin: 0 auto; float: none; }
.ff-head__search #search_widget form { position: relative; display: block; margin: 0; }
.ff-head__search #search_widget input[type="text"] {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 46px;
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  background: var(--ff-bg-soft);
  color: var(--ff-text);
  font-size: 1rem;
  box-shadow: none;
  transition: border-color var(--ff-transition), background var(--ff-transition);
}
.ff-head__search #search_widget input[type="text"]:focus {
  outline: none;
  border-color: var(--ff-navy);
  background: #fff;
}
.ff-head__search #search_widget .material-icons.search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ff-navy);
  font-size: 22px;
  pointer-events: none;
}
.ff-head__search #search_widget .material-icons.clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ff-text-light);
  font-size: 20px;
  cursor: pointer;
}

/* Icone destra */
.ff-head__icons { display: flex; align-items: center; gap: 6px; }
.ff-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ff-navy);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background var(--ff-transition);
}
.ff-ico:hover { background: var(--ff-bg-soft); color: var(--ff-navy); }
.ff-ico i { width: auto; }

/* Carrello (ps_shoppingcart): icona + pallino con il numero */
.ff-cart .blockcart .header { position: relative; display: block; padding: 0; margin: 0; }
.ff-cart .blockcart a,
.ff-cart .blockcart .header > a { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ff-navy); }
.ff-cart .blockcart .header > span:not(.cart-products-count) { display: none; }
.ff-cart .blockcart .material-icons.shopping-cart { font-size: 26px; color: var(--ff-navy); margin: 0; }
.ff-cart .blockcart .cart-products-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--ff-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.ff-cart .blockcart.inactive .cart-products-count { display: none; }

/* ---------------------------------------------------------------------
   3. BARRA CATEGORIE (solo desktop)
--------------------------------------------------------------------- */
.ff-catbar { background: #fff; border-bottom: 1px solid var(--ff-border); }
.ff-catbar__list {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ff-catbar__list li { flex: 1 1 0; min-width: 0; }
.ff-catbar__list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 12px 8px;
  text-align: center;
  color: var(--ff-text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  border-bottom: 2px solid transparent;
  transition: color var(--ff-transition), border-color var(--ff-transition);
}
.ff-catbar__list a i { font-size: 1.25rem; color: var(--ff-navy); width: auto; }
.ff-catbar__list a:hover { color: var(--ff-navy); border-bottom-color: var(--ff-navy); }

/* ---------------------------------------------------------------------
   4. MENU LATERALE (sandwich)
--------------------------------------------------------------------- */
.ff-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(20, 32, 58, 0.5);
}
.ff-drawer-overlay[hidden] { display: none; }
.ff-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  width: min(380px, 88vw);
  height: 100vh;
  height: 100dvh;
  background: #fff;
  box-shadow: -8px 0 32px rgba(20, 32, 58, 0.18);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0s linear 0.28s;
}
.ff-drawer.is-open { transform: none; visibility: visible; transition: transform 0.28s ease; }
.ff-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 14px 22px;
  border-bottom: 1px solid var(--ff-border);
}
.ff-drawer__title { font-size: 1.25rem; font-weight: 700; color: var(--ff-navy); }
.ff-drawer__close {
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ff-navy);
  font-size: 1.25rem; cursor: pointer;
}
.ff-drawer__close:hover { background: var(--ff-bg-soft); }
.ff-drawer__body { flex: 1; overflow-y: auto; padding: 8px 22px 28px; -webkit-overflow-scrolling: touch; }
.ff-drawer__list { margin: 0; padding: 0; list-style: none; }
.ff-drawer__list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--ff-border);
  color: var(--ff-text);
  font-size: 1.0625rem;
  font-weight: 600;
}
.ff-drawer__list a:hover { color: var(--ff-navy); }
.ff-drawer__list a i { width: 22px; text-align: center; color: var(--ff-navy); }
.ff-drawer__section { margin-top: 22px; }
.ff-drawer__label {
  margin: 0 0 4px;
  font-size: var(--ff-fs-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ff-text-light);
}
.ff-drawer__langs { display: flex; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.ff-drawer__langs a {
  display: inline-block;
  min-width: 46px;
  padding: 8px 12px;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius-sm);
  text-align: center;
  font-weight: 700;
  color: var(--ff-navy);
}
.ff-drawer__langs .is-current a { background: var(--ff-navy); border-color: var(--ff-navy); color: #fff; }
.ff-drawer__contact { display: flex; flex-direction: column; gap: 8px; font-weight: 600; color: var(--ff-text); }
.ff-drawer__contact a { color: var(--ff-navy); }
.ff-drawer__contact i { width: 22px; color: var(--ff-navy); }
body.ff-lock { overflow: hidden; }

/* Le categorie nel menu servono solo dove non c'e' la barra */
@media (min-width: 992px) {
  .ff-drawer__section--cats { display: none; }
}

/* ---------------------------------------------------------------------
   5. TABLET / MOBILE
--------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .ff-catbar { display: none; }
  .ff-ann__note { display: none; }
  .ff-ann__help { display: none; }
  .ff-head__in {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo icons" "search search";
    gap: 8px 12px;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 10px;
  }
  .ff-head__logo { grid-area: logo; }
  .ff-head__logo img { height: 38px; }
  .ff-head__icons { grid-area: icons; }
  .ff-head__search { grid-area: search; }
  .ff-head__search #search_widget { max-width: none; }
}
@media (max-width: 575.98px) {
  /* annunci: telefoni e orari su due righe centrate, niente testo tagliato */
  .ff-ann__in { min-height: 34px; padding-top: 4px; padding-bottom: 4px; }
  .ff-ann__left { flex-wrap: wrap; justify-content: center; gap: 2px 16px; }
  .ff-ico--wish { display: none; }
}

/* --- Fix specificita' vs Classic (#header a, #header .logo, Manrope) --- */
.ff-top,.ff-drawer{font-family:var(--ff-font);}
#header .ff-ann a,#header .ff-ann a:hover{color:#fff;}
#header .ff-head__logo img.logo{height:46px;width:auto;max-width:220px;}
#header .ff-catbar__list a{color:var(--ff-text);}
#header .ff-catbar__list a:hover{color:var(--ff-navy);}
#header .ff-ico,#header .ff-ico:hover{color:var(--ff-navy);}
#header .ff-drawer__list a{color:var(--ff-text);}
#header .ff-drawer__contact a,#header .ff-drawer__langs a{color:var(--ff-navy);}
#header .ff-drawer__langs .is-current a{color:#fff;}
@media (max-width:991.98px){#header .ff-head__logo img.logo{height:38px;}}
