/***************************************************************************
 * 1) RESET & BASE VARIABLES
 ***************************************************************************/
 *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --dark: #111111;
    --light: #ffffff;
    --accent: #1a73e8;
    --text-dark: #333;
    --text-light: #fff;
    /* Zusätzliche Farben für Toggle-Switch usw. */
    --sun: #1a73e8;
    --moon: #dddddd;
    --cloud: #ffffff;
}

/***************************************************************************
 * 2) BODY & DARK MODE
 ***************************************************************************/
body {
    font-family: Arial, sans-serif;
    background: #f2f2f2;  /* Hellgrau */
    color: #000;          /* Standard Schriftfarbe im Light-Mode */
}
body.darkmode {
    background: #121212;  /* Sehr dunkles Grau */
    color: #fff;          /* Helle Schrift im Dark-Mode */
}

/***************************************************************************
 * 3) HEADER & NAVIGATION
 ***************************************************************************/
/* Grundstruktur des Headers */
.site-header {
    background: var(--light);
    color: var(--text-dark);
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background 0.3s, color 0.3s;
}
body.darkmode .site-header {
    background: var(--dark);
    color: var(--text-light);
    border-bottom: 1px solid rgba(26, 115, 232, 0.4);
}

/* Header-Container (max. Breite, zentriert) */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* Linke Sektion: Logo + Navigation */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Logo */
.site-logo a {
    font-size: 30px;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.4s;
}
body.darkmode .site-logo a {
    color: var(--light);
}

/* Navigationsliste */
.site-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}
.site-nav li {
    position: relative;
}
.site-nav .mobile-nav-item {
    display: none;
}
.site-nav a {
    text-decoration: none;
    color: var(--text-dark);
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.site-nav a .icon {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}
.site-nav a:hover,
.site-nav a.active {
    background: var(--accent);
    color: var(--text-light);
}
.site-nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
body.darkmode .site-nav a {
    color: var(--text-light);
}
body.darkmode .site-nav a:hover,
body.darkmode .site-nav a.active {
    background: var(--accent);
    color: var(--text-light);
}

/* Rechte Sektion: Hamburger-Menü, Icons, etc. */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/***************************************************************************
 * 3.1) HAMBURGER-MENÜ
 ***************************************************************************/
.menu-toggle {
    display: none; /* Nur im Mobile-Viewport sichtbar */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100; /* Überlagerung, falls nötig */
}
.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
body.darkmode .menu-toggle span {
    background: var(--text-light);
}
/* Offen-Status (Kreuz statt Hamburger) */
.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}
.menu-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/***************************************************************************
 * 3.2) ICONS (LOGIN, KORB, ETC.)
 ***************************************************************************/
.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}
.icon-link {
    position: relative;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s;
}
.icon-link .icon {
    width: 24px;
    height: 24px;
    display: block;
    fill: currentColor;
}
.icon-link:hover {
    color: var(--accent);
}
.icon-link.active {
    color: var(--accent);
}
body.darkmode .icon-link {
    color: var(--text-light);
}
body.darkmode .icon-link:hover {
    color: var(--accent);
}
body.darkmode .icon-link.active {
    color: var(--accent);
}

.icon-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 50%;
}

.icon-link .icon-tooltip {
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translate(-50%, 5px);
    background: rgba(17, 17, 17, 0.9);
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
}

.icon-link .icon-tooltip::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: transparent transparent rgba(17, 17, 17, 0.9) transparent;
}

.icon-link:hover .icon-tooltip,
.icon-link:focus-visible .icon-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.darkmode .icon-link .icon-tooltip {
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
}

body.darkmode .icon-link .icon-tooltip::after {
    border-color: transparent transparent rgba(255, 255, 255, 0.9) transparent;
}

.header-icons.auth-loading [data-auth-icon] {
    visibility: hidden;
    pointer-events: none;
}

.is-hidden {
    display: none !important;
}

.badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    padding: 2px 5px;
    line-height: 1;
}

.badge:empty {
    display: none;
}

