@charset "UTF-8";

/* =========================================
   GLOBAL VARS
========================================= */
:root {
  --red: #e30513;
  --ipfRot: #e30513;

  --gray: #eeeeee;

  --schwarz: #000;
  --weiss: #fff;

  --dunkelGrau: rgba(0, 0, 0, 0.12);

  --text: black;
  --row1-height: 70px;

  /* Header Action Sizing (Icons rechts) */
  --header-action-size: 44px; /* gleiche Klickfläche */
  --header-icon-size: 24px; /* gleiche Icongröße */
  --header-action-gap: 10px;

  /* ✅ Dropdown UX */
  --dropdown-gap: 12px; /* Abstand Button -> Card bleibt gleich */
  --dropdown-arrow-right: 16px; /* Dreieck unter dem Icon (rechts) */
}

/* =========================================
   RESET
========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================================
   HEADER
========================================= */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  backdrop-filter: blur(12px);
  z-index: 1000;
  transition: box-shadow 0.4s ease;
  border-top: 10px solid var(--ipfRot);
}

#header.expanded {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

/* Container im Header als Bezug */
#header > .container {
  position: relative;
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
}

/* =========================================
   ROW 1
========================================= */
.row1 {
  width: 100%;
  min-height: var(--row1-height);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

/* ✅ FIX: Search bleibt IMMER exakt zentriert (links/rechts symmetrisch) */
.row1-grid {
  display: grid;

  /* links & rechts gleich breit -> Mitte bleibt immer zentriert */
  grid-template-columns: minmax(0, 1fr) minmax(260px, 720px) minmax(0, 1fr);

  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.row1-grid > .left-icons {
  justify-self: start;
  min-width: 0;
}

.row1-grid > .search-wrapper-outer {
  justify-self: center;
  width: 100%;
  min-width: 260px;
}

.row1-grid > .right-icons {
  justify-self: end;
  min-width: 0;
}

/* Logo */
.logo {
  width: 197px;
  height: auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: transparent !important;
}

.logo:hover {
  color: var(--ipfRot);
}

/* =========================================
   LEFT ICONS
========================================= */
.left-icons {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 10px;
}

.left-icons .hamburger {
  padding: 0;
  margin: 0;
  color: var(--schwarz);
  border: none;
  background: none !important;
  cursor: pointer;
}

.left-icons .hamburger svg {
  width: 48px;
  height: 48px;
  display: block;
}

.left-icons .hamburger:focus,
.left-icons .hamburger:focus-visible,
.left-icons .hamburger:active {
  outline: none;
  border: none;
}

.left-icons .hamburger:hover {
  color: var(--ipfRot);
  background: transparent !important;
}

/* =========================================
   SEARCH WRAPPER
========================================= */
.search-wrapper-outer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-wrapper-parent {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-wrapper {
  position: relative;
  padding: 0;
  min-width: 260px;
  width: auto;
  max-width: 100%;
  display: inline-block;
  overflow: visible;
}

@media (max-width: 992px) {
  .search-wrapper {
    margin: unset;
  }
}

/* ✅ KEINE Border-Animation mehr (alles entfernt) */

.search-wrapper-inner {
  position: relative;
  border-radius: 10px;
  padding: 10px 40px 10px 40px;
  display: flex;
  align-items: center;
  width: auto;
  z-index: 2;
  height: 40px;
  border: none;
  box-shadow: 0 0 10px var(--dunkelGrau);
  color: var(--schwarz);
  border: 1px solid var(--weiss);
  background: transparent;
}

.search-wrapper-inner input {
  padding: 6px 0;
  background-color: transparent !important;
  width: 100%;
  border: none !important;
  outline: none;
  font-size: 14px;
}

.search-wrapper-inner button {
  background: none !important;
  position: absolute;
  left: 12px;
  z-index: 3;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-bar:focus,
.search-bar:focus-visible,
.search-bar:hover,
.search-bar:active {
  outline: none;
  border: none;
  background-color: transparent;
}

.search-bar:hover,
.search-bar:active {
  box-shadow: none;
}

/* =========================================
   RIGHT ICONS (EINHEITLICH) ✅
   Hover: NUR pointer + rot (kein Hintergrund)
========================================= */
.right-icons {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 20px;
  max-width: max-content;
  color: var(--schwarz);
  min-width: 0;
}

/* Login / Basket / Language / Theme: gleiche Höhe, gleiche Alignment */
#header .right-icons .login-btn,
#header .right-icons .basket-btn,
#header .right-icons .language-btn,
#header .right-icons .icon-btn {
  height: var(--header-action-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  user-select: none;

  cursor: pointer; /* ✅ pointer */
  background: transparent !important; /* ✅ nie Hintergrund */
  border: none;
  text-decoration: none;
  color: var(--schwarz);
}

/* Text+Icon Buttons */
#header .right-icons .login-btn,
#header .right-icons .language-btn {
  gap: var(--header-action-gap);
  padding: 0 14px;
}

/* reine Icon Buttons */
#header .right-icons .basket-btn,
#header .right-icons .icon-btn {
  width: var(--header-action-size);
  padding: 0;
}

/* ✅ FIX: Badge links statt rechts */
#header .right-icons .basket-btn {
  flex-direction: row-reverse;
  gap: var(--header-action-gap);
}

.basket-btn {
  transition: all 0.3s ease;
}

.basket-btn .badge {
  transition: all 0.3s ease;
}

.basket-animate {
  animation: basketPop 0.6s ease;
}

@keyframes basketPop {
  0% {
    transform: scale(0.6) rotate(-20deg);
    opacity: 0;
  }
  40% {
    transform: scale(1.3) rotate(10deg);
    opacity: 1;
  }
  70% {
    transform: scale(0.9) rotate(-5deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Icons übernehmen Textfarbe */
#header .right-icons svg {
  width: var(--header-icon-size);
  height: var(--header-icon-size);
  flex: 0 0 var(--header-icon-size);
  display: block;
  fill: currentColor;
}

/* Text sauber */
#header .right-icons .login-btn span,
#header .right-icons .language-btn span,
#header .right-icons .basket-btn span {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;

  /* ✅ FIX: Descender (g,p,y,j) wird nicht abgeschnitten */
  display: inline-block;
  line-height: 1.2;
  padding-bottom: 1px;
}

#header .right-icons .login-btn span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ✅ NUR rot bei Hover */
#header .right-icons .login-btn:hover,
#header .right-icons .basket-btn:hover,
#header .right-icons .language-btn:hover,
#header .right-icons .icon-btn:hover {
  color: var(--ipfRot);
  background: transparent !important;
  box-shadow: none !important;
}

/* ✅ Theme/Icon-Button rechts erstmal AUS (später easy wieder an) */
#header .right-icons .icon-btn {
  display: none !important;
}
/* WIEDER AN machen (einfach einkommentieren):
#header .right-icons .icon-btn { display: inline-flex !important; }
*/

