* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0a0a;
    --bg-secondary: #111111;
    --card: #141414;
    --card-hover: #1a1a1a;

    --text: #f2f2f0;
    --gray: #8a8a88;
    --gray-light: #b8b8b6;

    --border: #212121;
    --border-light: #2b2b2b;

    --accent: #ffffff;
    --accent-contrast: #0a0a0a;

    --danger: #e5484d;

    --shadow: rgba(0, 0, 0, .4);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    transition: background .3s ease, color .3s ease;
}


/* ==========================================
   BILDLAUFLEISTEN
========================================== */
/* Die vom System gezeichneten Leisten sind breit und hell und passen
   nicht zum Design — hier eine schmale, dezente Variante. */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

button, input, select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ==========================================
   LIGHT MODE
========================================== */

body.light {
    --bg: #fafafa;
    --bg-secondary: #f0f0ee;
    --card: #ffffff;
    --card-hover: #f7f7f6;

    --text: #111111;
    --gray: #737371;
    --gray-light: #52524f;

    --border: #e6e6e2;
    --border-light: #dadad5;

    --accent: #111111;
    --accent-contrast: #ffffff;

    --shadow: rgba(0, 0, 0, .08);
}


/* ==========================================
   REVEAL ANIMATION
========================================== */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .5s ease, transform .5s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================
   NAVBAR
========================================== */

.navbar {
    height: 76px;
    padding: 0 5%;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 10, .88);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background .3s ease, border .3s ease;
}

body.light .navbar {
    background: rgba(250, 250, 250, .9);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -.5px;
    line-height: 1;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* COUPON BUTTON (einziger farbiger Akzent in der Navigation) */

.btn-coupon {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    background: linear-gradient(95deg, #00c853, #1de9b6);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -.1px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 200, 83, .32);
    transition: transform .15s ease, box-shadow .2s ease;
}

.btn-coupon:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 22px rgba(0, 200, 83, .46);
}

.btn-coupon:active {
    transform: scale(.97);
}

.btn-coupon-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: couponPulse 1.9s ease-in-out infinite;
}

@keyframes couponPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .45; transform: scale(.75); }
}


/* SEARCH BUTTON */

.nav-search {
    height: 38px;
    border: 1px solid var(--border-light);
    background: var(--card);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    color: var(--gray);
    font-size: 11px;
    transition: border-color .2s ease;
}

.nav-search:hover {
    border-color: var(--gray);
}

.nav-search span:first-child {
    font-size: 18px;
}

.nav-search kbd {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 8px;
    color: var(--gray);
}


/* ADD LINK BUTTON */

.btn-add-link {
    height: 38px;
    border: 1px solid var(--border-light);
    background: var(--card);
    color: var(--text);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 13px;
    font-size: 11px;
    font-weight: 700;
    transition: background .2s ease, border-color .2s ease, transform .15s ease;
}

.btn-add-link span:first-child {
    font-size: 14px;
    font-weight: 800;
}

.btn-add-link:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}

.btn-add-link:active {
    transform: scale(.96);
}


/* LANGUAGE SWITCHER */

.lang-wrap {
    position: relative;
}

.lang-toggle {
    height: 38px;
    border: 1px solid var(--border-light);
    background: var(--card);
    color: var(--text);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    transition: background .2s ease;
}

.lang-toggle span:first-child {
    font-size: 14px;
}

.lang-toggle:hover {
    background: var(--card-hover);
}

.lang-toggle:active {
    transform: scale(.94);
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 15px 40px var(--shadow);
    z-index: 60;
    flex-direction: column;
    gap: 2px;
}

.lang-menu.open {
    display: flex;
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    transition: background .15s ease, color .15s ease;
}

.lang-option:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.lang-option.active {
    color: var(--text);
    background: var(--bg-secondary);
}


/* THEME / ADMIN BUTTONS */

.theme-toggle,
.admin-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-light);
    background: var(--card);
    color: var(--text);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background .2s ease, transform .2s ease;
}

