/* ===== Cookie Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cookie-banner-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.cookie-banner-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-banner-inner {
    background: var(--surface);
    border-top: 1px solid var(--divider);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    padding: 28px 0;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.cookie-banner-main {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.cookie-banner-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--brand-faint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.cookie-banner-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.cookie-banner-text a {
    color: var(--brand);
    text-decoration: underline;
}

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

.cookie-btn {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    box-shadow: 0 4px 16px rgba(232, 52, 90, 0.3);
}

.cookie-btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 52, 90, 0.4);
}

.cookie-btn-essential {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--divider);
}

.cookie-btn-essential:hover {
    border-color: var(--text-muted);
}

.cookie-btn-settings {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
}

.cookie-btn-settings:hover {
    color: var(--brand);
}

/* ===== Cookie Settings Panel ===== */
.cookie-settings {
    display: none;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--divider);
}

.cookie-settings.open {
    display: block;
}

.cookie-settings-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.cookie-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--divider);
}

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

.cookie-category-info {
    flex: 1;
}

.cookie-category-info h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.cookie-category-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--divider);
    border-radius: 12px;
    transition: background 0.3s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--brand);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Required badge */
.cookie-required {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-elevated);
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Cookie type cards (cookies page) ===== */
.cookie-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.cookie-type-card {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 24px 20px;
    text-align: center;
    transition: border-color 0.3s;
}

.cookie-type-card:hover {
    border-color: var(--text-muted);
}

.cookie-type-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.cookie-type-icon.essential {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.cookie-type-icon.analytics {
    background: rgba(86, 204, 242, 0.12);
    color: #56CCF2;
}

.cookie-type-icon.functional {
    background: rgba(242, 153, 74, 0.12);
    color: #F2994A;
}

.cookie-type-icon.marketing {
    background: rgba(187, 107, 217, 0.12);
    color: #BB6BD9;
}

.cookie-type-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.cookie-type-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* code snippets in tables */
.legal-table code {
    background: var(--surface-elevated);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--brand);
    font-family: 'Courier New', monospace;
}

/* Footer cookie settings button */
.footer-cookie-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
}

.footer-cookie-btn:hover {
    color: var(--brand);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .cookie-banner-main {
        flex-direction: column;
    }

    .cookie-banner-icon {
        display: none;
    }

    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
    }

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

    .cookie-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .cookie-types-grid {
        grid-template-columns: 1fr;
    }
}