/* Theme icons */
.light-mode-icon {
  display: block;
}
.dark-mode-icon {
  display: none;
}

/* =========================================
   LANGUAGE + SETTINGS DROPDOWN
========================================= */
.language-dropdown,
.login-dropdown {
  position: relative;
}

/* Dropdown Cards */
.language-card,
.settings-card {
  position: absolute;
  top: calc(100% + var(--dropdown-gap));
  right: 0;
  background: #fff;
  border-radius: 26px;
  padding: 18px 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1000;
}
.settings-card {
  width: 200px;
}

/* ✅ Hover-Bridge: füllt genau den Gap unsichtbar -> Dropdown bleibt offen */
.language-card::after,
.settings-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--dropdown-gap));
  height: var(--dropdown-gap);
  background: transparent;
}

/* Pfeil */
.language-card::before,
.settings-card::before {
  content: "";
  position: absolute;
  top: -10px;
  right: var(--dropdown-arrow-right);
  width: 20px;
  height: 20px;
  background: #fff;
  transform: rotate(45deg);
}

@media (max-width: 768px) {
  .language-card,
  .settings-card {
    right: -35px !important;
  }
}

/* Show on hover/focus */
.language-dropdown:hover .language-card,
.language-dropdown:focus-within .language-card,
.login-dropdown:hover .settings-card,
.login-dropdown:focus-within .settings-card {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Buttons in Cards (Hover: NUR rot, kein Hintergrund) */
.language-card .languageButton,
.settings-card .settingButton {
  display: block;
  width: 100%;
  padding: 10px 24px;
  background: none !important;
  border: none;
  text-align: left;
  font-size: 14px;
  color: var(--schwarz);
  cursor: pointer;
  text-decoration: none;
}
.language-card .languageButton {
  white-space: nowrap;
}

.language-card .languageButton:hover,
.settings-card .settingButton:hover {
  background: transparent !important;
  color: var(--red);
}

/* =========================================
   LOGIN CARD (Popup)
========================================= */
.login-card {
  position: absolute;
  top: calc(100% + var(--dropdown-gap));
  right: 0;
  width: 320px;
  padding: 28px 26px 30px;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

/* ✅ Hover-Bridge für Login Card */
.login-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--dropdown-gap));
  height: var(--dropdown-gap);
  background: transparent;
}