.theme-toggle:hover {
    background: var(--card-hover);
}

.admin-toggle:hover {
    background: var(--card-hover);
}

.icon-key {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.icon-x {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.icon-x path {
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    fill: none;
}

.admin-toggle:active,
.theme-toggle:active {
    transform: scale(.92);
}


/* MOBILE MENU */

.menu-button {
    display: none;
    width: 38px;
    height: 38px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 10px 5%;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a,
.mobile-nav button {
    padding: 13px 4px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.mobile-nav button:last-child {
    border-bottom: none;
}

.mobile-nav .mobile-coupon {
    margin-bottom: 6px;
    padding: 13px 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(95deg, #00c853, #1de9b6);
    color: #fff;
    font-weight: 800;
    text-align: center;
}


/* ==========================================
   HERO
========================================== */

.hero {
    text-align: center;
    padding: 120px 20px 100px;
    border-bottom: 1px solid var(--border);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid var(--border-light);
    background: var(--card);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-light);
    margin-bottom: 25px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-light);
}

.hero h1 {
    font-size: clamp(45px, 7vw, 88px);
    line-height: .92;
    letter-spacing: -5px;
    font-weight: 900;
}

.hero h1 .muted {
    color: var(--gray);
}

.hero-description {
    max-width: 490px;
    margin: 24px auto 32px;
    color: var(--gray);
    font-size: 14px;
    line-height: 1.6;
}


/* HERO SEARCH */

.hero-search {
    width: min(650px, 100%);
    height: 58px;
    margin: auto;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 5px 6px 5px 17px;
    box-shadow: 0 12px 50px var(--shadow);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.hero-search:focus-within {
    border-color: var(--gray);
}

.search-icon {
    font-size: 23px;
    color: var(--gray);
}

.hero-search input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 12px;
    font-size: 12px;
    background: transparent;
    color: var(--text);
}

.hero-search input::placeholder {
    color: var(--gray);
    opacity: .7;
}

.hero-search button {
    height: 46px;
    padding: 0 20px;
    border: none;
    border-radius: 7px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 11px;
    font-weight: 800;
    transition: opacity .2s ease, transform .15s ease;
}

.hero-search button:hover {
    opacity: .85;
}

.hero-search button:active {
    transform: scale(.96);
}


/* POPULAR */

.popular-searches {
    margin-top: 17px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 10px;
    color: var(--gray);
}

.popular-searches button {
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s ease;
}

.popular-searches button:hover {
    color: var(--text);
}


/* ==========================================
   SECTIONS
========================================== */

.section {
    max-width: 1250px;
    margin: auto;
    padding: 75px 25px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 27px;
}

.section-label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--gray);
    margin-bottom: 8px;
}

.section-heading h2 {
    font-size: 26px;
    letter-spacing: -1.2px;
}

.section-heading > a {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color .2s ease;
}

.section-heading > a:hover {
    color: var(--text);
}

.product-count {
    font-size: 10px;
    color: var(--gray);
}


/* ==========================================
   CATEGORIES
========================================== */

.categories-section {
    padding-bottom: 35px;
}

.category-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category {
    border: 1px solid var(--border-light);
    background: var(--card);
    padding: 11px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray);
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.cat-icon {
    display: flex;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.cat-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.category:hover,
.category.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}


/* ==========================================
   PRODUCTS
========================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 80px;
    text-align: center;
    color: var(--gray);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 11px;
}

.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--gray);
    box-shadow: 0 20px 50px var(--shadow);
}

.product-image {
    height: 300px;
    background: var(--bg-secondary);
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.product-card:hover img {
    transform: scale(1.035);
}

.product-tag {
    position: absolute;
    left: 10px;
    top: 10px;
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.product-heart {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50%;
    background: rgba(10,10,10,.72);
    color: white;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: background .2s ease, color .2s ease;
}

.product-heart:hover {
    background: var(--accent);
    color: var(--accent-contrast);
}

.product-delete {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--danger);
    background: rgba(10,10,10,.72);
    color: var(--danger);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: background .2s ease, color .2s ease;
}

body.is-admin .product-delete {
    display: flex;
}

.product-delete:hover {
    background: var(--danger);
    color: #fff;
}

.product-info {
    padding: 14px;
}

.product-category {
    font-size: 8px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 7px;
}

.product-name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-size: 13px;
    font-weight: 800;
}

.product-link {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 7px 9px;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 800;
}



/* ==========================================
   CTA
========================================== */

.cta {
    max-width: 1200px;
    margin: 30px auto 90px;
    padding: 55px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    box-shadow: 0 20px 60px var(--shadow);
}

.cta .section-label {
    color: var(--gray);
}

.cta h2 {
    font-size: 37px;
    line-height: 1;
    letter-spacing: -2px;
}

.cta p {
    color: var(--gray);
    margin-top: 16px;
    font-size: 12px;
    line-height: 1.6;
}

.cta button {
    flex-shrink: 0;
    background: var(--accent);
    color: var(--accent-contrast);
    border: none;
    border-radius: 7px;
    padding: 14px 18px;
    font-size: 10px;
    font-weight: 800;
    transition: opacity .2s ease;
}

.cta button:hover {
    opacity: .85;
}


/* ==========================================
   FOOTER
========================================== */

footer {
    border-top: 1px solid var(--border);
    padding: 35px 5% 25px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    font-size: 13px;
}

footer p {
    text-align: center;
    font-size: 10px;
    color: var(--gray);
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    gap: 17px;
}

.footer-links a {
    font-size: 10px;
    color: var(--gray);
    transition: color .2s ease;
}

.footer-links a:hover {
    color: var(--text);
}



/* ==========================================
   MODAL BASE
========================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(10px);
}

body.light .modal-overlay {
    background: rgba(0,0,0,.35);
}

.modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 5;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--gray);
    font-size: 17px;
    line-height: 1;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.modal-close:active {
    transform: scale(.9);
}


/* PRODUCT MODAL */

.product-modal {
    position: relative;
    width: 850px;
    max-width: calc(100% - 30px);
    max-height: 90vh;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 30px 100px rgba(0,0,0,.5);
    animation: modalIn .28s cubic-bezier(.2, .9, .3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Overlay blendet immer sanft mit ein. */
.modal-overlay {
    animation: overlayIn .28s ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Beim Schließen läuft die Bewegung rückwärts. Die Klasse wird per
   JavaScript gesetzt und nach Ende der Animation wieder entfernt. */
.modal.closing .modal-overlay {
    animation: overlayOut .2s ease forwards;
}

.modal.closing .product-modal {
    animation: modalOut .2s cubic-bezier(.4, 0, .8, .4) forwards;
}

@keyframes overlayOut {
    to { opacity: 0; }
}

@keyframes modalOut {
    to { opacity: 0; transform: translateY(8px) scale(.975); }
}

@media(prefers-reduced-motion: reduce) {
    .product-modal,
    .modal-overlay,
    .modal.closing .product-modal,
    .modal.closing .modal-overlay {
        animation: none;
    }
}

.modal-image {
    background: var(--bg-secondary);
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details {
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-category {
    color: var(--gray);
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.modal-details h2 {
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: -1px;
}

.modal-price {
    margin-top: 12px;
    font-size: 20px;
    font-weight: 800;
}

.modal-details p {
    color: var(--gray);
    font-size: 11px;
    line-height: 1.7;
    margin: 18px 0 28px;
}

.agent-title {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 9px;
}

.agent-links {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.agent-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.agent-button:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}

.agent-button span:last-child {
    font-size: 15px;
}

.admin-only {
    display: none;
}

body.is-admin .admin-only {
    display: block;
}

.danger-link {
    margin-top: 22px;
    background: none;
    border: none;
    color: var(--danger);
    font-size: 10px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ==========================================
   FORM PANELS (add link / admin login / admin panel)
========================================== */

.form-panel {
    position: relative;
    width: 460px;
    max-width: calc(100% - 30px);
    max-height: 90vh;
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 40px;
    box-shadow: 0 30px 100px rgba(0,0,0,.5);
    animation: modalIn .25s ease;
}

/* Bei niedrigen Fenstern alles etwas enger setzen, damit das Formular
   vollständig hineinpasst und gar nicht erst gescrollt werden muss. */
@media(max-height: 680px) {

    .form-panel {
        padding: 26px 28px 22px;
        max-height: 94vh;
    }

    .form-panel h3 {
        font-size: 18px;
    }

    .form-subtitle {
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group select,
    .custom-select-trigger {
        height: 40px;
    }

    .form-actions {
        margin-top: 16px;
    }

    .btn-primary {
        height: 42px;
    }
}

.form-panel-small {
    width: 380px;
}

.form-panel-large {
    width: 820px;
}

.form-panel h3 {
    font-size: 20px;
    letter-spacing: -.5px;
    margin-bottom: 6px;
}

.form-subtitle {
    color: var(--gray);
    font-size: 11px;
    margin-bottom: 26px;
}

.form-group {
    margin-bottom: 16px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 7px;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 8px;
    font-size: 12px;
    outline: none;
    transition: border-color .2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--gray);
}


/* EIGENE AUSWAHL-PFEILE
   Der native Pfeil sieht in jedem Browser anders aus (oft als weißer
   Kasten im dunklen Design), deshalb ersetzen wir ihn durch ein
   eigenes Chevron als Hintergrundbild. */

.form-group select,
.admin-edit-row select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%238a8a88' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    cursor: pointer;
}

body.light .form-group select,
body.light .admin-edit-row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%23737371' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}


/* EIGENE AUSWAHLLISTE
   Die aufgeklappte Liste eines nativen <select> lässt sich nicht
   gestalten — Hintergrund und blaue Markierung kommen vom System.
   Deshalb bleibt das echte Feld unsichtbar als Wertspeicher bestehen
   und darüber liegt eine eigene, animierte Liste. */

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select > select {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 8px;
    font-size: 12px;
    text-align: left;
    transition: border-color .2s ease;
}

.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
    border-color: var(--gray);
}

.custom-select-trigger svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--gray);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .22s ease;
}

.custom-select.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 16px 40px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;

    /* Im zugeklappten Zustand muss die Liste wirklich null Höhe haben.
       Sonst ragt sie unsichtbar über den Rand des Formulars hinaus und
       erzeugt dort eine überflüssige Bildlaufleiste. */
    max-height: 0;
    padding: 0 6px;
    overflow: hidden;
    visibility: hidden;

    opacity: 0;
    transform: translateY(-6px) scale(.985);
    transform-origin: top center;
    pointer-events: none;
    transition:
        opacity .18s ease,
        transform .18s ease,
        max-height .18s ease,
        padding .18s ease,
        visibility .18s;
}

/* Klappt nach oben auf, wenn unten zu wenig Platz ist. */
.custom-select.drop-up .custom-select-menu {
    top: auto;
    bottom: calc(100% + 6px);
    transform: translateY(6px) scale(.985);
    transform-origin: bottom center;
}

.custom-select.open .custom-select-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
    padding: 6px;
    overflow-y: auto;
}

.custom-select-option {
    flex-shrink: 0;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray);
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    transition: background .15s ease, color .15s ease;
}

/* Graue Hervorhebung statt des blauen Systembalkens. */
.custom-select-option:hover,
.custom-select-option:focus-visible {
    background: var(--bg-secondary);
    color: var(--text);
    outline: none;
}

.custom-select-option.selected {
    background: var(--card-hover);
    color: var(--text);
}

body.light .custom-select-option:hover,
body.light .custom-select-option.selected {
    background: var(--bg-secondary);
}

/* Kompaktere Variante im Admin-Panel */
.admin-edit-row .custom-select-trigger {
    height: 34px;
    padding: 0 10px;
    background: var(--card);
    border-radius: 6px;
    font-size: 11px;
}

/* Nur im aufgeklappten Zustand begrenzen — zugeklappt muss die Höhe
   null bleiben, damit keine Bildlaufleiste entsteht. */
.admin-edit-row .custom-select.open .custom-select-menu {
    max-height: 170px;
}


/* EIGENE ZAHLEN-PFEILE
   Die nativen Spinner werden ausgeblendet und durch zwei schmale
   Schaltflächen ersetzt, die zum Design passen. */

.form-group input[type="number"],
.admin-edit-row input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button,
.admin-edit-row input[type="number"]::-webkit-outer-spin-button,
.admin-edit-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-field {
    position: relative;
}

.number-field input {
    padding-right: 36px;
}

.number-stepper {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.number-stepper button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--gray);
    transition: background .15s ease, color .15s ease;
}

