header {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid rgba(18, 18, 18, 0.1);
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.header-container {
  position: relative;
  max-width: 1240px;
  min-height: 84px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-width: 0;
}

.header-group:first-child {
  display: none;
}

.header-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 0;
  height: 100%;
}

/* =======================
   MENU BUTTON
   ======================= */

.header-section-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #121212;
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.header-section-menu:hover {
  background: rgba(18, 18, 18, 0.06);
  transform: translateY(-1px);
}

.header-section-menu ion-icon {
  font-size: 1.4rem;
  color: currentColor;
}

/* =======================
   LOGO
   ======================= */

.header-section-img {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-section-img a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.header-section-img img {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 28px;
}

/* =======================
   NAV DESKTOP
   ======================= */

.header-section-list ol {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 0;
  padding: 0;
}

.header-section-list ol li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-section-list a {
  text-decoration: none;
  color: #333333;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.header-section-list li:hover a {
  color: #121212;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* =======================
   ACTION ICONS
   ======================= */

.header-section > ol {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.header-section > ol li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-section > ol {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.header-section > ol li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon-button,
.header-section > ol li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #121212;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.header-icon-button:hover,
.header-section > ol li > a:hover {
  background: rgba(18, 18, 18, 0.06);
  transform: translateY(-1px);
}

.header-icon-button ion-icon,
.header-section > ol li > a ion-icon {
  font-size: 1.22rem;
  color: currentColor;
}

.header-cart-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 999px;
  background: #f8f8f8;
  border: 1px solid rgba(18, 18, 18, 0.08);
  color: #121212;
  text-decoration: none;
  cursor: pointer;
  /* box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9); */
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.header-cart-button:hover {
  transform: translateY(-1px);
  background: #fcfcfc;
  border-color: rgba(18, 18, 18, 0.14);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.header-cart-button ion-icon {
  font-size: 1.28rem;
  color: #121212;
}

/* =======================
   VALUTA
   ======================= */

.header-section-currency {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.header-section-currency form {
  margin: 0;
}

.header-section-currency select {
  min-height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #121212;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background 0.18s ease;
}

.header-section-currency select:hover,
.header-section-currency select:focus {
  background: rgba(18, 18, 18, 0.05);
}

/* =======================
   LINGUA
   ======================= */

.header-section-language {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.lang-flag {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
  flex-shrink: 0;
}

.lang-flag.lang-it {
  background-image: url('/assets/imgs/lang/Italia.png');
}

.lang-flag.lang-en {
  background-image: url('/assets/imgs/lang/RegnoUnito.png');
}

.lang-flag.lang-zh {
  background-image: url('/assets/imgs/lang/Cina.png');
}

.header-lang-select {
  position: relative;
}

.header-lang-select button {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  box-shadow: none;
  text-shadow: none;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
  margin: 0;
  cursor: pointer;
}

.header-lang-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1;
  transition: background 0.18s ease;
}

.header-lang-trigger:hover {
  background: rgba(0, 0, 0, 0.04);
}

.header-lang-trigger-left {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.header-lang-text {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.header-lang-arrow {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-style: solid;
  border-width: 0 1.5px 1.5px 0;
  border-color: currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.header-lang-select.is-open .header-lang-arrow {
  transform: rotate(-135deg);
}

.header-lang-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: #ffffff;
  border: 1px solid rgba(18, 18, 18, 0.1);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  display: none;
  z-index: 2000;
  overflow: hidden;
}

.header-lang-select.is-open .header-lang-options {
  display: block;
}

.header-lang-option {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  box-sizing: border-box;
  line-height: 1.1;
  color: #121212;
}

.header-lang-option + .header-lang-option {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.header-lang-option-text {
  flex: 1;
}

.header-lang-option:hover {
  background: #f2f2f2;
}

.header-lang-option.is-active {
  background: #000000;
  color: #ffffff;
}

.header-lang-option.is-active .header-lang-option-text {
  font-weight: 600;
}

.header-lang-select.is-open .lang-flag {
  border-color: #111111;
}

/* =======================
   CART BADGE
   ======================= */

.header-section-icon-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  background-color: transparent !important;
}

.header-section-icon-cart::after {
  content: attr(data-count);
  position: absolute;
  top: -5px;
  right: -12px;
  min-width: 10px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  /* border: 2px solid #ffffff; */
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
}

.header-section-icon-cart[data-count]:not([data-count=""]):not([data-count="0"])::after {
  display: inline-flex;
}

/* =======================
   RESPONSIVE <= 1200
   ======================= */

@media (max-width: 1200px) {
  .header-container {
    padding: 0 18px;
  }

  .header-group:first-child {
    display: flex;
  }

  .header-group:nth-child(2) {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 50vw;
  }

  .header-group:nth-child(2) .header-section-list {
    display: none;
  }

  .header-group:nth-child(3) .header-section:first-child {
    display: none;
  }

  .header-section-img img {
    max-width: 190px;
    max-height: 26px;
  }
}

/* =======================
   RESPONSIVE <= 750
   ======================= */

@media (max-width: 750px) {
  .header-container {
    min-height: 76px;
    padding: 0 14px;
    gap: 12px;
  }

  .header-group {
    gap: 12px;
  }

  .header-section {
    gap: 10px;
  }

  .header-group:nth-child(2) {
    max-width: 54vw;
  }

  .header-section-img img {
    max-width: 170px;
    max-height: 24px;
  }

  .header-section-menu,
  .header-icon-button,
  .header-section > ol li > a,
  .header-cart-button {
    width: 38px;
    height: 38px;
  }

  .header-section > ol {
    gap: 4px;
  }

  .header-section-icon-cart::after {
    top: -5px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 2px;
    font-size: 10px;
  }

  .header-lang-text {
    font-size: 12px;
  }
}

/* =======================
   RESPONSIVE <= 560
   ======================= */

@media (max-width: 560px) {
  .header-container {
    padding: 0 12px;
  }

  .header-group:nth-child(2) {
    max-width: 48vw;
  }

  .header-section-img img {
    max-width: 150px;
    max-height: 22px;
  }
}