/* ============================================================
   BidSeek Cookie Consent — Banner + Preferences Modal
   Uses existing CSS variables from ap.css (:root / [data-theme="dark"])
   ============================================================ */

/* ── Banner ────────────────────────────────────────────── */

#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 16px var(--shadow);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    font-family: inherit;
}

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

.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cc-banner-text {
    flex: 1;
    min-width: 0;
}

.cc-banner-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.cc-banner-text a {
    color: var(--primary);
    text-decoration: underline;
}

.cc-banner-text a:hover {
    color: var(--primary-dark);
}

.cc-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Buttons ───────────────────────────────────────────── */

.cc-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.cc-btn-primary {
    background: var(--primary);
    color: #fff;
}

.cc-btn-primary:hover {
    background: var(--button-hover);
}

.cc-btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.cc-btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Modal Overlay ─────────────────────────────────────── */

#cookie-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#cookie-consent-modal.cc-visible {
    opacity: 1;
    pointer-events: auto;
}

.cc-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* ── Modal Box ─────────────────────────────────────────── */

.cc-modal {
    position: relative;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

#cookie-consent-modal.cc-visible .cc-modal {
    transform: translateY(0);
}

.cc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.cc-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.cc-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.cc-modal-close:hover {
    color: var(--text);
}

.cc-modal-body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.cc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* ── Cookie Category Rows ──────────────────────────────── */

.cc-category {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.cc-category:last-child {
    border-bottom: none;
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cc-category-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-category-info strong {
    font-size: 14px;
    color: var(--text);
}

.cc-always-on {
    font-size: 11px;
    font-weight: 600;
    color: var(--success-bg);
    background: rgba(72, 187, 120, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cc-category-desc {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ── Toggle Switch ─────────────────────────────────────── */

.cc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.cc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cc-toggle input:checked + .cc-toggle-slider {
    background: var(--primary);
}

.cc-toggle input:checked + .cc-toggle-slider::before {
    transform: translateX(20px);
}

.cc-toggle input:focus-visible + .cc-toggle-slider {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Footer Privacy Choices Link ───────────────────────── */

.footer-privacy-choices {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
}

.footer-privacy-choices:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
    .cc-banner-inner {
        flex-direction: column;
        text-align: center;
        padding: 16px;
        gap: 12px;
    }

    .cc-banner-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .cc-btn {
        padding: 10px 16px;
        font-size: 13px;
        flex: 1;
        min-width: 100px;
    }

    .cc-modal {
        width: 95%;
        max-height: 90vh;
    }

    .cc-modal-header,
    .cc-modal-body,
    .cc-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cc-category-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
