/* Cookie Consent System Styles */

/* Base Variables */
:root {
    /* Default/Fallback values matching theme.css structure where possible */
    --consent-z-index: 9999;
    --consent-accent: var(--clr-brightblue, #0056b3);
}

/* Banner (Fixed Bottom) */
/* Banner (Fixed Bottom) */
#le-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    /* Inherit generic theme variables from body */
    background-color: var(--clr-bg, #ffffff);
    color: var(--clr-text, #333333);
    border-top: 1px solid var(--clr-divider, #e0e0e0);

    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    z-index: var(--consent-z-index);

    transition: transform 0.3s ease-in-out;
    transform: translateY(100%);
    /* Hidden by default */
}

#le-consent-banner.visible {
    transform: translateY(0);
}

/* Wrapper to match site max-width and padding */
.consent-wrapper {
    max-width: 1500px;
    margin: 0 auto;
    padding: 1.5rem 1.2rem;
    /* Vertical | Horizontal (matches site main padding) */
    padding-right: calc(1.2rem + 60px);
    /* Clearance for Intercom on Desktop */

    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 830px) {
    .consent-wrapper {
        display: grid;
        grid-template-columns: 1.8fr 2.2fr 0.5fr;
        /* Increased text space from 1.3fr */
        gap: 1rem;
        align-items: center;
        /* Reset padding right, we use grid columns for clearance now */
        padding-right: 1rem;
    }

    .consent-content {
        grid-column: 1 / 2;
        /* Ensure text doesn't overflow or look too narrow */
        min-width: 300px;
    }

    .consent-actions {
        grid-column: 2 / 3;
        justify-self: end;

        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

.consent-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.consent-text {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
    margin: 0;
}

.consent-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Modal Overlay */
#le-consent-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: var(--consent-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#le-consent-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Preferences Modal */
#le-consent-modal {
    background: var(--clr-bg, #ffffff);
    color: var(--clr-text, #333333);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--clr-divider, #e0e0e0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--clr-divider, #e0e0e0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    color: var(--clr-text, #333333);
    padding: 0.25rem;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.consent-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--clr-divider, #e0e0e0);
}

.consent-option:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.option-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.option-info p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.modal-footer {
    padding: 1.5rem;
    /* Use a slight transparency for footer bg to separate it gently */
    background: rgba(127, 127, 127, 0.1);
    border-top: 1px solid var(--clr-divider, #e0e0e0);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Toggles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--consent-accent);
}

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

input:disabled+.slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn-consent {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--clr-divider, #e0e0e0);

    /* Ensure contrast: White button with Dark text always */
    background: #ffffff;
    color: #1a1a1a;

    transition: all 0.2s;
}

.btn-consent:hover {
    background: #f0f0f0;
}

.btn-consent.primary {
    background: var(--consent-accent);
    color: white;
    /* Always white text on accent */
    border-color: var(--consent-accent);
}

.btn-consent.primary:hover {
    filter: brightness(1.1);
}

.btn-consent.text {
    border: none;
    background: transparent;
    text-decoration: underline;
    color: var(--clr-text, #333);
    /* Link style matches theme text */
    padding: 0.6rem 0.5rem;
}