/* JK Immobilien — cookie consent banner & preferences modal.
   Matches the site palette: gold #ac906d, ink #1a1a1a, off-white #f8f4ee,
   Cormorant Garamond headings, Nunito Sans body. */

:root {
    --jk-gold: #ac906d;
    --jk-gold-dark: #8f7558;
    --jk-ink: #1a1a1a;
    --jk-body: #5e5e5e;
    --jk-cream: #f8f4ee;
}

/* ── Banner ─────────────────────────────────────────────────────────── */
.jk-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    padding: 24px clamp(16px, 5vw, 48px);
    background: #ffffff;
    border-top: 3px solid var(--jk-gold);
    box-shadow: 0 -8px 40px rgba(26, 26, 26, 0.14);
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.jk-consent-banner.is-visible {
    display: block;
    transform: translateY(0);
}
.jk-consent-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.jk-consent-text {
    flex: 1 1 420px;
}
.jk-consent-text h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 500;
    font-size: 1.6rem;
    color: var(--jk-ink);
    margin-bottom: 8px;
}
.jk-consent-text p {
    font-family: "Nunito Sans", system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--jk-body);
}
.jk-consent-text a {
    color: var(--jk-gold-dark);
    text-decoration: underline;
}
.jk-consent-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Buttons (Accept / Reject / Settings carry equal visual weight) ──── */
.jk-btn {
    font-family: "Nunito Sans", system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 13px 26px;
    border-radius: 6px;
    border: 1.5px solid var(--jk-gold);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    white-space: nowrap;
}
.jk-btn-primary {
    background: var(--jk-gold);
    color: #ffffff;
}
.jk-btn-primary:hover {
    background: var(--jk-gold-dark);
    border-color: var(--jk-gold-dark);
}
.jk-btn-secondary {
    background: #ffffff;
    color: var(--jk-gold-dark);
}
.jk-btn-secondary:hover {
    background: var(--jk-cream);
}
.jk-btn-text {
    background: transparent;
    border-color: transparent;
    color: var(--jk-body);
    text-decoration: underline;
    padding: 13px 12px;
}
.jk-btn-text:hover {
    color: var(--jk-ink);
}

/* ── Preferences modal ──────────────────────────────────────────────── */
.jk-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(26, 26, 26, 0.55);
    backdrop-filter: blur(3px);
}
.jk-consent-modal.is-visible {
    display: flex;
}
.jk-consent-dialog {
    background: #ffffff;
    border-radius: 12px;
    max-width: 620px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: clamp(24px, 4vw, 40px);
    box-shadow: 0 30px 80px rgba(26, 26, 26, 0.35);
}
.jk-consent-dialog h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 500;
    font-size: 1.9rem;
    color: var(--jk-ink);
    margin-bottom: 10px;
}
.jk-consent-dialog > p {
    font-family: "Nunito Sans", system-ui, sans-serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--jk-body);
    margin-bottom: 24px;
}
.jk-consent-dialog > p a {
    color: var(--jk-gold-dark);
    text-decoration: underline;
}

.jk-cat {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-top: 1px solid #ece5da;
}
.jk-cat-info {
    flex: 1;
}
.jk-cat-info h3 {
    font-family: "Nunito Sans", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--jk-ink);
    margin-bottom: 4px;
}
.jk-cat-info p {
    font-family: "Nunito Sans", system-ui, sans-serif;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--jk-body);
}

/* Toggle switch */
.jk-switch {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 26px;
    margin-top: 2px;
}
.jk-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.jk-switch .jk-slider {
    position: absolute;
    inset: 0;
    background: #cfcabf;
    border-radius: 26px;
    transition: background 0.25s ease;
    pointer-events: none;
}
.jk-switch .jk-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s ease;
}
.jk-switch input:checked + .jk-slider {
    background: var(--jk-gold);
}
.jk-switch input:checked + .jk-slider::before {
    transform: translateX(22px);
}
.jk-switch input:disabled {
    cursor: not-allowed;
}
.jk-switch input:disabled + .jk-slider {
    background: var(--jk-gold);
    opacity: 0.55;
}

.jk-consent-dialog-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #ece5da;
}

/* ── Blocked third-party content placeholder ────────────────────────── */
.consent-blocked .consent-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    min-height: 280px;
    padding: 32px;
    background: var(--jk-cream);
    border: 1px dashed #d8cdbd;
    border-radius: 12px;
}
.consent-blocked.consent-granted .consent-placeholder {
    display: none;
}
.consent-placeholder p {
    font-family: "Nunito Sans", system-ui, sans-serif;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--jk-body);
    max-width: 460px;
}
.consent-placeholder a {
    color: var(--jk-gold-dark);
    text-decoration: underline;
}
.consent-placeholder-hint {
    font-size: 0.82rem !important;
}

/* Embeds (iframe or Leaflet container) stay hidden until consent is granted. */
.consent-blocked .consent-embed {
    display: none;
}
.consent-blocked.consent-granted .consent-embed {
    display: block;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .jk-consent-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }
    /* In the column layout the 420px flex-basis would become a forced height,
       leaving a big empty gap above the buttons — size to content instead. */
    .jk-consent-text {
        flex: 0 0 auto;
    }
    .jk-consent-actions {
        justify-content: stretch;
    }
    .jk-consent-actions .jk-btn-primary,
    .jk-consent-actions .jk-btn-secondary {
        flex: 1 1 140px;
    }
    .jk-consent-actions .jk-btn-text {
        flex-basis: 100%;
        text-align: center;
    }
    .jk-consent-dialog-actions .jk-btn {
        flex: 1 1 140px;
        text-align: center;
    }
}