/***************************************************************************
 * 3.3) DARK MODE TOGGLE-SWITCH
 ***************************************************************************/
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}
.toggle-switch .toggle-input {
    display: none;
}
.toggle-switch .toggle-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 24px;
    background-color: #2196F3;
    border-radius: 34px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.toggle-switch .toggle-label::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: #fff;
    box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}
.toggle-switch .toggle-input:checked + .toggle-label {
    background-color: #4CAF50;
}
.toggle-switch .toggle-input:checked + .toggle-label::before {
    transform: translateX(16px);
}

/***************************************************************************
 * 3.4) SELL/KAUF ICONS-SICHTBARKEIT
 ***************************************************************************/
/* Verkaufskorb nur auf Sell-Seiten sichtbar */
.euro-icon {
    display: none;
}
body.sell-page .cart-icon {
    display: none;
}
body.sell-page .euro-icon {
    display: inline-block;
}

/***************************************************************************
 * 4) RESPONSIVE ANPASSUNGEN (MOBILE)
 ***************************************************************************/
@media (max-width: 768px) {
    /* Header-Container: Spaltenlayout */
    .header-container {
        flex-direction: column;
        align-items: center;
    }

    /* Logo zentriert */
    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    /* Rechte Sektion: Hamburger + Icons in einer Zeile */
    .header-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Hamburger-Menü sichtbar (anstelle der Desktop-Navi) */
    .menu-toggle {
        display: flex;
    }

    /* Navigation wird zum Dropdown */
    .site-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;  /* Passend zum Header-Abstand */
        right: 20px;/* Ausrichtung nach rechts */
        background: var(--light);
        padding: 15px;
        gap: 10px;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }
    .site-nav ul.open {
        display: flex;
    }
    body.darkmode .site-nav ul {
        background: var(--dark);
        box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    }

    /* Icons anpassen */
    .header-icons {
        gap: 10px;
    }
    .header-icons .icon-link {
        margin-right: 10px;
        font-size: 20px;
    }
    .header-icons .favorites-icon,
    .header-icons .compare-icon {
        display: none;
    }
    .site-nav .mobile-nav-item {
        display: block;
    }
    .site-nav .mobile-nav-item a {
        width: 100%;
    }
}

/***************************************************************************
 * 5) LOGIN POPUP (MODAL)
 ***************************************************************************/
/* Modal Overlay */
.modal {
    display: none;                 /* Standardmäßig ausgeblendet */
    position: fixed;
    z-index: 2000;                /* Über dem Header (z-index: 1000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;               /* Bei Bedarf scrollen */
    background-color: rgba(0, 0, 0, 0.5); /* Dunkler Overlay */
}

/* Modal-Inhalt (Popup-Fenster) */
.modal-content {
    width: 80%;
    max-width: 460px;
    margin: 8% auto;
    position: relative;
    padding: 48px 40px 40px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.9));
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}
body.darkmode .modal-content {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 30px 60px rgba(2, 6, 23, 0.55);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .modal-content {
        background: rgba(255, 255, 255, 0.82);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }
    body.darkmode .modal-content {
        background: rgba(17, 24, 39, 0.78);
    }
}

/* X-Button zum Schließen */
.close-button {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: none;
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    padding: 0;
    z-index: 10;
    line-height: 1;
}
.close-button:hover,
.close-button:focus-visible {
    transform: translateY(-1px) scale(1.02);
    background: rgba(26, 115, 232, 0.12);
    color: #1a73e8;
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.22);
}
.close-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 3px;
}
.close-button .close-icon {
    pointer-events: none;
    font-size: 1.3rem;
    line-height: 1;
}
body.darkmode .close-button {
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 38px rgba(2, 6, 23, 0.65);
}
body.darkmode .close-button:hover,
body.darkmode .close-button:focus-visible {
    background: rgba(96, 165, 250, 0.18);
    color: #60a5fa;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.75);
}

