/* Cookie Consent Banner & Preferences */

.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;
}

/* --- Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #1a1a2e;
    color: #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.cookie-banner__text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-banner__text strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
    color: #fff;
}

.cookie-banner__text p {
    margin: 0;
    color: #b0b0c0;
}

.cookie-banner__text a {
    color: #5b91d5;
    text-decoration: underline;
}

.cookie-banner__text a:hover {
    color: #7dade6;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

/* --- Buttons --- */
.cookie-btn {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px 20px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.cookie-btn--primary {
    background: #5b91d5;
    color: #fff;
    border: 2px solid #5b91d5;
}

.cookie-btn--primary:hover {
    background: #4a7fc3;
    border-color: #4a7fc3;
}

.cookie-btn--outlined {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.5);
}

.cookie-btn--outlined:hover {
    border-color: #fff;
}

.cookie-btn--link {
    background: transparent;
    color: #b0b0c0;
    border: none;
    padding: 10px 12px;
    text-decoration: underline;
}

.cookie-btn--link:hover {
    color: #fff;
}

/* --- Preferences Modal --- */
.cookie-preferences {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.cookie-preferences--visible {
    opacity: 1;
}

.cookie-preferences__panel {
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.cookie-preferences__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-preferences__header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.cookie-preferences__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 6px;
}

.cookie-preferences__close:hover {
    background: #f1f3f5;
    color: #1a1a1a;
}

.cookie-preferences__body {
    padding: 16px 24px;
}

.cookie-category {
    padding: 16px 0;
    border-bottom: 1px solid #f1f3f5;
}

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

.cookie-category__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cookie-category__info {
    flex: 1;
}

.cookie-category__info strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
    color: #1a1a1a;
}

.cookie-category__info p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* --- Toggle Switch --- */
.cookie-toggle {
    flex-shrink: 0;
    padding-top: 2px;
}

.cookie-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 26px;
    background: #d1d5db;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    outline: none;
    border: none;
}

.cookie-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cookie-toggle input[type="checkbox"]:checked {
    background: #5b91d5;
}

.cookie-toggle input[type="checkbox"]:checked::after {
    transform: translateX(22px);
}

.cookie-toggle input[type="checkbox"]:focus-visible {
    outline: 3px solid #5b91d5;
    outline-offset: 2px;
}

.cookie-toggle--disabled input[type="checkbox"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle--disabled label {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
    text-align: center;
    margin-top: 4px;
}

.cookie-toggle label {
    display: block;
}

.cookie-preferences__footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e7eb;
}

.cookie-preferences__footer .cookie-btn {
    flex: 1;
}

.cookie-preferences__footer .cookie-btn--outlined {
    color: #1a1a1a;
    border-color: #d1d5db;
}

.cookie-preferences__footer .cookie-btn--outlined:hover {
    border-color: #5b91d5;
    color: #5b91d5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .cookie-banner__inner {
        flex-direction: column;
        padding: 18px 16px;
        gap: 16px;
    }

    .cookie-banner__actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .cookie-btn--primary,
    .cookie-btn--outlined {
        flex: 1;
        text-align: center;
    }

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

    .cookie-preferences__panel {
        max-height: 85vh;
    }

    .cookie-preferences__footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .cookie-banner__text {
        font-size: 0.85rem;
    }

    .cookie-btn {
        font-size: 0.85rem;
        padding: 10px 14px;
    }

    .cookie-preferences__header {
        padding: 18px 16px 12px;
    }

    .cookie-preferences__body {
        padding: 12px 16px;
    }

    .cookie-preferences__footer {
        padding: 12px 16px 18px;
    }
}
