/**
 * Cookie Consent Banner & Modal Styles
 */

/* ── Banner ── */
.cc-banner {
    position: fixed;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    padding: 16px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
}

.cc-banner--bottom { bottom: 0; }
.cc-banner--top    { top: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.cc-banner[hidden] { display: none; }

.cc-banner__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.cc-banner__text  { flex: 1; min-width: 250px; }

.cc-banner__title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #1d2327;
    margin: 0 0 4px;
}

.cc-banner__desc {
    font-size: 0.875rem;
    color: #555;
    margin: 4px 0 0;
    line-height: 1.6;
}

.cc-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Buttons ── */
.cc-btn {
    cursor: pointer;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.cc-btn:focus { outline: 2px solid #2271b1; outline-offset: 2px; }

.cc-btn--primary            { background: #2271b1; color: #fff; }
.cc-btn--primary:hover      { background: #135e96; }
.cc-btn--secondary          { background: #f0f0f0; color: #1d2327; }
.cc-btn--secondary:hover    { background: #ddd; }
.cc-btn--ghost              { background: transparent; color: #2271b1; border: 1px solid #2271b1; }
.cc-btn--ghost:hover        { background: rgba(34, 113, 177, 0.05); }

/* ── Modal overlay ── */
.cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cc-overlay[hidden] { display: none; }

/* ── Modal box ── */
.cc-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.cc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.cc-modal__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.cc-modal__close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: #787c82;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.cc-modal__close:hover { color: #1d2327; background: #f0f0f0; }

/* ── Modal scrollable body ── */
.cc-modal__body {
    overflow-y: auto;
    padding: 8px 24px;
    flex: 1;
}

/* ── Category cards ── */
.cc-cat-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cc-cat-card--locked { opacity: 0.65; }

.cc-cat-card__info { flex: 1; }

.cc-cat-card__name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1d2327;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cc-cat-card__desc {
    font-size: 0.8125rem;
    color: #646970;
    margin: 4px 0 0;
    line-height: 1.5;
}

.cc-tag {
    font-size: 0.7rem;
    font-weight: 500;
    color: #fff;
    background: #646970;
    border-radius: 20px;
    padding: 2px 8px;
}

/* ── Toggle switch ── */
.cc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

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

.cc-toggle__track {
    position: absolute;
    inset: 0;
    background: #ccd0d4;
    border-radius: 24px;
    transition: background 0.2s ease;
}

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

.cc-toggle input:checked + .cc-toggle__track             { background: #2271b1; }
.cc-toggle input:checked + .cc-toggle__track::after      { transform: translateX(20px); }
.cc-toggle input:disabled + .cc-toggle__track            { cursor: default; }
.cc-toggle input:focus-visible + .cc-toggle__track       { outline: 2px solid #2271b1; outline-offset: 2px; }

/* ── Modal footer ── */
.cc-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e8e8e8;
}

/* ── Re-open floating button ── */
.cc-reopen-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2271b1;
    border: none;
    cursor: pointer;
    z-index: 99998;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
    font-size: 1.25rem;
    line-height: 1;
}

.cc-reopen-btn:hover  { background: #135e96; transform: scale(1.1); }
.cc-reopen-btn[hidden] { display: none; }

/* ── Body padding to prevent banner from covering footer content ── */
body.cc-banner-visible {
    padding-bottom: 120px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .cc-banner { padding: 12px 16px; }

    .cc-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cc-banner__text  { min-width: 100%; }

    .cc-banner__actions {
        flex-direction: column;
        width: 100%;
    }

    .cc-btn { width: 100%; text-align: center; }

    .cc-modal__footer {
        flex-direction: column-reverse;
    }

    .cc-modal__footer .cc-btn { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
    .cc-banner__title { font-size: 0.9375rem; }
    .cc-banner__desc  { font-size: 0.8125rem; }
    .cc-btn           { font-size: 0.8125rem; padding: 8px 16px; }
    .cc-modal         { border-radius: 12px 12px 0 0; max-height: 85vh; }
    .cc-overlay       { align-items: flex-end; padding: 0; }
}
