/* Cookie consent banner & preferences modal */

.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s;
    pointer-events: none;
}

.cc-banner--visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cc-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.cc-banner__content {
    flex: 1 1 320px;
    min-width: 0;
}

.cc-banner__title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.5rem;
}

.cc-banner__text {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #9ca3af;
    margin: 0;
}

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    flex-shrink: 0;
}

.cc-btn {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.cc-btn:focus-visible {
    outline: 2px solid hsl(0 82% 50%);
    outline-offset: 2px;
}

.cc-btn:active {
    transform: scale(0.98);
}

.cc-btn--primary {
    background: hsl(0 82% 50%);
    color: #fff;
}

.cc-btn--primary:hover {
    background: hsl(0 82% 45%);
}

.cc-btn--secondary {
    background: #374151;
    color: #fff;
}

.cc-btn--secondary:hover {
    background: #4b5563;
}

.cc-btn--outline {
    background: transparent;
    color: #fff;
    border: 1px solid #4b5563;
}

.cc-btn--outline:hover {
    border-color: hsl(0 82% 50%);
    color: hsl(0 82% 50%);
}

.cc-link {
    color: hsl(0 82% 50%);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-link:hover {
    color: hsl(0 82% 60%);
}

/* Modal */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

.cc-modal--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.cc-modal__panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
}

.cc-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cc-modal__title {
    font-family: Inter, system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.cc-modal__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cc-modal__close:hover {
    background: #1f2937;
    color: #fff;
}

.cc-modal__close:focus-visible {
    outline: 2px solid hsl(0 82% 50%);
    outline-offset: 2px;
}

.cc-modal__intro {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #9ca3af;
    margin: 0 0 1.25rem;
}

.cc-category {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
}

.cc-category__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

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

.cc-category__name {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.25rem;
}

.cc-category__desc {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
    margin: 0;
}

/* Toggle switch */
.cc-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

.cc-toggle--disabled {
    cursor: default;
    opacity: 0.7;
}

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

.cc-toggle__slider {
    position: relative;
    display: block;
    width: 44px;
    height: 24px;
    background: #374151;
    border-radius: 12px;
    transition: background 0.2s;
}

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

.cc-toggle input:checked + .cc-toggle__slider {
    background: hsl(0 82% 50%);
}

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

.cc-toggle input:focus-visible + .cc-toggle__slider {
    outline: 2px solid hsl(0 82% 50%);
    outline-offset: 2px;
}

.cc-toggle__label {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.cc-modal__footer {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-modal__legal {
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0 0 1rem;
}

.cc-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.cc-modal-open,
body.cc-banner-open {
    /* Prevent layout shift; banner doesn't lock scroll */
}

@media (max-width: 640px) {
    .cc-banner__inner {
        padding: 1rem;
    }

    .cc-banner__actions {
        width: 100%;
    }

    .cc-banner__actions .cc-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.3125rem);
        text-align: center;
    }

    .cc-banner__actions .cc-btn--outline {
        flex: 1 1 100%;
    }
}
