/**
 * Header condiviso Hathost / HatLink.
 * Stessa struttura, dimensioni, bottoni e stato attivo.
 * Cambia solo la palette via .site-header--hatlink
 */

.pay-sandbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.25rem;
  background: #1c1917;
  color: #fde68a;
  border-bottom: 3px solid #f59e0b;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.84rem;
  line-height: 1.35;
}

.pay-sandbox-bar p { margin: 0; }

.pay-sandbox-bar a,
.pay-sandbox-link {
  flex-shrink: 0;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, #fff 55%, transparent);
}

.pay-sandbox-bar a:hover,
.pay-sandbox-link:hover { border-bottom-color: #fff; }

.pay-sandbox-link {
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 700;
}

.maint-admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.25rem;
  background: #ff002b;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.84rem;
  line-height: 1.35;
}

.maint-admin-bar p {
  margin: 0;
}

.maint-admin-bar a {
  flex-shrink: 0;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, #fff 55%, transparent);
}

.maint-admin-bar a:hover {
  border-bottom-color: #fff;
}

.site-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.site-topbar {
  background: var(--inverse, #0a0a0a);
  color: color-mix(in srgb, var(--inverse-fg, #f5f5f7) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--inverse-fg, #f5f5f7) 10%, transparent);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  line-height: 1.2;
  min-height: var(--topbar-h, 2.25rem);
}

.site-topbar-inner {
  max-width: var(--hdr-max, 72rem);
  margin-inline: auto;
  padding: 0.35rem 1.25rem;
  min-height: var(--topbar-h, 2.25rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-topbar-date {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.25rem 0.55rem;
  border: 1px solid color-mix(in srgb, white 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, white 6%, transparent);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: color-mix(in srgb, white 12%, transparent);
  border-color: color-mix(in srgb, white 28%, transparent);
}

.theme-toggle:focus-visible {
  outline: 2px solid #ff002b;
  outline-offset: 2px;
}

.theme-toggle-icon {
  display: none;
  flex-shrink: 0;
}

html[data-theme="light"] .theme-toggle-icon--moon,
html:not([data-theme]) .theme-toggle-icon--moon {
  display: block;
}

html[data-theme="dark"] .theme-toggle-icon--sun {
  display: block;
}

.theme-toggle-label {
  display: none;
}

@media (min-width: 480px) {
  .theme-toggle-label { display: inline; }
}

.site-header {
  --hdr-fg: #0a0a0a;
  --hdr-fg-muted: #0a0a0a;
  --hdr-accent: #ff002b;
  --hdr-accent-deep: #d90024;
  --hdr-bg: color-mix(in srgb, #f6f6f6 82%, transparent);
  --hdr-bg-scrolled: color-mix(in srgb, #ffffff 90%, transparent);
  --hdr-line: color-mix(in srgb, #0a0a0a 10%, transparent);
  --hdr-ghost-border: color-mix(in srgb, #0a0a0a 10%, transparent);
  --hdr-ghost-fg: #0a0a0a;
  --hdr-toggle-bg: #ffffff;
  --hdr-toggle-bar: #0a0a0a;
  --hdr-mobile-bg: #ffffff;
  --hdr-shadow-scrolled: 0 8px 30px color-mix(in srgb, #0a0a0a 6%, transparent);
  --hdr-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hdr-max: 72rem;
  --hdr-h: 4.5rem;
  --hdr-radius: 0.25rem;

  position: relative;
  z-index: 1;
  width: 100%;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: var(--hdr-bg);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s var(--hdr-ease),
    background 0.3s var(--hdr-ease),
    box-shadow 0.3s var(--hdr-ease);
  font-family: "Plus Jakarta Sans", sans-serif;
}

html[data-theme="dark"] .site-header:not(.site-header--hatlink) {
  --hdr-fg: #f5f5f7;
  --hdr-fg-muted: rgba(245, 245, 247, 0.86);
  --hdr-bg: color-mix(in srgb, #141416 88%, transparent);
  --hdr-bg-scrolled: color-mix(in srgb, #0b0b0c 94%, transparent);
  --hdr-line: color-mix(in srgb, white 12%, transparent);
  --hdr-ghost-border: color-mix(in srgb, white 22%, transparent);
  --hdr-ghost-fg: rgba(245, 245, 247, 0.95);
  --hdr-toggle-bg: color-mix(in srgb, white 6%, transparent);
  --hdr-toggle-bar: #f5f5f7;
  --hdr-mobile-bg: #141416;
  --hdr-shadow-scrolled: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.site-chrome.is-scrolled .site-header {
  border-bottom-color: var(--hdr-line);
  background: var(--hdr-bg-scrolled);
  box-shadow: var(--hdr-shadow-scrolled);
}

.site-header.is-scrolled {
  border-bottom-color: var(--hdr-line);
  background: var(--hdr-bg-scrolled);
  box-shadow: var(--hdr-shadow-scrolled);
}

/* Tema scuro HatLink — solo colori */
.site-header--hatlink {
  --hdr-fg: #ffffff;
  --hdr-fg-muted: rgba(245, 245, 247, 0.86);
  --hdr-accent: #ff002b;
  --hdr-accent-deep: #d90024;
  --hdr-bg: rgba(0, 0, 0, 0.55);
  --hdr-bg-scrolled: rgba(0, 0, 0, 0.9);
  --hdr-line: rgba(255, 255, 255, 0.12);
  --hdr-ghost-border: rgba(255, 255, 255, 0.28);
  --hdr-ghost-fg: rgba(245, 245, 247, 0.95);
  --hdr-toggle-bg: rgba(255, 255, 255, 0.04);
  --hdr-toggle-bar: #f5f5f7;
  --hdr-mobile-bg: rgba(8, 8, 8, 0.96);
  --hdr-shadow-scrolled: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.site-chrome:has(.site-header--hatlink) {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1000;
}

.site-chrome:has(.site-header--hatlink) .site-topbar {
  background: rgba(0, 0, 0, 0.72);
}

.site-header .header-inner {
  max-width: var(--hdr-max);
  margin-inline: auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--hdr-h);
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header .brand img {
  height: 2.85rem;
  width: auto;
  display: block;
}

.site-header .nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
  margin-inline-start: auto;
}

.site-header .nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--hdr-fg-muted);
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--hdr-ease), border-color 0.2s var(--hdr-ease);
}

.site-header .nav a:hover {
  color: var(--hdr-accent);
}

.site-header .nav a[aria-current="page"] {
  color: var(--hdr-accent);
  border-bottom-color: var(--hdr-accent);
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-inline-start: auto;
}

.site-header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0 1.2rem;
  border-radius: var(--hdr-radius);
  border: 1px solid transparent;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s var(--hdr-ease),
    background 0.2s var(--hdr-ease),
    border-color 0.2s var(--hdr-ease),
    color 0.2s var(--hdr-ease);
}

.site-header .btn:active {
  transform: translateY(1px);
}

.site-header .btn-primary {
  background: var(--hdr-accent);
  color: #fff;
}

.site-header .btn-primary:hover {
  background: var(--hdr-accent-deep);
  color: #fff;
}

.site-header .btn-ghost {
  background: transparent;
  border-color: var(--hdr-ghost-border);
  color: var(--hdr-ghost-fg);
}

.site-header .btn-ghost:hover {
  border-color: color-mix(in srgb, var(--hdr-ghost-fg) 55%, transparent);
  color: var(--hdr-fg);
}

.site-header .nav-toggle {
  display: inline-grid;
  gap: 6px;
  width: 2.5rem;
  height: 2.5rem;
  place-content: center;
  border: 1px solid var(--hdr-line);
  border-radius: var(--hdr-radius);
  background: var(--hdr-toggle-bg);
  cursor: pointer;
  padding: 0;
}

.site-header .nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--hdr-toggle-bar);
  transition: transform 0.25s var(--hdr-ease);
}

.site-header .nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.site-header .nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.site-header .mobile-nav {
  display: grid;
  gap: 0.25rem;
  padding: 0.5rem 1.25rem 1.25rem;
  border-top: 1px solid var(--hdr-line);
  background: var(--hdr-mobile-bg);
}

.site-header .mobile-nav[hidden] {
  display: none;
}

.site-header .mobile-nav a {
  text-decoration: none;
  padding: 0.85rem 0.35rem;
  font-weight: 500;
  color: var(--hdr-fg);
  border-bottom: 1px solid var(--hdr-line);
}

.site-header .mobile-nav a[aria-current="page"] {
  color: var(--hdr-accent);
}

.site-header .mobile-nav .btn {
  margin-top: 0.75rem;
  justify-content: center;
  border-bottom: 0;
}

@media (max-width: 899px) {
  .site-header .header-actions .btn-ghost {
    display: none;
  }
}

/* Telefoni stretti: logo, carrello, CTA e menu devono stare in 375px senza scroll orizzontale */
@media (max-width: 420px) {
  .site-header .header-inner {
    gap: 0.6rem;
    padding-inline: 1rem;
  }
  .site-header .brand img {
    height: 2.2rem;
  }
  .site-header .header-actions {
    gap: 0.4rem;
  }
  .site-header .header-actions .btn {
    padding: 0 0.8rem;
    font-size: 0.85rem;
  }
}

@media (min-width: 900px) {
  .site-header .nav {
    display: flex;
  }

  .site-header .nav-toggle,
  .site-header .mobile-nav {
    display: none !important;
  }

  .site-header .header-actions {
    margin-inline-start: 0;
  }
}

/* Footer HatLink (pagina senza style.css completo) */
.theme-hatlink .site-footer {
  background: #000;
  color: rgba(255, 255, 255, 0.7);
  padding: 3.5rem 1.25rem 2rem;
  margin-top: 0;
  border-top: 1px solid #1a1a1a;
  position: relative;
  z-index: 20;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.theme-hatlink .footer-grid {
  max-width: 72rem;
  margin-inline: auto;
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .theme-hatlink .footer-grid {
    grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  }
}

.theme-hatlink .footer-brand img {
  height: 2.6rem;
  width: auto;
  margin-bottom: 0.85rem;
  filter: brightness(0) invert(1);
}

.theme-hatlink .footer-brand p {
  max-width: 28ch;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.5;
}

.theme-hatlink .site-footer h2 {
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff002b;
  margin: 0 0 1rem;
}

.theme-hatlink .site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.theme-hatlink .site-footer a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
}

.theme-hatlink .site-footer a:hover {
  color: #fff;
}

.theme-hatlink .footer-legal {
  max-width: 72rem;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.theme-hatlink .footer-legal p {
  margin: 0;
  max-width: 52rem;
}

.theme-hatlink .footer-legal-block {
  display: grid;
  gap: 0.45rem;
  max-width: 52rem;
}

.theme-hatlink .footer-legal-extra {
  color: rgba(255, 255, 255, 0.38);
}

.header-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--hdr-radius, 0.25rem);
  border: 1px solid var(--hdr-ghost-border);
  color: var(--hdr-fg);
  text-decoration: none;
  background: transparent;
  transition: color 0.15s var(--hdr-ease), border-color 0.15s var(--hdr-ease);
}
.header-cart:hover {
  color: var(--hdr-accent);
  border-color: color-mix(in srgb, var(--hdr-accent) 45%, var(--hdr-ghost-border));
}
.header-cart-icon {
  display: block;
  flex-shrink: 0;
}
.header-cart-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--hdr-accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--hdr-bg-scrolled, #fff);
}