/* Pfeil */
.login-card::before {
  content: "";
  position: absolute;
  top: -10px;
  right: var(--dropdown-arrow-right);
  width: 20px;
  height: 20px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 0;
}

@media (max-width: 768px) {
  .login-card {
    padding: 16px !important;
    right: 50% !important;
    transform: translateX(30%) translateY(-10px) !important;
  }
  .login-card::before {
    right: 90px !important;
  }
}

/* Show on hover/focus */
.login-dropdown:hover .login-card,
.login-dropdown:focus-within .login-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.login-card h3 {
  margin: 0 0 18px;
  font-size: 20px;
}

/* =========================================
   LOGIN FORM
========================================= */
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--schwarz);
}

.login-field input {
  height: 44px;
  border-radius: 12px;
  border: none;
  background: #f1f1f5;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}

.login-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #f1f1f5 inset !important;
}

.login-field input::-webkit-credentials-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  right: 0 !important;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 18px;
}

.login-actions button {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 26px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.login-actions button:hover {
  background: var(--red);
}

.login-actions a {
  font-size: 13px;
  color: #333;
  text-decoration: none;
  cursor: pointer;
}

.login-actions a:hover {
  color: var(--red);
  background: transparent !important;
}

.login-footer {
  font-size: 13px;
  color: #666;
}

.login-footer a {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
  cursor: pointer;
}

/* =========================================
   ROW2 auf volle Breite
========================================= */
#header .row2 {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Main-Nav im Row2 wieder „zentriert“ */
#header .row2 > .main-nav {
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
  padding: 0 30px;
  justify-content: center;
}

/* Subnav: Padding „fluid“ */
#header .row2 > .sub-nav {
  padding-left: max(30px, calc((100vw - 1296px) / 2));
  padding-right: max(30px, calc((100vw - 1296px) / 2));
}

/* =========================================
   ROW 2 NAV
========================================= */
.row2 {
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.2);
  z-index: 500;
  background: #fff;
}

.main-nav {
  display: flex;
  gap: 50px;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-size: 16px;
  font-weight: 600;
  color: var(--schwarz);
  text-decoration: none;
  padding: 10px 0;
  transition: color 0.3s;
  cursor: pointer;
  background: transparent !important;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ipfRot);
}

.nav-item .nav-sublinks {
  display: none;
}

/* =========================================
   SUB NAV
========================================= */
.sub-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  max-height: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 0 30px;
  transition: max-height 260ms ease, opacity 260ms ease, padding 260ms ease;
  overflow: hidden;
  box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.3);
  -webkit-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.3);
  -moz-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.3);
  z-index: 500;
}

.sub-nav.visible {
  max-height: 70px;
  pointer-events: auto;
  padding-top: 15px;
  padding-bottom: 15px;
}

/* volle Breite + zentrierter Inhalt */
#header .sub-nav {
  width: 100vw;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  padding-left: max(30px, calc((100vw - 1296px) / 2));
  padding-right: max(30px, calc((100vw - 1296px) / 2));
}

/* Subnav Links Animation */
.sub-nav a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  position: relative;

  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;

  transition: opacity 280ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1), color 0.3s;

  cursor: pointer;
  background: transparent !important;
  color: var(--schwarz);
}