.number-stepper button:hover {
    background: var(--card-hover);
    color: var(--text);
}

.number-stepper button:active {
    transform: scale(.9);
}

.number-stepper svg {
    width: 10px;
    height: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.form-actions {
    margin-top: 22px;
}

.btn-primary {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 11px;
    font-weight: 800;
    transition: opacity .2s ease, transform .15s ease;
}

.btn-primary:hover {
    opacity: .85;
}

.btn-primary:active {
    transform: scale(.98);
}

.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-secondary {
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    transition: background .2s ease;
}

.btn-secondary:hover {
    background: var(--card-hover);
}

.btn-danger {
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    transition: opacity .2s ease, transform .15s ease;
}

.btn-danger:hover {
    opacity: .85;
}

.btn-danger:active {
    transform: scale(.97);
}

.confirm-panel {
    width: 380px;
}

.confirm-message {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}

.confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.confirm-actions button {
    flex: 1;
}

.form-error {
    margin-top: 12px;
    font-size: 10px;
    color: var(--danger);
    min-height: 14px;
}


/* EIGENE FELD-HINWEISE
   Ersetzt die gelbe Sprechblase des Browsers ("Fülle dieses Feld aus"),
   die sich nicht gestalten lässt und in jedem Browser anders aussieht. */

.form-group.invalid input,
.form-group.invalid .custom-select-trigger {
    border-color: var(--danger);
}

.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: 10px;
    font-weight: 600;
    color: var(--danger);
    animation: fieldErrorIn .2s ease;
}