/* Formular im Modal */
#loginForm, #registerForm {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 0;
    padding-top: 8px;
}
.form-title {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
}
body.darkmode .form-title {
    color: #f8fafc;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-field label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.65);
}
body.darkmode .form-field label {
    color: rgba(226, 232, 240, 0.7);
}
.form-field input {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.form-field input:hover {
    border-color: rgba(26, 115, 232, 0.45);
    transform: translateY(-1px);
}
.form-field input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.18);
    background: #ffffff;
    transform: translateY(0);
}
body.darkmode .form-field input {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #f8fafc;
}
body.darkmode .form-field input:hover {
    border-color: rgba(96, 165, 250, 0.6);
}
body.darkmode .form-field input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
    background: rgba(15, 23, 42, 0.95);
}
#loginForm button, #registerForm button {
    padding: 14px 24px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #1a73e8, #2563eb);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#loginForm button:hover, #registerForm button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
    filter: brightness(1.02);
}
#loginForm button:focus-visible, #registerForm button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 3px;
}
body.darkmode #loginForm button, body.darkmode #registerForm button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 14px 32px rgba(30, 64, 175, 0.4);
}
body.darkmode #loginForm button:hover, body.darkmode #registerForm button:hover {
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.5);
}

/* Registrierungslink im Modal */
.register-link {
    margin-top: 28px;
    text-align: center;
    font-size: 0.95rem;
    color: rgba(15, 23, 42, 0.7);
}
body.darkmode .register-link {
    color: rgba(226, 232, 240, 0.75);
}
.register-link a {
    color: #1a73e8;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}
.register-link a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}
.register-link a:hover,
.register-link a:focus-visible {
    color: #2563eb;
}
.register-link a:hover::after,
.register-link a:focus-visible::after {
    transform: scaleX(1);
}
.register-link a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
    border-radius: 999px;
    padding: 0 2px;
}
body.darkmode .register-link a {
    color: #60a5fa;
}
body.darkmode .register-link a:hover,
body.darkmode .register-link a:focus-visible {
    color: #93c5fd;
}
/* Neue Form-Animation fuer Login/Registrierung */
.form-container {
    position: relative;
    transition: all 0.5s ease;
    width: 100%;
    overflow: visible;
}
.form {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    padding: 20px 0 40px;
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateX(100%);
    z-index: 1;
    box-sizing: border-box;
}
.form.sign-up {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
}
.form-container.sign-in-mode .sign-up {
    transform: translateX(-100%);
    opacity: 0;
    z-index: 1;
}
.form-container.sign-in-mode .sign-in {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
}
.toggle-panel {
    margin-top: 12px;
    padding: 20px 24px;
    border-radius: 20px;
    position: relative;
    z-index: 3;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(26, 115, 232, 0.08);
    color: rgba(15, 23, 42, 0.75);
}
body.darkmode .toggle-panel {
    background: rgba(37, 99, 235, 0.16);
    color: rgba(226, 232, 240, 0.85);
}
.toggle-link {
    color: #1a73e8;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    padding: 0 2px;
    border-radius: 999px;
    transition: color 0.2s ease, transform 0.2s ease;
}
.toggle-link::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: -4px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}
.toggle-link:hover::after,
.toggle-link:focus-visible::after {
    transform: scaleX(1);
}
.toggle-link:hover,
.toggle-link:focus-visible {
    color: #2563eb;
}
.toggle-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
}
body.darkmode .toggle-link {
    color: #60a5fa;
}
body.darkmode .toggle-link:hover,
body.darkmode .toggle-link:focus-visible {
    color: #93c5fd;
}
/***************************************************************************
 * 1) RESET & BASE VARIABLES
 ***************************************************************************/
 *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --dark: #111111;
    --light: #ffffff;
    --accent: #1a73e8;
    --text-dark: #333;
    --text-light: #fff;
    /* Zusätzliche Farben für Toggle-Switch usw. */
    --sun: #1a73e8;
    --moon: #dddddd;
    --cloud: #ffffff;
}

/***************************************************************************
 * 2) BODY & DARK MODE
 ***************************************************************************/
