/* ===== Cookie Consent — CookieYes-Style ===== */

/* ---------- Banner ---------- */
.ccn-consent-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9998;
    background: var(--white, #fff);
    border-top: 1px solid var(--border, #e7e5e4);
    box-shadow: 0 -4px 24px rgba(0,0,0,.08);
    transform: translateY(100%); opacity: 0;
    transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .35s ease;
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
}
.ccn-consent-banner.ccn-visible {
    transform: translateY(0); opacity: 1;
}

.ccn-consent-inner {
    max-width: var(--container, 1200px);
    margin: 0 auto;
    padding: 24px;
}

.ccn-consent-text { margin-bottom: 20px; }
.ccn-consent-text h3 {
    font-size: 17px; font-weight: 700; color: var(--ink-900, #0a0a0a);
    margin: 0 0 8px; letter-spacing: -0.01em; line-height: 1.3;
}
.ccn-consent-text p {
    font-size: 14px; line-height: 1.6; color: var(--ink-500, #6b6b6b); margin: 0;
}
.ccn-consent-text a {
    color: var(--ink-900, #0a0a0a); text-decoration: underline;
    text-underline-offset: 2px; font-weight: 500;
}
.ccn-consent-text a:hover { opacity: .7; }

.ccn-consent-actions {
    display: flex; flex-direction: column; gap: 10px;
}

.ccn-consent-actions button {
    font-family: inherit; font-size: 14px; font-weight: 600;
    padding: 13px 24px; border-radius: var(--radius-pill, 9999px);
    border: none; cursor: pointer; white-space: nowrap;
    transition: background .15s, opacity .15s, transform .1s;
    letter-spacing: -0.01em; width: 100%;
    text-align: center;
}
.ccn-consent-actions button:active { transform: scale(.98); }

.ccn-btn-accept {
    background: var(--ink-900, #0a0a0a); color: var(--white, #fff);
}
.ccn-btn-accept:hover { background: var(--ink-700, #27272a); }

.ccn-btn-manage {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--white, #fff); color: #6b8e23;
    border: 1.5px solid #6b8e23 !important;
}
.ccn-btn-manage:hover { background: #f7f9f2; }
.ccn-btn-manage svg { width: 12px; height: 12px; transition: transform .2s; }

.ccn-btn-reject {
    background: var(--white, #fff); color: #6b8e23;
    border: 1.5px solid #6b8e23 !important;
}
.ccn-btn-reject:hover { background: #f7f9f2; }

/* Desktop: actions side-by-side */
@media (min-width: 769px) {
    .ccn-consent-inner {
        display: flex; align-items: center; gap: 32px; padding: 24px 32px;
    }
    .ccn-consent-text { margin-bottom: 0; flex: 1 1 400px; min-width: 0; }
    .ccn-consent-actions {
        flex-direction: row; flex-shrink: 0; gap: 10px;
    }
    .ccn-consent-actions button { width: auto; padding: 11px 24px; font-size: 13px; }
}

/* ---------- Preferences Modal ---------- */
.ccn-modal-backdrop {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.4);
    display: none; align-items: flex-end; justify-content: center;
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
}
.ccn-modal-backdrop.ccn-modal-open { display: flex; }

.ccn-modal {
    background: var(--white, #fff);
    width: 100%; max-width: 480px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.12);
    animation: ccn-slideUp .3s cubic-bezier(.22,1,.36,1);
}
@keyframes ccn-slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Modal header */
.ccn-modal-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 24px 24px 0; flex-shrink: 0;
}
.ccn-modal-header h3 {
    font-size: 18px; font-weight: 700; color: var(--ink-900, #0a0a0a);
    margin: 0; letter-spacing: -0.02em; line-height: 1.3;
    flex: 1;
}
.ccn-modal-close {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    color: var(--ink-400, #a3a3a3); border-radius: 8px;
    transition: background .15s, color .15s; flex-shrink: 0; margin-left: 12px;
}
.ccn-modal-close:hover { background: var(--ink-100, #f5f5f4); color: var(--ink-900, #0a0a0a); }
.ccn-modal-close svg { width: 18px; height: 18px; }

.ccn-modal-desc {
    font-size: 13px; line-height: 1.65; color: var(--ink-500, #6b6b6b);
    margin: 0; padding: 12px 24px 20px;
}

/* Modal body (scrollable) */
.ccn-modal-body {
    flex: 1; overflow-y: auto; overscroll-behavior: contain;
}

/* Accordion categories */
.ccn-category {
    border-top: 1px solid var(--ink-200, #e7e5e4);
}
.ccn-category:last-of-type { border-bottom: 1px solid var(--ink-200, #e7e5e4); }

.ccn-category-header {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 24px; cursor: pointer;
    transition: background .12s;
}
.ccn-category-header:hover { background: var(--ink-50, #fafaf9); }

.ccn-category-chevron {
    width: 18px; height: 18px; color: var(--ink-400, #a3a3a3);
    transition: transform .25s ease; flex-shrink: 0;
}
.ccn-category.is-open .ccn-category-chevron { transform: rotate(90deg); }

.ccn-category-name {
    font-size: 14px; font-weight: 600; color: var(--ink-900, #0a0a0a);
    flex: 1; letter-spacing: -0.01em;
}

.ccn-category-badge {
    font-size: 12px; font-weight: 600; color: #16a34a;
    white-space: nowrap;
}

/* Toggle */
.ccn-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.ccn-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ccn-toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--ink-200, #e7e5e4); border-radius: 11px;
    transition: background .2s ease;
}
.ccn-toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    background: var(--white, #fff); left: 3px; top: 3px;
    transition: transform .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.ccn-toggle input:checked + .ccn-toggle-slider {
    background: #16a34a;
}
.ccn-toggle input:checked + .ccn-toggle-slider::before {
    transform: translateX(18px);
}
.ccn-toggle input:focus-visible + .ccn-toggle-slider {
    outline: 2px solid var(--ink-900, #0a0a0a); outline-offset: 2px;
}

/* Category body (collapsible) */
.ccn-category-body {
    display: none; padding: 0 24px 16px 50px;
}
.ccn-category.is-open .ccn-category-body { display: block; }
.ccn-category-body p {
    font-size: 13px; line-height: 1.6; color: var(--ink-500, #6b6b6b); margin: 0;
}

/* Modal footer (sticky) */
.ccn-modal-footer {
    padding: 16px 24px 24px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 10px;
    border-top: 1px solid var(--ink-200, #e7e5e4);
    background: var(--white, #fff);
}
.ccn-modal-footer button {
    font-family: inherit; font-size: 14px; font-weight: 600;
    padding: 13px 24px; border-radius: var(--radius-pill, 9999px);
    border: none; cursor: pointer; transition: background .15s;
    letter-spacing: -0.01em; width: 100%; text-align: center;
}
.ccn-modal-save {
    background: var(--ink-900, #0a0a0a); color: var(--white, #fff);
}
.ccn-modal-save:hover { background: var(--ink-700, #27272a); }
.ccn-modal-cancel {
    background: var(--white, #fff); color: var(--ink-500, #6b6b6b);
    border: 1.5px solid var(--ink-200, #e7e5e4) !important;
}
.ccn-modal-cancel:hover { background: var(--ink-50, #fafaf9); }

/* Toast */
.ccn-toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--ink-900, #0a0a0a); color: var(--white, #fff);
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
    font-size: 13px; font-weight: 500;
    padding: 12px 24px; border-radius: var(--radius-pill, 9999px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 10000; opacity: 0; pointer-events: none;
    transition: opacity .3s, transform .3s;
}
.ccn-toast.ccn-toast-show {
    opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ===== Desktop modal ===== */
@media (min-width: 769px) {
    .ccn-modal-backdrop { align-items: center; }
    .ccn-modal {
        border-radius: var(--radius-lg, 20px);
        max-height: 80vh;
    }
    .ccn-modal-footer {
        flex-direction: row; gap: 10px;
    }
    .ccn-modal-footer button { width: auto; flex: 1; font-size: 13px; padding: 11px 24px; }
}

/* ===== Small mobile ===== */
@media (max-width: 380px) {
    .ccn-consent-inner { padding: 20px 16px; }
    .ccn-consent-text h3 { font-size: 15px; }
    .ccn-consent-text p { font-size: 13px; }
    .ccn-modal-header { padding: 20px 16px 0; }
    .ccn-modal-header h3 { font-size: 16px; }
    .ccn-modal-desc { padding: 10px 16px 16px; }
    .ccn-category-header { padding: 14px 16px; }
    .ccn-category-body { padding: 0 16px 14px 42px; }
    .ccn-modal-footer { padding: 12px 16px 20px; }
}