.field-error::before {
    content: "";
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--danger);
    /* Ausrufezeichen als Maske, damit kein Bild nötig ist. */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='6' fill='black'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 0a6 6 0 100 12A6 6 0 006 0zm-.75 2.6h1.5l-.2 4.2h-1.1l-.2-4.2zM6 8.2a.85.85 0 110 1.7.85.85 0 010-1.7z' fill='black'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 0a6 6 0 100 12A6 6 0 006 0zm-.75 2.6h1.5l-.2 4.2h-1.1l-.2-4.2zM6 8.2a.85.85 0 110 1.7.85.85 0 010-1.7z' fill='black'/%3E%3C/svg%3E") center/contain no-repeat;
}

@keyframes fieldErrorIn {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media(prefers-reduced-motion: reduce) {
    .field-error { animation: none; }
}


/* ADMIN PANEL */

.admin-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0 18px;
    border-bottom: 1px solid var(--border);
}

.admin-tab {
    background: none;
    border: none;
    padding: 10px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    transition: color .2s ease;
}

.admin-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.admin-tab-panel {
    min-height: 200px;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 440px;
    overflow: auto;
}

.admin-search {
    width: 100%;
    height: 40px;
    padding: 0 13px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 8px;
    font-size: 11px;
    outline: none;
    transition: border-color .2s ease;
}