body {
    font-family: Arial, sans-serif;
    background: #f2f2f2;  /* Hellgrau */
    color: #000;          /* Standard Schriftfarbe im Light-Mode */
}
body.darkmode {
    background: #121212;  /* Sehr dunkles Grau */
    color: #fff;          /* Helle Schrift im Dark-Mode */
}

/***************************************************************************
 * 3) HEADER & NAVIGATION
 ***************************************************************************/
/* Grundstruktur des Headers */
.site-header {
    background: var(--light);
    color: var(--text-dark);
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background 0.3s, color 0.3s;
}
body.darkmode .site-header {
    background: var(--dark);
    color: var(--text-light);
}

/* Header-Container (max. Breite, zentriert) */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* Linke Sektion: Logo + Navigation */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Logo */
.site-logo a {
    font-size: 30px;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.4s;
}
body.darkmode .site-logo a {
    color: var(--light);
}

/* Navigationsliste */
.site-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}
.site-nav li {
    position: relative;
}
.site-nav a {
    text-decoration: none;
    color: var(--text-dark);
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
}
.site-nav a:hover,
.site-nav a.active {
    background: var(--accent);
    color: var(--text-light);
}
body.darkmode .site-nav a {
    color: var(--text-light);
}
body.darkmode .site-nav a:hover,
body.darkmode .site-nav a.active {
    background: var(--light);
    color: var(--dark);
}

/* Rechte Sektion: Hamburger-Menü, Icons, etc. */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/***************************************************************************
 * 3.1) HAMBURGER-MENÜ
 ***************************************************************************/
.menu-toggle {
    display: none; /* Nur im Mobile-Viewport sichtbar */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100; /* Überlagerung, falls nötig */
}
.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
body.darkmode .menu-toggle span {
    background: var(--text-light);
}
/* Offen-Status (Kreuz statt Hamburger) */
.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/***************************************************************************
 * 3.2) ICONS (LOGIN, KORB, ETC.)
 ***************************************************************************/
.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}
.icon-link {
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s;
}
.icon-link:hover {
    color: var(--accent);
}
body.darkmode .icon-link {
    color: var(--text-light);
}
body.darkmode .icon-link:hover {
    color: var(--accent);
}

/***************************************************************************
 * 3.3) DARK MODE TOGGLE-SWITCH
 ***************************************************************************/
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}
.toggle-switch .toggle-input {
    display: none;
}
.toggle-switch .toggle-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 24px;
    background-color: #2196F3;
    border-radius: 34px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.toggle-switch .toggle-label::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: #fff;
    box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}
.toggle-switch .toggle-input:checked + .toggle-label {
    background-color: #4CAF50;
}
.toggle-switch .toggle-input:checked + .toggle-label::before {
    transform: translateX(16px);
}

/***************************************************************************
 * 3.4) SELL/KAUF ICONS-SICHTBARKEIT
 ***************************************************************************/
/* Verkaufskorb nur auf Sell-Seiten sichtbar */
.euro-icon {
    display: none;
}
body.sell-page .cart-icon {
    display: none;
}
body.sell-page .euro-icon {
    display: inline-block;
}

/***************************************************************************
 * 4) RESPONSIVE ANPASSUNGEN (MOBILE)
 ***************************************************************************/
@media (max-width: 768px) {
    /* Header-Container: Spaltenlayout */
    .header-container {
        flex-direction: column;
        align-items: center;
    }

    /* Logo zentriert */
    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    /* Rechte Sektion: Hamburger + Icons in einer Zeile */
    .header-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Hamburger-Menü sichtbar (anstelle der Desktop-Navi) */
    .menu-toggle {
        display: flex;
    }

    /* Navigation wird zum Dropdown */
    .site-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;  /* Passend zum Header-Abstand */
        right: 20px;/* Ausrichtung nach rechts */
        background: var(--light);
        padding: 15px;
        gap: 10px;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }
    .site-nav ul.open {
        display: flex;
    }
    body.darkmode .site-nav ul {
        background: var(--dark);
        box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    }

    /* Icons anpassen */
    .header-icons {
        gap: 10px;
    }
    .header-icons .icon-link {
        margin-right: 10px;
        font-size: 20px;
    }
}

