/* ==========================================================================
   Das passende Geschenk – Stylesheet
   ========================================================================== */

:root {
    --brand: #991b91;          /* Magenta aus dem Logo (Geschenkband) */
    --brand-dark: #6a1464;
    --brand-light: #f8ecf6;
    --brand-ink: #32143e;      /* Dunkellila aus dem Logo-Schriftzug */
    --accent: #f0a23b;
    --text: #241a2b;
    --muted: #6b6573;
    --line: #e7e2ea;
    --bg: #ffffff;
    --bg-soft: #faf7fb;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(35, 32, 42, .06), 0 4px 16px rgba(35, 32, 42, .06);
    --shadow-hover: 0 2px 4px rgba(35, 32, 42, .08), 0 10px 28px rgba(35, 32, 42, .12);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 820px; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    padding: .7em 1.3em;
    border: 2px solid transparent; border-radius: 999px;
    font: inherit; font-weight: 600; line-height: 1.1;
    text-decoration: none; cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-sm { padding: .5em .9em; font-size: .875rem; }
.btn:disabled { opacity: .6; cursor: progress; }

/* --- Kopfzeile ---------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { display: block; height: 44px; width: auto; }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:hover { color: var(--brand); }

@media (max-width: 640px) {
    .site-nav a:not(:first-child) { display: none; }
    .site-header-inner { height: 58px; }
    .brand img { height: 36px; }
}
@media (max-width: 480px) {
    .site-nav { display: none; }
    .brand img { height: 34px; }
}

/* --- Hero + Suche ------------------------------------------------------- */
.hero {
    padding: 48px 0 32px;
    background:
        radial-gradient(1200px 300px at 10% -10%, rgba(240, 162, 59, .18), transparent 60%),
        linear-gradient(180deg, var(--brand-light), var(--bg-soft));
    text-align: center;
}
.hero h1 { font-size: clamp(1.75rem, 4.5vw, 2.75rem); letter-spacing: -.02em; }
.lead { max-width: 680px; margin: 0 auto 1.5rem; color: var(--muted); font-size: 1.075rem; }

.search {
    display: flex; gap: .5rem;
    max-width: 600px; margin: 0 auto;
    padding: 6px; background: #fff;
    border: 1px solid var(--line); border-radius: 999px;
    box-shadow: var(--shadow);
}
.search-input {
    flex: 1; min-width: 0;
    border: 0; outline: 0; background: transparent;
    padding: .55em 1em; font: inherit; color: var(--text);
}
.search:focus-within { border-color: var(--brand); }

/* --- Geschenkfinder (Filter-Chips) -------------------------------------- */
.finder { background: var(--bg-soft); padding: 8px 0 24px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.filter-group { display: flex; align-items: center; gap: 1rem; padding: 8px 0; }
.filter-label {
    flex: 0 0 90px;
    font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}

/* Jede Filterzeile ist ein horizontaler Slider */
.chips-slider { position: relative; flex: 1; min-width: 0; }
.chips {
    display: flex; flex-wrap: nowrap; gap: .5rem;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scroll-behavior: smooth;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding: 2px 0 4px;
}
.chips::-webkit-scrollbar { display: none; }
.chips > .chip { scroll-snap-align: start; flex: none; }

/* Weicher Rand als Hinweis, dass es weitergeht */
.chips-slider.can-prev .chips { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px); mask-image: linear-gradient(to right, transparent, #000 48px); }
.chips-slider.can-next .chips { -webkit-mask-image: linear-gradient(to left, transparent, #000 48px); mask-image: linear-gradient(to left, transparent, #000 48px); }
.chips-slider.can-prev.can-next .chips {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}

.chips-arrow {
    position: absolute; top: 50%; z-index: 2;
    width: 34px; height: 34px; margin-top: -18px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--text);
    border: 1px solid var(--line); border-radius: 50%;
    box-shadow: var(--shadow); cursor: pointer;
}
.chips-arrow:hover { color: var(--brand); border-color: var(--brand); }
.chips-arrow svg { width: 20px; height: 20px; fill: currentColor; }
.chips-arrow-prev { left: -4px; }
.chips-arrow-next { right: -4px; }
.chips-arrow[hidden] { display: none; }
/* Auf Touch-Geräten wird gewischt – keine Pfeile */
@media (hover: none) { .chips-arrow { display: none; } }

.chip {
    display: inline-flex; align-items: center; gap: .35em;
    padding: .4em .95em;
    background: #fff; color: var(--text);
    border: 1px solid var(--line); border-radius: 999px;
    font-size: .925rem; text-decoration: none; white-space: nowrap;
    transition: border-color .15s, background-color .15s, color .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-x { font-size: 1.1em; line-height: 1; opacity: .85; }
.reset-link { display: inline-block; margin-top: .5rem; font-size: .9rem; }

/* --- Preis-Slider (zwei übereinanderliegende Range-Inputs) -------------- */
.price-filter { margin: 0; }
.price-control { display: flex; align-items: center; gap: 1.25rem; flex: 1; min-width: 0; max-width: 560px; }
.price-slider {
    /* --a / --b: Position der Regler von 0 bis 1 (setzt app.js); 11px = halbe Reglerbreite */
    --a: 0; --b: 1;
    --from: calc(11px + var(--a) * (100% - 22px));
    --to: calc(11px + var(--b) * (100% - 22px));
    position: relative; flex: 1; height: 32px; min-width: 0;
}
/* Schiene + markierter Bereich */
.price-slider::before {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px;
    border-radius: 3px;
    background: linear-gradient(to right,
        var(--line) var(--from), var(--brand) var(--from),
        var(--brand) var(--to), var(--line) var(--to));
}
.price-slider input[type="range"] {
    position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
    background: none; pointer-events: none;
    -webkit-appearance: none; appearance: none;
}
.price-slider input[type="range"]::-webkit-slider-runnable-track { background: none; height: 32px; }
.price-slider input[type="range"]::-moz-range-track { background: none; }
.price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: auto; cursor: grab;
    width: 22px; height: 22px; margin-top: 5px; border-radius: 50%;
    background: #fff; border: 2px solid var(--brand); box-shadow: var(--shadow);
}
.price-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto; cursor: grab;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 2px solid var(--brand); box-shadow: var(--shadow);
}
.price-slider input[type="range"]:focus-visible { outline: none; }
.price-slider input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.price-slider input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.price-output { flex: none; min-width: 110px; font-weight: 600; font-size: .925rem; white-space: nowrap; }

@media (max-width: 640px) {
    .price-control { max-width: none; width: 100%; gap: 1rem; }
    .price-output { min-width: 90px; text-align: right; }
}

@media (max-width: 640px) {
    .filter-group { flex-direction: column; align-items: stretch; gap: .4rem; }
    .filter-label { flex: none; }
    /* Slider läuft bis an den Bildschirmrand */
    .chips-slider { margin: 0 -16px; }
    .chips { padding: 2px 16px 6px; scroll-padding: 0 16px; }
}

/* --- Ergebnisse --------------------------------------------------------- */
.results { padding: 32px 0 16px; }
.results-title { font-size: 1.35rem; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
@media (max-width: 520px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

.card {
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-media {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1; padding: 16px; background: #fff;
}
.card-media img { max-height: 100%; width: auto; object-fit: contain; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.card-title {
    font-size: .925rem; font-weight: 500; line-height: 1.4; margin: 0 0 .75rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--brand); }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.price { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.card-price { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.price:empty { display: none; }
.card-shop { font-size: .75rem; color: var(--muted); white-space: nowrap; }

@media (max-width: 520px) {
    .card-media { padding: 10px; }
    .card-body { padding: 10px; }
    .card-title { font-size: .85rem; }
    .card-footer .btn { width: 100%; }
}

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.results-head .results-title { margin-bottom: 0; }
.ad-label {
    flex: none; padding: .15em .6em;
    font-size: .75rem; font-weight: 600; color: var(--muted);
    border: 1px solid var(--line); border-radius: 4px; background: var(--bg-soft);
}

/* --- Produkt-Modal ------------------------------------------------------ */
.product-modal {
    width: min(860px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
    padding: 0; border: 0; border-radius: var(--radius);
    color: var(--text); background: #fff;
    box-shadow: 0 24px 64px rgba(35, 32, 42, .3);
    overflow: auto; overscroll-behavior: contain;
}
.product-modal::backdrop { background: rgba(35, 20, 34, .55); backdrop-filter: blur(2px); }
html:has(.product-modal[open]) { overflow: hidden; }

.product-modal[open] { animation: pm-in .2s ease-out; }
@keyframes pm-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.pm-inner { position: relative; display: grid; grid-template-columns: 1fr 1.1fr; }
.pm-close {
    position: absolute; top: 10px; right: 10px; z-index: 1;
    width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9);
    font-size: 1.75rem; line-height: 1; color: var(--text); cursor: pointer;
}
.pm-close:hover { background: var(--brand-light); color: var(--brand); }
.pm-media {
    position: sticky; top: 0; align-self: start;
    display: flex; align-items: center; justify-content: center;
    padding: 32px; background: #fff;
}
.pm-media img { max-height: 380px; width: auto; object-fit: contain; }
.pm-info { display: flex; flex-direction: column; padding: 32px 28px 24px; border-left: 1px solid var(--line); }
.pm-brand { margin: 0 0 .25rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.pm-brand:empty { display: none; }
.pm-title {
    font-size: 1.15rem; font-weight: 600; line-height: 1.4; margin: 0 2rem .75rem 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pm-price { margin: 0; font-size: 1.6rem; font-weight: 700; }
.pm-price:has(span:empty) { display: none; }
.pm-stand { margin: 0 0 1rem; font-size: .75rem; color: var(--muted); }
.pm-shop-name {
    display: flex; align-items: center; gap: .4rem;
    margin: -.25rem 0 1rem; font-size: .85rem; color: var(--muted);
}
.pm-shop-name svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.pm-shop-name strong { color: var(--text); }
.pm-features { margin: 0 0 1.25rem; padding-left: 1.1rem; font-size: .9rem; color: #3b3742; }
.pm-features li { margin-bottom: .45rem; }
.pm-features:empty { display: none; }
/* Amazon-Button + Anzeige-Hinweis bleiben beim Scrollen im Modal immer sichtbar */
.pm-actions {
    position: sticky; bottom: 0; z-index: 1;
    margin: auto -28px -24px; padding: 14px 28px 18px;
    background: #fff; border-top: 1px solid var(--line);
}
.pm-shop { width: 100%; padding: .9em 1.3em; font-size: 1.05rem; }
.pm-shop svg { width: 18px; height: 18px; fill: currentColor; }
.pm-disclosure { margin: .6rem 0 0; font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.45; }
.pm-disclosure strong { color: var(--text); }

@media (max-width: 640px) {
    /* Auf dem Handy als Fenster von unten */
    .product-modal {
        width: 100%; max-width: 100%; max-height: 92dvh;
        margin: auto 0 0; border-radius: 18px 18px 0 0;
    }
    .product-modal[open] { animation: pm-up .25s ease-out; }
    @keyframes pm-up { from { transform: translateY(100%); } }
    .pm-inner { grid-template-columns: 1fr; }
    .pm-media { position: static; padding: 24px 24px 12px; }
    .pm-media img { max-height: 240px; }
    .pm-info { padding: 8px 20px 20px; border-left: 0; }
    /* Button bleibt beim Scrollen sichtbar */
    .pm-actions { position: sticky; bottom: 0; margin: 0 -20px -20px; padding: 12px 20px 16px; background: #fff; border-top: 1px solid var(--line); }
}

.load-more { text-align: center; margin: 32px 0 8px; }

/* --- Ladeanzeigen ------------------------------------------------------- */
.spinner {
    display: inline-block; flex: none;
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid var(--brand-light); border-top-color: var(--brand);
    animation: spin .8s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; border-color: currentColor; border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ladebalken oben, solange eine neue Seite geladen wird */
.page-loader {
    position: fixed; top: 0; left: 0; z-index: 100;
    width: 100%; height: 3px; pointer-events: none;
    background: linear-gradient(90deg, var(--brand), #c636ad, var(--brand));
    transform-origin: left; transform: scaleX(0); opacity: 0;
}
body.is-loading .page-loader { opacity: 1; animation: page-load 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes page-load { from { transform: scaleX(0); } to { transform: scaleX(.95); } }
.price-note { margin: 24px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }

.notice {
    padding: 1rem 1.25rem; border-radius: var(--radius-sm);
    background: var(--brand-light); border: 1px solid #e6cfe3;
}
.notice-error { background: #fff4e5; border-color: #f5d3a3; }

/* --- Hinweis auf Mein Online Wunschzettel ------------------------------ */
.wish-promo { padding: 8px 0 40px; }
.wish-promo-box {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
    padding: 24px 28px; border-radius: var(--radius);
    background: linear-gradient(120deg, var(--brand-light), #fff 70%);
    border: 1px solid #ecd3e8;
}
.wish-promo-icon {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand); box-shadow: 0 6px 18px rgba(153, 27, 145, .3);
}
.wish-promo-icon svg { width: 28px; height: 28px; fill: #fff; }
.wish-promo-kicker { margin: 0 0 .2rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.wish-promo h2 { font-size: 1.2rem; margin: 0 0 .35rem; color: var(--brand-ink); }
.wish-promo-text p:last-child { margin: 0; color: #3b3443; font-size: .95rem; }
.wish-promo-actions { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.wish-promo-actions .btn { white-space: nowrap; }
.wish-promo-stores { font-size: .8rem; color: var(--muted); }
.wish-promo-stores a { color: var(--muted); }
.wish-promo-stores a:hover { color: var(--brand); }

@media (max-width: 760px) {
    .wish-promo-box { grid-template-columns: 1fr; text-align: center; padding: 22px 18px; gap: 14px; }
    .wish-promo-icon { margin: 0 auto; }
    .wish-promo-actions .btn { white-space: normal; }
}

/* Button im Produkt-Modal */
.pm-wish { margin: 0 0 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.pm-wish .btn svg { width: 16px; height: 16px; fill: currentColor; }
.pm-wish-note { margin: .4rem 0 0; font-size: .75rem; color: var(--muted); }
.pm-wish-note.is-copied { color: #1f7a3a; }

/* Kopf-/Fußzeile */
.site-nav .nav-wish { color: var(--brand); font-weight: 600; }
@media (max-width: 900px) { .site-nav .nav-wish { display: none; } }
.footer-wish { margin-top: .6rem; font-size: .85rem; }
.footer-wish a { color: #fff; }

/* --- Ratgeber + FAQ ----------------------------------------------------- */
.guide { padding: 40px 0 8px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.guide h2 { font-size: 1.35rem; margin-top: 1.75rem; color: var(--brand-ink); }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
.guide p, .guide li { color: #3b3443; }
.faq { margin: 0 0 32px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 14px 0; cursor: pointer; list-style: none;
    font-weight: 600; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; flex: none; width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line); color: var(--brand); font-size: 1.1rem; font-weight: 500;
}
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { color: var(--brand); }
.faq details p { margin: 0 0 16px; }

/* --- Interne Links ------------------------------------------------------ */
.explore { padding: 32px 0 48px; }
.explore h2 { font-size: 1.15rem; }
.link-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.link-cloud a {
    display: inline-block; padding: .35em .85em;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
    font-size: .875rem; color: var(--text); text-decoration: none;
}
.link-cloud a:hover { border-color: var(--brand); color: var(--brand); }

/* --- Textseiten (Impressum, Datenschutz) -------------------------------- */
.page { padding: 40px 0 56px; }
.prose { overflow-wrap: break-word; }
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.3rem; margin-top: 2rem; }
.prose h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }
.prose .link-cloud { padding-left: 0; }

/* --- Fußzeile ----------------------------------------------------------- */
.site-footer { background: var(--brand-ink); color: #d9cfd8; padding: 40px 0 24px; font-size: .9rem; }
.site-footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-brand { color: #fff; font-size: 1.1rem; margin: 0 0 .5rem; }
.footer-brand { font-weight: 700; letter-spacing: -.01em; }
.footer-brand .fb-accent { color: #e48bd6; }
.footer-note { max-width: 520px; margin: 0; }
.footer-links { display: flex; flex-direction: column; gap: .4rem; }
.footer-links a { color: #fff; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; color: #fff; }
.footer-copy { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .8rem; color: #a99ca7; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