.admin-search:focus {
    border-color: var(--gray);
}

.admin-list-summary {
    font-size: 10px;
    color: var(--gray);
    margin-bottom: 10px;
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.admin-list-item img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.admin-list-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-list-item-text {
    min-width: 0;
}

.admin-list-item-text strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-list-item-text span {
    font-size: 10px;
    color: var(--gray);
}

.admin-list-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.admin-list-item-delete,
.admin-list-item-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--card);
    color: var(--danger);
    transition: background .2s ease, color .2s ease;
}

.admin-list-item-delete:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.admin-list-item-btn {
    color: var(--gray);
}

.admin-list-item-btn:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}

.icon-edit,
.icon-refresh {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.icon-refresh circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.admin-edit-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 4px 0;
}

.admin-edit-row input,
.admin-edit-row select {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-light);
    /* Nur die Farbe setzen — die Kurzschreibweise "background" würde
       das eigene Chevron-Hintergrundbild des Auswahlfelds löschen. */
    background-color: var(--card);
    color: var(--text);
    border-radius: 6px;
    font-size: 11px;
    outline: none;
}

.admin-edit-row select {
    padding-right: 30px;
    background-position: right 10px center;
}

.admin-edit-row input:focus,
.admin-edit-row select:focus {
    border-color: var(--gray);
}