/***************************************************************************
 * 5) LOGIN POPUP (MODAL)
 ***************************************************************************/
/* Modal Overlay */
.modal {
    display: none;                 /* Standardmäßig ausgeblendet */
    position: fixed;
    z-index: 2000;                /* Über dem Header (z-index: 1000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;               /* Bei Bedarf scrollen */
    background-color: rgba(0, 0, 0, 0.5); /* Dunkler Overlay */
}

/* Zusätzlicher Abstand zwischen Formularfeldern */
#loginForm {
    margin-bottom: 32px;
}

.modal-content hr {
    margin: 28px 0;
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}
body.darkmode .modal-content hr {
    border-top-color: rgba(148, 163, 184, 0.3);
}

.modal-content p {
    margin: 12px 0;
    color: rgba(15, 23, 42, 0.65);
}
body.darkmode .modal-content p {
    color: rgba(226, 232, 240, 0.78);
}

.google-signin-wrapper {
    display: flex;
    justify-content: center;
    margin: 16px 0 0;
}

#googleSignInDiv {
    display: inline-flex;
    width: 100%;
    max-width: 360px;
    padding: 6px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1a73e8, #2563eb);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    overflow: hidden;
}
#googleSignInDiv:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
    filter: brightness(1.02);
}
body.darkmode #googleSignInDiv {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 14px 32px rgba(30, 64, 175, 0.4);
}
body.darkmode #googleSignInDiv:hover {
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.5);
}
#googleSignInDiv iframe {
    border-radius: 999px !important;
}

#loginModal .toggle-panel {
    margin-top: 12px;
}

#loginModal .toggle-panel p {
    margin: 0;
    font-size: 0.95rem;
}

.error-msg {
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #dc2626;
    line-height: 1.4;
    border-radius: 14px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.error-msg:not(:empty) {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    opacity: 1;
    transform: translateY(0);
}
body.darkmode .error-msg:not(:empty) {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.38);
    color: #fecaca;
}

.success-msg {
    margin: 0 0 4px;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #15803d;
    line-height: 1.5;
    border-radius: 14px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.success-msg.is-visible {
    padding: 12px 16px;
    background: rgba(22, 163, 74, 0.14);
    border: 1px solid rgba(22, 163, 74, 0.25);
    opacity: 1;
    max-height: 120px;
    transform: translateY(0);
}

body.darkmode .success-msg {
    color: #4ade80;
}

body.darkmode .success-msg.is-visible {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.28);
}
  
