/* =============================================================
   EXAKTE NAVIGATION AUS DER REFERENZ-ZIP
   HTML-Struktur und sichtbare CSS-Regeln entsprechen der vom
   Nutzer bereitgestellten Datei Porsche_Website_checklist_fixes(2).zip.
   ============================================================= */
.site-header {
  position: sticky;
  top: 14px;
  z-index: 50;
  width: 100%;
  display: grid;
  grid-template-columns: auto auto minmax(220px, 320px) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  font-family: Arial, Helvetica, sans-serif;
}

/* Logo- und Markenbereich im Header. */
.brand-area {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 290px;
}

.brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 7px;
}

.brand-copy span,
.kicker {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-copy h1,
.brand-copy .brand-title {
  margin-top: 5px;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1;
  letter-spacing: -0.04em;
}

/* Schnellzugriffs-Icons neben der Navigation. */
.action-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Icon-Buttons: E-Mail, Rechtliches, FAQ und Warenkorb. */
.icon-link {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.icon-link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.icon-link:hover {
  background: rgba(255, 255, 255, 0.095);
  border-color: var(--line-strong);
}

.icon-link:focus-visible {
  color: #fff;
  border-color: var(--gold);
  outline: 2px solid rgba(211, 166, 95, 0.6);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(211, 166, 95, 0.14);
}

.icon-link:active {
  color: #fff;
  transform: none;
}

/* Warenkorb-Styling: Artikel, Mengensteuerung und Preisübersicht. */
.cart-highlight {
  position: relative;
  background: linear-gradient(135deg, rgba(226, 57, 52, 0.35), rgba(226, 57, 52, 0.13));
  border-color: rgba(226, 57, 52, 0.65);
  box-shadow: 0 0 24px rgba(226, 57, 52, 0.22);
}

.cart-highlight:has(.cart-count-badge)::after {
  content: none;
}

.cart-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold, #d8b56d);
  color: #17140d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.cart-count-badge[data-count="0"] {
  display: none;
}

.cart-highlight::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-strong);
  box-shadow: 0 0 14px rgba(255, 67, 62, 0.8);
}

.search-area {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  transition: border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.search-area:focus-within {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(211, 166, 95, 0.18), 0 0 22px rgba(211, 166, 95, 0.16);
}

/* Sobald die Ergebnisliste offen ist, verschmelzen Suchfeld und Dropdown zu
   einer einzigen Form: die untere Kante des Suchfelds wird eckig und der
   Abstand zur Liste faellt weg, sodass es wie ein echtes Dropdown wirkt. */
.search-area:has(.search-results.is-open) {
  border-radius: 16px 16px 0 0;
  border-bottom-color: transparent;
}

/* Die Pille zeigt den Fokus bereits über den Glow oben (.search-area:focus-within).
   Der globale eckige Fokusrahmen (site-harmony.css) wuerde sonst als scharfkantiges
   Rechteck innerhalb der abgerundeten Suchleiste erscheinen. */
.search-area input:focus-visible {
  outline: none !important;
}

/* ===== Suche loeschen (X)-Button: nur sichtbar, wenn Text eingegeben wurde ===== */
.search-clear-btn {
  display: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.search-clear-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.search-clear-btn:hover,
.search-clear-btn:focus-visible {
  background: rgba(211, 166, 95, 0.28);
  color: var(--gold);
  transform: scale(1.08);
}

.search-area input:not(:placeholder-shown) ~ .search-clear-btn {
  display: flex;
}

/* ===== Suchergebnisse ===== */
/* Suchergebnisse: wird über JavaScript ein- und ausgeblendet. */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #171009;
  border: 1px solid var(--gold);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  padding: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 60;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 260ms ease, opacity 200ms ease;
}

.search-results.is-open {
  max-height: 360px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 160ms ease, transform 160ms ease;
}

.search-result-item:hover,
.search-result-item.is-active {
  background: rgba(211, 166, 95, 0.16);
  transform: translateX(2px);
}

.search-result-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--gold);
}

.search-result-desc {
  font-size: 12.5px;
  color: var(--muted);
}

.search-result-empty {
  padding: 12px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

.search-area svg {
  width: 20px;
  height: 20px;
  fill: var(--muted);
  flex: 0 0 auto;
}

.search-area input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
}

.search-area input::-webkit-search-cancel-button,
.search-area input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-area input::placeholder {
  color: rgba(246, 246, 247, 0.56);
}

/* Responsive Design: Anpassungen für kleinere Bildschirme. */
@media (max-width: 1199px) {
  .search-area {
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
  }

  .search-area svg {
    flex: 0 0 auto;
  }

  .search-area input {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
  }

  .search-clear-btn {
    flex: 0 0 auto;
  }
}

