/* Cookie consent banner + preferences modal.
   Uses the site's existing theme tokens from style.css (--primary-color, etc.). */

.cc-banner,
.cc-modal-overlay {
    font-family: inherit;
    box-sizing: border-box;
}

.cc-banner *,
.cc-modal-overlay * {
    box-sizing: border-box;
}

/* ---------- Banner ---------- */

.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 3px solid var(--primary-color, rgb(0, 119, 255));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform .35s ease;
}

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

.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cc-banner-text {
    flex: 1 1 380px;
    min-width: 0;
}

.cc-banner-text h2 {
    margin: 0 0 .5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark-color, #343a40);
}

.cc-banner-text p {
    margin: 0;
    font-size: .92rem;
    line-height: 1.55;
    color: #4a4a4a;
}

.cc-banner-text a {
    color: var(--primary-color, rgb(0, 119, 255));
    text-decoration: underline;
}

.cc-actions {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.cc-btn {
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    padding: .7rem 1.4rem;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
    white-space: nowrap;
}

.cc-btn:focus-visible {
    outline: 3px solid var(--primary-color, rgb(0, 119, 255));
    outline-offset: 2px;
}

/* Reject and Accept carry equal visual weight, as required by GDPR guidance —
   a "reject" option must be no harder to use than "accept". */
.cc-btn-accept,
.cc-btn-reject {
    background: var(--primary-color, rgb(0, 119, 255));
    color: #fff;
    border-color: var(--primary-color, rgb(0, 119, 255));
}

.cc-btn-accept:hover,
.cc-btn-reject:hover {
    background: #005fd1;
    border-color: #005fd1;
}

.cc-btn-settings {
    background: transparent;
    color: var(--dark-color, #343a40);
    border-color: #c4c4c4;
}

.cc-btn-settings:hover {
    border-color: var(--dark-color, #343a40);
}

/* ---------- Preferences modal ---------- */

.cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.cc-modal-overlay.cc-visible {
    opacity: 1;
    visibility: visible;
}

.cc-modal {
    background: #fff;
    border-radius: 6px;
    max-width: 680px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.cc-modal-header {
    padding: 1.4rem 1.6rem;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cc-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color, #343a40);
}

.cc-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #777;
    padding: 0 .25rem;
}

.cc-modal-close:hover {
    color: #000;
}

.cc-modal-body {
    padding: 1.4rem 1.6rem;
    overflow-y: auto;
}

.cc-modal-intro {
    margin: 0 0 1.4rem;
    font-size: .92rem;
    line-height: 1.6;
    color: #4a4a4a;
}

.cc-modal-intro a {
    color: var(--primary-color, rgb(0, 119, 255));
    text-decoration: underline;
}

.cc-category {
    border: 1px solid #e6e6e6;
    border-radius: 5px;
    padding: 1rem 1.15rem;
    margin-bottom: .9rem;
}

.cc-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .5rem;
}

.cc-category-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color, #343a40);
}

.cc-category p {
    margin: 0;
    font-size: .87rem;
    line-height: 1.55;
    color: #5a5a5a;
}

.cc-always-on {
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary-color, rgb(0, 119, 255));
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

/* Toggle switch */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
    flex-shrink: 0;
}

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

.cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #c4c4c4;
    border-radius: 25px;
    transition: background-color .25s;
}

.cc-slider::before {
    content: "";
    position: absolute;
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s;
}

.cc-switch input:checked + .cc-slider {
    background: var(--primary-color, rgb(0, 119, 255));
}

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

.cc-switch input:focus-visible + .cc-slider {
    outline: 3px solid var(--primary-color, rgb(0, 119, 255));
    outline-offset: 2px;
}

.cc-modal-footer {
    padding: 1.15rem 1.6rem;
    border-top: 1px solid #e6e6e6;
    display: flex;
    gap: .65rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---------- Footer trigger link ---------- */

.cc-reopen {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.cc-reopen:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .cc-banner {
        padding: 1.15rem;
        max-height: 85vh;
        overflow-y: auto;
    }

    .cc-banner-inner {
        gap: 1.15rem;
    }

    .cc-actions {
        width: 100%;
    }

    .cc-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .cc-modal-footer {
        flex-direction: column-reverse;
    }

    .cc-modal-footer .cc-btn {
        width: 100%;
    }
}