/* FONT AWESOME ICONS FIX */
.fas, .fab {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.fab {
    font-weight: 400;
}

/* Icon Content - falls Font Awesome nicht lädt */
.fa-user:before { content: "\f007"; }
.fa-user-circle:before { content: "\f2bd"; }
.fa-shopping-cart:before { content: "\f07a"; }
.fa-euro-sign:before { content: "\f153"; }
.fa-star:before { content: "\f005"; }
.fa-exchange-alt:before { content: "\f362"; }

/* Stelle sicher dass Icons sichtbar sind */
.header-icons {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

.icon-link {
    position: relative !important;
    font-size: 24px !important;
    color: #333 !important;
    cursor: pointer !important;
    display: inline-block !important;
    text-decoration: none !important;
}

.icon-link i {
    display: inline-block !important;
    font-size: 24px !important;
}

body.darkmode .icon-link {
    color: #fff !important;
}

.icon-link:hover {
    color: #1a73e8 !important;
}
/* ICON FARBEN FIX - SICHTBAR MACHEN! */

/* Header Icons - deutliche Farben */
.header-icons .icon-link {
    color: #1a73e8 !important;  /* Blaue Farbe - gut sichtbar */
}

.header-icons .icon-link i {
    color: #1a73e8 !important;  /* Blaue Icons */
}

.header-icons .icon-link:hover {
    color: #0d47a1 !important;  /* Dunkleres Blau beim Hover */
}

.header-icons .icon-link:hover i {
    color: #0d47a1 !important;
}

/* Dark Mode - helle Icons */
body.darkmode .header-icons .icon-link {
    color: #64b5f6 !important;  /* Hellblau für Dark Mode */
}

body.darkmode .header-icons .icon-link i {
    color: #64b5f6 !important;
}

body.darkmode .header-icons .icon-link:hover {
    color: #90caf9 !important;  /* Noch heller beim Hover */
}

body.darkmode .header-icons .icon-link:hover i {
    color: #90caf9 !important;
}

/* Badges - gut sichtbar */
.badge {
    background: #f44336 !important;  /* Rot */
    color: #fff !important;
    font-size: 11px !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    position: absolute !important;
    top: -5px !important;
    right: -8px !important;
    min-width: 18px !important;
    text-align: center !important;
}

/* Dark Mode Toggle sichtbar machen */
.toggle-switch {
    opacity: 1 !important;
    visibility: visible !important;
}

/***************************************************************************
 * MOBILE STYLES FÜR MODAL
 ***************************************************************************/
@media (max-width: 768px) {
    /* Modal Content auf Mobile anpassen */
    .modal-content {
        width: 92%;
        max-width: 100%;
        margin: 5% auto;
        padding: 32px 20px 24px;
        border-radius: 20px;
    }
    
    /* Kleinere Formulare auf Mobile */
    .form-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }
    
    #loginForm, #registerForm {
        gap: 16px;
    }
    
    .form-field label {
        font-size: 0.9rem;
    }
    
    .form-field input {
        font-size: 1rem;
        padding: 12px 14px;
    }
    
    /* Buttons */
    #loginForm button[type="submit"],
    #registerForm button[type="submit"] {
        padding: 14px;
        font-size: 1rem;
    }
    
    /* Google Sign-In Button auf Mobile anpassen */
    .google-signin-wrapper {
        margin: 12px 0 0;
        padding: 0 10px;
    }
    
    #googleSignInDiv {
        width: 100%;
        max-width: 100%;
        padding: 4px 6px;
    }
    
    /* Google Sign-In iframe container responsive */
    #googleSignInDiv > div {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Close Button auf Mobile */
    .close-button {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    /* Toggle Text kleiner */
    #loginModal .toggle-panel p {
        font-size: 0.85rem;
    }
    
    /* HR und Texte anpassen */
    .modal-content hr {
        margin: 20px 0;
    }
    
    .modal-content p {
        font-size: 0.9rem;
        margin: 10px 0;
    }
}

/***************************************************************************
 * 6) SOCIAL LOGIN BUTTONS
 ***************************************************************************/
.social-login-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 280px; /* Safe width for mobile (320px - 40px padding) */
    margin: 0 auto;
}

.google-signin-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* PayPal Button Styling to match Google */
.social-login-label {
    text-align: center;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

body.darkmode .social-login-label {
    color: #aaa;
}

.paypal-signin-wrapper {
    width: 100%;
}

.paypal-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffc439;
    color: #003087;
    padding: 0 20px;
    border-radius: 20px; /* Pill shape to match Google */
    text-decoration: none;
    font-weight: 500;
    font-family: 'Roboto', sans-serif; /* Match Google font */
    width: 100%;
    height: 40px; /* Match Google standard height */
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.paypal-button:hover {
    background-color: #f2ba36;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.paypal-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.paypal-button svg {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    fill: #003087;
}

/* Dark mode adjustments for PayPal */
body.darkmode .paypal-button {
    filter: brightness(0.95);
}
body.darkmode .paypal-button:hover {
    filter: brightness(1);
}

/* Animation für Formular-Wechsel */
.form-container .form {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.form-container.sign-in-mode .form.sign-in {
    display: block;
    opacity: 1;
    animation: fadeIn 0.4s;
}

.form-container:not(.sign-in-mode) .form.sign-up {
    display: block;
    opacity: 1;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
