/* Header Styles (scoped to header components) */
.header {
  --primary-color: #005eb8;
  --primary-dark: #004a94;
  --accent-color: #e57824;
  --accent-hover: #c9651e;
  --success-color: #32936f;
  --background-color: #f5f8fc;
  --card-border: #e1e6f0;
  --text-color: #2c3e50;
  --heading-color: #122b45;
  --font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* Top bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  background-color: #05294c;
  color: #fff;
}

.logo-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Mega Menu Button */
#mm-toggle {
  background: transparent;
  color: #ff8f00; /* Arancione */
  border: none;
 
  border-radius: 0.375rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  font-weight: 500;
}

#mm-toggle:hover {
  color: #c9651e; /* Arancione più scuro */
  border: none;
}

#mm-toggle:active {
  box-shadow: none;
}

#mm-toggle i {
  font-size: 2.5rem;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

#mm-toggle span {
  position: relative;
  z-index: 1;
}

.logo-menu .logo {
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  text-decoration: none;
}

/* Search */
.search-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  max-width: 550px; /* Aumentato da 450px a 550px per renderlo più largo */
}

.search-wrapper form {
  display: flex;
  align-items: center;
  width: 100%;
}

.search-wrapper input {
  flex: 1;
  padding: 0.75rem 0.75rem; /* Aumentato padding verticale da 0.5rem a 0.75rem per altezza maggiore */
  border: none;
  border-radius: 0.25rem 0 0 0.25rem;
  font-size: 1rem; /* Aumentato leggermente da 0.95rem a 1rem */
}

.search-wrapper button,
.mobile-search button {
  background-color: #FF6600;
  border: none;
  color: #fff;
  padding: 0.75rem 0.75rem; /* Aumentato padding per mantenere consistenza con l'input */
  border-radius: 0 0.25rem 0.25rem 0;
  cursor: pointer;
  font-size: 1rem;
}

.search-wrapper button:hover,
.mobile-search button:hover {
  background-color: var(--accent-hover);
}

/* Utility links */
.utility-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem; /* Aumentato gap per migliore spaziatura */
}

.utility-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Aumentato gap tra icona e testo */
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem; /* Leggermente più grande */
  font-weight: 500; /* Testo più definito */
  padding: 0.5rem 0.75rem; /* Padding per area cliccabile più grande */
  border-radius: 0.375rem; /* Bordi arrotondati */
  transition: all 0.3s ease; /* Transizione fluida */
}

.utility-nav a:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.utility-nav a:active {
  box-shadow: none;
}

/* Categories bar */
.categories-nav {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  background-color: var(--primary-dark);
  min-height: 48px; /* unify container height */
  overflow: visible; /* scrolling handled by track */
}

/* Edge masks to hide text under arrows */
.categories-nav::before,
.categories-nav::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5rem; /* slightly wider than arrow */
  pointer-events: none;
  z-index: 1; /* above track, below arrows */
}
.categories-nav::before { left: 0; background: linear-gradient(to right, var(--primary-dark) 60%, rgba(0,0,0,0)); }
.categories-nav::after  { right: 0; background: linear-gradient(to left,  var(--primary-dark) 60%, rgba(0,0,0,0)); }

/* Track: horizontal scroll container */
.categories-nav .categories-track {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 2.25rem; /* space for arrows */
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  scroll-behavior: smooth;
  position: relative; /* below masks */
  z-index: 0;
  scroll-snap-type: x proximity; /* or x mandatory for stricter snap */
  scroll-padding-left: 2.25rem;  /* match left padding (space for left arrow) */
  scroll-padding-right: 2.25rem; /* match right padding (space for right arrow) */
}
.categories-nav .categories-track::-webkit-scrollbar { display: none; }

/* List: inline row of categories */
.categories-nav .categories-track ul {
  display: inline-flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

/* Item links */
.categories-nav .categories-track li {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.categories-nav .categories-track li a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.3rem;
  transition: background-color 0.2s;
  line-height: 1;
}

/* Arrow buttons */
.categories-nav .cat-scroll {
  position: absolute;
  top: 50%;
  margin-top: -18px; /* Metà dell'altezza (36px/2) per centrare */
  background: var(--primary-dark);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2; /* above masks */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.2);
}
.categories-nav .cat-prev { left: 0.5rem; }
.categories-nav .cat-next { right: 0.5rem; }

/* Icon treatment (images) */
.utility-nav img,
.search-wrapper button img,
.categories-nav img {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  filter: invert(1);
}

/* Icon treatment (Bootstrap Icons) */
.utility-nav i,
.search-wrapper button i,
.categories-nav i {
  font-size: 1rem;
  color: #fff;
  line-height: 1;
  display: inline-block;
}

/* Utility nav specific icon improvements */
.utility-nav a i {
  font-size: 1.1rem; /* Icone leggermente più grandi */
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  color: #ff8f00; /* Colore arancione uniforme per tutte le icone */
}

.utility-nav a:hover i {
  color: #fff; /* Bianco al hover */
}

/* Mobile-only search bar below header */
.mobile-search {
  display: none;
  background-color: #05294c;
  padding: 0.5rem 1rem;
}

.mobile-search form {
  display: flex;
  align-items: center;
  gap: 0;
}

.mobile-search input {
  flex: 1;
  padding: 0.75rem 0.75rem; /* Aumentato padding per consistenza */
  border: none;
  border-radius: 0.25rem 0 0 0.25rem;
  font-size: 1rem; /* Aumentato leggermente per consistenza */
}

.breadcrumb {

    font-size: 0.9rem;

}
/* Breadcrumb bar (non-home) */
.breadcrumb-bar {
  background: #ffffff;


}
.breadcrumb-bar .breadcrumb {
  margin: 0;
  padding: 0.5rem 0;
  background: transparent;
}
.breadcrumb-bar .breadcrumb-item + .breadcrumb-item::before {
  color: #ff8f00;
  content: '\203a';
}
.breadcrumb-bar a { color: var(--primary-color); text-decoration: none; }
.breadcrumb-bar a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Responsive */
@media (max-width: 992px) {
  .categories-nav {
    display: none !important;
  }

  .categories-nav.open {
    display: block !important;
  }

  /* show utility next to logo (icons only) */
  .utility-nav {
    display: flex;
    gap: 0.75rem;
  }

  .utility-nav a {
    padding: 0.6rem; /* Padding più grande per mobile */
    border-radius: 50%; /* Forma circolare per mobile */
    justify-content: center;
    min-width: 44px; /* Dimensione minima per accessibilità */
    min-height: 44px;
  }

  .utility-nav span {
    display: none;
  }

  .utility-nav a i {
    font-size: 1.2rem; /* Icone più grandi su mobile */
  }

  /* hide inline search; show mobile search below */
  .search-wrapper {
    display: none;
  }

  .mobile-search {
    display: block;
  }

  /* Mobile keeps previous behavior; arrows hidden */
  .categories-nav .cat-scroll {
    display: none;
  }

  /* Mobile mega menu button adjustments */
  #mm-toggle {
    
    font-size: 0.85rem;
  }

  #mm-toggle i {
    font-size: 2.5rem;
  }

  #mm-toggle span {
    display: none; /* Hide text on mobile */
  }

  /* Mobile logo adjustments */
  .logo img {
    max-height: 35px !important;
  }
}
