.cookie-consent {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-dark-gray);
    color: var(--color-white);
    padding: var(--space-md) 0;
    z-index: var(--z-modal);
    box-shadow: var(--shadow-2xl);
}

.cookie-consent--visible {
    display: block;
}

.cookie-consent__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.cookie-consent__text {
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-gray-300);
    flex: 1;
    min-width: 0;
}

.cookie-consent__text a {
    color: var(--color-white);
    text-decoration: underline;
}

.cookie-consent__text a:hover {
    color: var(--color-gray-300);
}

.cookie-consent__actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.cookie-consent__btn {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity 0.2s;
    white-space: nowrap;
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.cookie-consent__btn:hover {
    opacity: 0.85;
}

/* Equal-prominence buttons per ICO guidance — Reject and Accept use the same
   filled style. Manage is a subtle tertiary to keep the row visually balanced. */
.cookie-consent__btn--reject,
.cookie-consent__btn--accept {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.cookie-consent__btn--manage {
    background-color: transparent;
    border-color: var(--color-gray-500);
    color: var(--color-gray-300);
}

@media (max-width: 600px) {
    .cookie-consent__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-consent__actions {
        width: 100%;
    }

    .cookie-consent__btn {
        flex: 1;
        text-align: center;
    }
}

/* Preferences modal */
.cookie-preferences {
    display: none;
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) + 1);
    align-items: center;
    justify-content: center;
}

.cookie-preferences--visible {
    display: flex;
}

.cookie-preferences__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.cookie-preferences__dialog {
    position: relative;
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: calc(100% - var(--space-lg));
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    padding: var(--space-xl);
}

.cookie-preferences__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0 0 var(--space-sm);
}

.cookie-preferences__intro {
    color: var(--color-gray-700);
    line-height: 1.5;
    margin: 0 0 var(--space-lg);
}

.cookie-preferences__row {
    border-top: 1px solid var(--color-gray-200);
    padding: var(--space-md) 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-md);
    align-items: start;
}

.cookie-preferences__row-title {
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--space-xs);
}

.cookie-preferences__row-body {
    color: var(--color-gray-700);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin: 0;
}

.cookie-preferences__toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.cookie-preferences__toggle-slider {
    position: absolute;
    inset: 0;
    background-color: var(--color-gray-300);
    border-radius: var(--radius-full);
    transition: background-color 0.2s;
    cursor: pointer;
}

.cookie-preferences__toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: var(--color-white);
    border-radius: 50%;
    transition: transform 0.2s;
}

.cookie-preferences__toggle input:checked + .cookie-preferences__toggle-slider {
    background-color: var(--color-secondary);
}

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

.cookie-preferences__toggle input:disabled + .cookie-preferences__toggle-slider {
    background-color: var(--color-secondary);
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-preferences__actions {
    margin-top: var(--space-lg);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.cookie-preferences__btn {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    border: 2px solid transparent;
}

.cookie-preferences__btn--save {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.cookie-preferences__btn--cancel {
    background-color: transparent;
    border-color: var(--color-gray-400);
    color: var(--color-gray-700);
}

body.cookie-preferences-open {
    overflow: hidden;
}