/* Hauptnavigation: Seitenlinks innerhalb des Projekts. */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
  font-family: Arial, Helvetica, sans-serif;
}

.main-nav a {
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  color: rgba(246, 246, 247, 0.88);
  font-size: 15px;
  font-weight: 800;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.main-nav .nav-active {
  color: white;
  background: linear-gradient(135deg, var(--red), #bf211e);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(226, 57, 52, 0.32);
}

/* Mobile Navigation: Burger-Button für kleine Bildschirme. */
.mobile-menu-btn {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: white;
  border-radius: 999px;
}

@media (max-width: 720px) {
  .site-header {
    top: 8px;
    gap: 14px;
    padding: 12px;
  }

  .brand-area {
    min-width: 0;
    gap: 12px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .brand-copy h1,
.brand-copy .brand-title {
    font-size: 21px;
  }

  .brand-copy span {
    font-size: 10px;
  }

  .action-area {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .icon-link {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .main-nav a {
    padding: 10px 12px;
    font-size: 14px;
  }
}

.site-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-area {
  order: 1;
  min-width: 0;
}

.nav-menu {
  order: 2;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  flex-wrap: nowrap;
}

.nav-menu .main-nav {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.nav-menu .main-nav a {
  width: auto;
  text-align: left;
}

.nav-menu .action-area {
  flex-direction: row;
  justify-content: center;
  flex-wrap: nowrap;
}

.nav-menu .search-area {
  width: auto;
  flex: 0 1 280px;
}

.mobile-menu-btn {
  display: none;
  order: 3;
  flex: 0 0 auto;
}

@media (max-width: 1199px) {
  .site-header {
    flex-wrap: wrap;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-menu {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid transparent;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 420ms cubic-bezier(0.4, 0, 0.2, 1),
      opacity 280ms ease,
      margin-top 420ms cubic-bezier(0.4, 0, 0.2, 1),
      padding-top 420ms cubic-bezier(0.4, 0, 0.2, 1),
      border-color 420ms ease,
      visibility 0s linear 420ms;
  }

  .nav-menu.is-open {
    max-height: 760px;
    opacity: 1;
    margin-top: 18px;
    padding-top: 18px;
    border-top-color: var(--line);
    visibility: visible;
    pointer-events: auto;
    transition: max-height 420ms cubic-bezier(0.4, 0, 0.2, 1),
      opacity 320ms ease 60ms,
      margin-top 420ms cubic-bezier(0.4, 0, 0.2, 1),
      padding-top 420ms cubic-bezier(0.4, 0, 0.2, 1),
      border-color 420ms ease,
      visibility 0s linear 0s;
  }

  .nav-menu .main-nav {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    white-space: normal;
  }

  .nav-menu .main-nav a {
    width: 100%;
    text-align: left;
  }

  .nav-menu .action-area {
    justify-content: flex-start;
    flex-wrap: wrap;
  }


  /* Die mobile Navigation behält ihre bisherige sichtbare Reihenfolge. */
  .nav-menu .action-area a[aria-label="E-Mail"] { order: 1; }
  .nav-menu .action-area a[aria-label="Paragraf und Rechtliches"] { order: 2; }
  .nav-menu .action-area a[aria-label="Fragen und Antworten"] { order: 3; }
  .nav-menu .action-area a[aria-label="Einkaufswagen"] { order: 4; }

  .nav-menu .search-area {
    width: 100%;
    flex: none;
  }
}


/* ===== Nav-Buttons: starker Glow + 3D-Effekt ===== */
.main-nav a {
  position: relative;
  transform: translateY(0) scale(1);
  will-change: transform, box-shadow;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 4px 8px rgba(0, 0, 0, 0.25);
  transition: background 260ms cubic-bezier(0.22, 1, 0.36, 1), color 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms cubic-bezier(0.22, 1, 0.36, 1), text-shadow 260ms cubic-bezier(0.22, 1, 0.36, 1), border-color 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #fff;
  background: rgba(211, 166, 95, 0.16);
  transform: translateY(-2px) scale(1.02);
  text-shadow: 0 0 8px rgba(255, 241, 214, 0.55);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.3),
    0 10px 16px rgba(0, 0, 0, 0.22),
    0 0 12px rgba(211, 166, 95, 0.45),
    0 0 26px rgba(211, 166, 95, 0.25);
}

.main-nav a:active {
  transform: translateY(1px) scale(0.985);
  transition-duration: 120ms;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.25);
}

.main-nav .nav-active {
  box-shadow:
    0 12px 28px rgba(226, 57, 52, 0.32),
    0 2px 0 rgba(120, 20, 18, 0.6);
}

.main-nav .nav-active:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 6px 0 rgba(120, 20, 18, 0.6),
    0 16px 26px rgba(226, 57, 52, 0.42),
    0 0 24px rgba(211, 166, 95, 0.85),
    0 0 50px rgba(211, 166, 95, 0.5);
}

.main-nav .nav-active:active {
  transform: translateY(1px) scale(0.985);
  transition-duration: 120ms;
  box-shadow:
    0 1px 0 rgba(120, 20, 18, 0.6),
    0 4px 10px rgba(226, 57, 52, 0.28);
}

/* ===== Projekt-Button: Gold ===== */
.main-nav a[href^="Projekt.html"] {
  color: #241a0c;
  background: linear-gradient(135deg, #e9c383, var(--gold));
  border: 1px solid rgba(255, 244, 214, 0.5);
  box-shadow:
    0 2px 0 rgba(120, 90, 30, 0.55),
    0 4px 10px rgba(211, 166, 95, 0.35);
}

.main-nav a[href^="Projekt.html"]:hover {
  color: #241a0c;
  background: linear-gradient(135deg, #f3d29c, #e0b06b);
  text-shadow: none;
  box-shadow:
    0 6px 0 rgba(120, 90, 30, 0.55),
    0 16px 26px rgba(211, 166, 95, 0.45),
    0 0 26px rgba(233, 195, 131, 0.8);
}

.main-nav a[href^="Projekt.html"]:active {
  box-shadow:
    0 1px 0 rgba(120, 90, 30, 0.55),
    0 3px 8px rgba(211, 166, 95, 0.35);
}

/* ===== Home-Button: Gold ===== */
.main-nav a[href^="index.html"] {
  color: #241a0c;
  background: linear-gradient(135deg, #e9c383, var(--gold));
  border: 1px solid rgba(255, 244, 214, 0.5);
  box-shadow:
    0 2px 0 rgba(120, 90, 30, 0.55),
    0 4px 10px rgba(211, 166, 95, 0.35);
}

.main-nav a[href^="index.html"]:hover {
  color: #241a0c;
  background: linear-gradient(135deg, #f3d29c, #e0b06b);
  text-shadow: none;
  box-shadow:
    0 6px 0 rgba(120, 90, 30, 0.55),
    0 16px 26px rgba(211, 166, 95, 0.45),
    0 0 26px rgba(233, 195, 131, 0.8);
}

.main-nav a[href^="index.html"]:active {
  box-shadow:
    0 1px 0 rgba(120, 90, 30, 0.55),
    0 3px 8px rgba(211, 166, 95, 0.35);
}

.main-nav a[href^="index.html"].nav-active {
  color: #241a0c;
  background: linear-gradient(135deg, #e9c383, var(--gold));
  border: 1px solid rgba(255, 244, 214, 0.5);
  box-shadow:
    0 2px 0 rgba(120, 90, 30, 0.55),
    0 4px 10px rgba(211, 166, 95, 0.35);
}

.main-nav a[href^="index.html"].nav-active:hover {
  background: linear-gradient(135deg, #f3d29c, #e0b06b);
  box-shadow:
    0 6px 0 rgba(120, 90, 30, 0.55),
    0 16px 26px rgba(211, 166, 95, 0.45),
    0 0 26px rgba(233, 195, 131, 0.8);
}

/* ===== Newsletter-Button: Animation wird zentral in header-stable.css gesteuert ===== */
.main-nav a[href^="Newsletter.html"] {
  animation: none;
}

/* ===== Warenkorb-Icon: rote Puls- und Ping-Animation ===== */
.cart-highlight {
  animation: cartPulse 2s ease-in-out infinite;
}

.cart-highlight:hover {
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 0 44px rgba(226, 57, 52, 0.75);
}

@keyframes cartPulse {
  0%, 100% {
    box-shadow: 0 0 24px rgba(226, 57, 52, 0.22);
  }
  50% {
    box-shadow: 0 0 36px rgba(226, 57, 52, 0.6), 0 0 64px rgba(226, 57, 52, 0.3);
  }
}

.cart-highlight::before {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 67, 62, 0.7);
  animation: cartPing 1.8s ease-out infinite;
}

@keyframes cartPing {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}



.main-nav a[href^="index.html"],
.main-nav a[href^="Projekt.html"] {
  background: linear-gradient(135deg, #e9c383, #d3a65f) !important;
  color: #241a0c !important;
  border: 1px solid rgba(255, 244, 214, 0.5) !important;
}

.main-nav a[href^="index.html"]:hover,
.main-nav a[href^="Projekt.html"]:hover {
  background: linear-gradient(135deg, #f3d29c, #e0b06b) !important;
  color: #241a0c !important;
}

