#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #111;
    color: #e8e8e8;
    padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom)) 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: inherit;
    font-size: 0.85rem;
    z-index: 9999;
    border-top: 1px solid rgba(255,255,255,0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 60vh;
    overflow-y: auto;
    z-index: 999999 !important;
}

#cookie-banner.visible {
    transform: translateY(0);
}

#cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 200px;
    line-height: 1.5;
    color: #b0b0b0;
}

#cookie-banner a {
    color: #c8a96e;
    text-decoration: underline;
    text-underline-offset: 2px;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

#cookie-banner a:focus-visible {
    outline: 2px solid #c8a96e;
    outline-offset: 2px;
    border-radius: 2px;
}

.cookie-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.cookie-btn {
   
    padding: 0.6rem 1rem;
    min-height: 44px;
    min-width: 44px;
    width: 100% !important;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: #e8e8e8;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: normal;
    border-radius: 2px;
    word-wrap: break-word;
}

.cookie-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.35);
}

.cookie-btn:focus-visible {
    outline: 2px solid #c8a96e;
    outline-offset: 2px;
}

.cookie-btn.primary {
    background: #fff;
    border-color: #fff;
    color: #111;
}

.cookie-btn.primary:hover {
    background: lightgray;
    border-color: darkgray;
}

/* ── Cookie Settings Modal ── */
#cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

#cookie-modal-overlay.open {
    display: flex;
}

#cookie-modal {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
    width: 100%;
    max-width: 620px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem 2rem calc(2rem + env(safe-area-inset-bottom));
    font-size: 0.88rem;
    color: #ccc;
    border-radius: 12px 12px 0 0;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

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

#cookie-modal h3 {
    margin: 0 0 0.3rem;
    font-size: clamp(1rem, 3vw, 1.1rem);
    color: #f0f0f0;
    font-weight: 500;
    letter-spacing: 0.02em;
}

#cookie-modal .modal-intro {
    color: #888;
    font-size: 0.82rem;
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

#cookie-modal .modal-intro a {
    color: #fff !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Cookie category rows */
.cookie-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.cookie-category:first-of-type {
    border-top: none;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info strong {
    display: block;
    color: #e8e8e8;
    font-weight: 500;
    margin-bottom: 0.2rem;
    font-size: 0.88rem;
}

.cookie-category-info p {
    margin: 0;
    color: lightgray;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #333;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.25s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #888;
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: rgba(200, 169, 110, 0.25);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(18px);
    background: hotpink;
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
    opacity: 0.5;
}

.cookie-toggle input:disabled + .cookie-toggle-slider::before {
    background: #fafafa;
}


.cookie-toggle input:focus-visible + .cookie-toggle-slider {
    outline: 3px solid #c8a96e;
    outline-offset: 2px;
    border-radius: 22px;
}

.required-tag {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #555;
    margin-left: 0.4rem;
    vertical-align: middle;
}


.modal-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

/* ── Responsive ── */

@media (min-width: 576px) {
    .cookie-banner-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    .cookie-btn {
        width: auto !important;
    }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
    #cookie-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        font-size: 0.82rem;
    }

    #cookie-banner p {
        min-width: 0;
    }

    .cookie-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .cookie-btn {
        flex: 1;
        text-align: center;
        font-size: 0.75rem;
    }

    #cookie-modal {
        padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
        font-size: 0.85rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .cookie-btn {
        width: 100%;
        text-align: center;
    }
}

/* Landscape phone */
@media (max-height: 430px) and (orientation: landscape) {
    #cookie-banner {
        flex-direction: row;
        flex-wrap: nowrap;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        font-size: 0.78rem;
    }

    #cookie-banner p {
        min-width: 0;
        font-size: 0.75rem;
    }

    #cookie-modal {
        max-height: 90vh;
        border-radius: 8px 8px 0 0;
    }
}