.admin-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.admin-edit-actions button {
    flex: 1;
    height: 32px;
    font-size: 10px;
}

.admin-add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.admin-add-form input {
    flex: 1;
    min-width: 120px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 8px;
    font-size: 11px;
    outline: none;
}

.admin-add-form button {
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
}

.admin-panel-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}


/* ==========================================
   WELCOME / REFERRAL POPUP
========================================== */

/* Eigene Farbpalette nur für dieses Popup — der Rest der Seite
   bleibt bewusst monochrom. */
.welcome-panel {
    --c1: #00e676;
    --c2: #7bed8f;
    --c3: #00c853;
    --c4: #b9f6ca;
    --c5: #1de9b6;

    position: relative;
    width: 372px;
    max-width: calc(100% - 30px);
    max-height: 92vh;
    overflow: hidden;
    padding: 30px 28px 20px;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
    animation: welcomeIn .35s cubic-bezier(.2, .9, .3, 1);
}

@keyframes welcomeIn {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Farbiger Lichtschein am oberen Rand */
.welcome-panel::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto -20%;
    height: 180px;
    background: radial-gradient(
        ellipse at 50% 100%,
        rgba(0, 230, 118, .20),
        rgba(29, 233, 182, .10) 45%,
        transparent 70%
    );
    pointer-events: none;
}

/* KONFETTI */

.welcome-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 16px;
}

.confetti-piece {
    position: absolute;
    top: -14px;
    width: 7px;
    height: 11px;
    opacity: 0;
    animation: confettiFall linear forwards;
}

.confetti-piece.round {
    border-radius: 50%;
    width: 7px;
    height: 7px;
}

@keyframes confettiFall {
    0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
    8%   { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(420px) rotate(560deg); }
}

/* INHALT */

.welcome-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--c5), var(--c3));
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.welcome-amount {
    position: relative;
    margin: 18px 0 2px;
    font-size: 62px;
    font-weight: 900;
    letter-spacing: -3.5px;
    line-height: 1;
    background: linear-gradient(95deg, var(--c1), var(--c2) 35%, var(--c3) 70%, var(--c5));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.welcome-amount-label {
    position: relative;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--gray-light);
}

.welcome-panel > p {
    position: relative;
    margin: 14px 0 20px;
    font-size: 12px;
    line-height: 1.65;
    color: var(--gray);
}

.welcome-cta {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    padding: 15px 18px;
    border-radius: 10px;
    background: linear-gradient(95deg, var(--c5), var(--c3));
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: -.2px;
    box-shadow: 0 8px 26px rgba(0, 200, 83, .34);
    transition: transform .15s ease, box-shadow .2s ease;
}

