/* A2B Cookie Consent Banner — uses theme CSS variables */

/* ---- Banner ---- */
.a2b-cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--color-blue, #1a2f4e);
    color: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
}

.a2b-cc-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.a2b-cc-banner__content {
    flex: 1 1 300px;
}

.a2b-cc-banner__title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.a2b-cc-banner__desc {
    margin: 0;
    opacity: 0.85;
    font-size: 0.8125rem;
}

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

/* ---- Buttons ---- */
.a2b-cc-btn {
    display: inline-block;
    padding: 9px 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.a2b-cc-btn--accept {
    background: var(--color-secondary, #f5a623);
    color: var(--color-blue, #1a2f4e);
    border-color: var(--color-secondary, #f5a623);
}

.a2b-cc-btn--accept:hover {
    opacity: 0.88;
}

.a2b-cc-btn--reject {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.a2b-cc-btn--reject:hover {
    border-color: #fff;
}

.a2b-cc-btn--customise {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.a2b-cc-btn--customise:hover {
    border-color: #fff;
}

/* ---- Preferences panel ---- */
.a2b-cc-prefs {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.a2b-cc-prefs__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.a2b-cc-prefs__panel {
    position: relative;
    background: #fff;
    color: #222;
    border-radius: 6px;
    max-width: 620px;
    width: calc(100% - 32px);
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px 28px 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
}

.a2b-cc-prefs__panel h2 {
    margin: 0 0 20px;
    font-size: 1.1rem;
    color: var(--color-blue, #1a2f4e);
    padding-right: 28px;
}

.a2b-cc-prefs__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    line-height: 1;
}

.a2b-cc-prefs__close:hover {
    color: #222;
}

/* ---- Category rows ---- */
.a2b-cc-prefs__category {
    border-top: 1px solid #e5e5e5;
    padding: 14px 0 10px;
}

.a2b-cc-prefs__cat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.a2b-cc-prefs__cat-info strong {
    display: block;
    margin-bottom: 3px;
    color: var(--color-blue, #1a2f4e);
    font-size: 0.9rem;
}

.a2b-cc-prefs__cat-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}

.a2b-cc-prefs__cat-toggle {
    flex-shrink: 0;
    padding-top: 2px;
}

.a2b-cc-toggle--locked {
    font-size: 0.75rem;
    color: var(--color-secondary, #f5a623);
    font-weight: 600;
    white-space: nowrap;
}

/* Toggle switch */
.a2b-cc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

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

.a2b-cc-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.2s ease;
}

.a2b-cc-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.a2b-cc-switch input:checked + .a2b-cc-slider {
    background: var(--color-secondary, #f5a623);
}

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

/* Show cookies toggle button */
.a2b-cc-cookies-toggle {
    background: none;
    border: none;
    padding: 0;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--color-blue, #1a2f4e);
    cursor: pointer;
    opacity: 0.65;
    display: inline-block;
}

.a2b-cc-cookies-toggle:hover {
    opacity: 1;
}

.a2b-cc-cookies-toggle[aria-expanded="true"] {
    opacity: 1;
}

/* Cookie table inside prefs */
.a2b-cc-prefs__cookies {
    margin-top: 10px;
    overflow-x: auto;
}

.a2b-cc-prefs__cookies table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.775rem;
    color: #444;
}

.a2b-cc-prefs__cookies th {
    text-align: left;
    padding: 5px 8px;
    background: #f5f5f5;
    color: var(--color-blue, #1a2f4e);
    font-weight: 600;
}

.a2b-cc-prefs__cookies td {
    padding: 5px 8px;
    border-top: 1px solid #eee;
    vertical-align: top;
}

.a2b-cc-prefs__cookies code {
    font-size: 0.75rem;
    background: #f0f0f0;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Footer */
.a2b-cc-prefs__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 18px;
    border-top: 1px solid #e5e5e5;
    margin-top: 14px;
    flex-wrap: wrap;
}

.a2b-cc-prefs__footer .a2b-cc-btn--customise {
    color: var(--color-blue, #1a2f4e);
    border-color: rgba(0, 0, 0, 0.2);
}

.a2b-cc-prefs__footer .a2b-cc-btn--customise:hover {
    border-color: var(--color-blue, #1a2f4e);
}

/* Responsive */
@media (max-width: 640px) {
    .a2b-cc-banner__inner {
        padding: 14px 16px;
        gap: 14px;
    }

    .a2b-cc-banner__actions {
        width: 100%;
    }

    .a2b-cc-btn {
        flex: 1 1 auto;
        text-align: center;
        padding: 9px 14px;
    }

    .a2b-cc-prefs__panel {
        padding: 20px 16px 16px;
    }
}