.sub-nav.visible a {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sub-nav a:hover {
  color: var(--red);
}

/* =========================================
   MOBILE MENU
========================================= */
.hamburger {
  display: none;
  font-size: 28px;
  background: none !important;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.mobile-menu {
  position: fixed;
  top: var(--row1-height, 90px);
  left: 0;
  right: 0;
  height: calc(100vh - var(--row1-height, 90px));
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 900;
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .mobile-menu {
    margin-top: 30px;
  }
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 30px 24px 80px;
  max-height: 100%;
  overflow-y: auto;
  width: 340px;
  max-width: 85%;
  background: var(--weiss);
  height: 100%;
  transform: translateX(-100%);
  transition: transform 0.35s ease;
}

.mobile-menu.open .mobile-nav {
  transform: translateX(0);
}

.mobile-nav-section {
  border-bottom: 1px solid #eee;
  padding-bottom: 18px;
}

.mobile-main-link {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--schwarz);
  text-decoration: none;
  margin-bottom: 10px;
  cursor: pointer;
  background: transparent !important;
}

.mobile-main-link:hover {
  color: var(--red);
}

.mobile-sub-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

.mobile-nav-section.expanded .mobile-sub-links {
  opacity: 1;
}

.mobile-sub-links a {
  font-size: 15px;
  color: var(--schwarz);
  text-decoration: none;
  padding: 6px 12px;
  max-width: max-content;
  cursor: pointer;
  background: transparent !important;
}

.mobile-sub-links a:hover {
  color: var(--red);
}

/* =========================================
   RESPONSIVE HEADER
========================================= */
@media (max-width: 768px) {
  .row1 {
    padding: 0;
    display: block;
  }

  .row1-grid {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo icons"
      "search search";
    column-gap: 16px;
    row-gap: 16px;
    width: 100%;
    padding: 16px 12px;
  }

  .logo {
    width: 150px;
    display: block;
  }

  .logo svg {
    width: 100%;
    height: auto;
    display: block;
  }

  .row1-grid .right-icons {
    grid-area: icons;
    justify-self: end;
    gap: 10px !important;
  }

  .row1-grid .search-wrapper-outer {
    grid-area: search;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav,
  .row2,
  .sub-nav {
    display: none;
  }

  .hamburger {
    display: block;
  }

  /* Text weg */
  #header .right-icons .login-btn span,
  #header .right-icons .language-btn span {
    display: none;
  }

  /* Login/Language werden Icon-only */
  #header .right-icons .login-btn,
  #header .right-icons .language-btn {
    width: var(--header-action-size);
    padding: 0;
  }

  .hamburger svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* =========================================
   MAIN CONTENT AREA
========================================= */
.main-content {
  width: 100%;
  margin: 0 auto;
  padding: 60px 1rem 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - var(--row1-height, 90px));
}

.inner-content {
  width: 100%;
}

@media (min-width: 576px) {
  .main-content {
    max-width: 540px;
  }
}
@media (min-width: 768px) {
  .main-content {
    max-width: 720px;
  }
}
@media (min-width: 992px) {
  .main-content {
    max-width: 960px;
  }
}
@media (min-width: 1200px) {
  .main-content {
    max-width: 1140px;
  }
}
@media (min-width: 1400px) {
  .main-content {
    max-width: 1320px;
  }
}

.login-overlay-link {
  position: absolute;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  display: block;
  z-index: 999999;
}

dl {
  display: block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  unicode-bidi: isolate;
}

/* Chrome Autofill soll exakt aussehen wie normal (kein blau) */
.search-wrapper-inner input:-webkit-autofill,
.search-wrapper-inner input:-webkit-autofill:hover,
.search-wrapper-inner input:-webkit-autofill:focus,
.search-wrapper-inner input:-webkit-autofill:active {
  /* Text + Cursor wie normal */
  -webkit-text-fill-color: var(--schwarz) !important;
  caret-color: var(--schwarz) !important;

  /* Chromes Autofill-Hintergrund übermalen (optisch wie vorher) */
  -webkit-box-shadow: 0 0 0 1000px var(--weiss) inset !important;
  box-shadow: 0 0 0 1000px var(--weiss) inset !important;

  background-color: transparent !important; /* Input bleibt wie gehabt */
  border: none !important;

  /* verhindert Autofill-Flash */
  transition: background-color 9999s ease-out 0s;
}