.welcome-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(0, 200, 83, .46);
}

.welcome-cta:active {
    transform: scale(.985);
}

/* Lichtreflex, der über den Button wandert */
.welcome-cta::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent);
    animation: welcomeShine 2.8s ease-in-out infinite;
}

@keyframes welcomeShine {
    0%, 62% { left: -60%; }
    100%    { left: 130%; }
}

.welcome-dismiss {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 11px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 11px;
    font-weight: 600;
    transition: color .2s ease;
}

.welcome-dismiss:hover {
    color: var(--text);
}

.welcome-hide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    user-select: none;
    transition: color .2s ease;
}

.welcome-hide:hover {
    color: var(--text);
}

/* Die echte Checkbox bleibt für Tastatur und Screenreader erhalten,
   wird aber visuell durch .welcome-hide-box ersetzt. */
.welcome-hide input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.welcome-hide-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 1.5px solid var(--border-light);
    border-radius: 5px;
    background: var(--bg-secondary);
    transition: background .18s ease, border-color .18s ease, transform .15s ease;
}

.welcome-hide-box svg {
    width: 11px;
    height: 11px;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .18s ease, transform .18s ease;
}

.welcome-hide-box svg path {
    fill: none;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.welcome-hide:hover .welcome-hide-box {
    border-color: var(--c3);
}

.welcome-hide input:checked + .welcome-hide-box {
    background: var(--c3);
    border-color: var(--c3);
}

.welcome-hide input:checked + .welcome-hide-box svg {
    opacity: 1;
    transform: scale(1);
}

.welcome-hide input:focus-visible + .welcome-hide-box {
    box-shadow: 0 0 0 3px rgba(0, 200, 83, .3);
}

.welcome-hide:active .welcome-hide-box {
    transform: scale(.9);
}

@media(prefers-reduced-motion: reduce) {
    .welcome-cta::after,
    .welcome-panel,
    .confetti-piece { animation: none; }
    .confetti-piece { opacity: 1; }
}

@media(max-width: 500px) {

    .welcome-panel {
        padding: 26px 20px 18px;
    }

    .welcome-amount {
        font-size: 52px;
        letter-spacing: -2.5px;
    }
}


/* ==========================================
   TOAST
========================================== */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 13px 20px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 200;
    box-shadow: 0 15px 40px rgba(0,0,0,.3);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.error {
    background: var(--danger);
    color: #fff;
}


/* ==========================================
   RESPONSIVE
========================================== */

@media(max-width: 1000px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width: 750px) {

    .nav-search {
        display: none;
    }

    /* Auf schmalen Bildschirmen wandert der Coupon-Button ins Menü,
       damit der Header nicht überläuft. */
    .btn-coupon {
        display: none;
    }

    .btn-add-link span:last-child {
        display: none;
    }

    .lang-toggle span:last-child {
        display: none;
    }

    .menu-button {
        display: block;
    }

    .hero {
        padding: 80px 18px 70px;
    }

    .hero h1 {
        letter-spacing: -3px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-image {
        height: 240px;
    }

    .cta {
        margin: 20px;
        padding: 35px 25px;
        flex-direction: column;
        align-items: flex-start;
    }

    footer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    footer p {
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .product-modal {
        grid-template-columns: 1fr;
        max-height: 92vh;
    }

    .modal-image {
        min-height: 300px;
        height: 300px;
    }

    .modal-details {
        padding: 25px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media(max-width: 500px) {

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-image {
        height: 210px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 10px;
    }

    .product-price {
        font-size: 11px;
    }

    .product-link {
        font-size: 7px;
    }

    .hero-search {
        height: 52px;
    }

    .hero-search button {
        height: 40px;
        padding: 0 13px;
    }

    .section {
        padding: 55px 15px;
    }

    .form-panel {
        padding: 28px 22px;
    }
}
