/*
 * Cookie-consent banner + preferences modal.
 *
 * Vanilla reimplementation of the keywordseverywhere.com Bootstrap banner,
 * styled to match the main site (light bar #f8f9fa, success green #28a745,
 * secondary grey #6c757d, 60x34 toggle switch, modal capped at 1260px).
 * No Bootstrap / jQuery dependency. Driven by
 * code/assets/js/cookie-consent.js.
 */

/* ---- Banner ---------------------------------------------------------- */
.cc-banner {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    padding: 18px 24px;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.cc-banner.is-visible {
    display: flex;
}
.cc-banner__copy {
    flex: 1 1 480px;
    min-width: 0;
}
.cc-banner__title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #212529;
}
.cc-banner__copy p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #495057;
}
.cc-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    flex: 0 0 auto;
}

/* ---- Buttons --------------------------------------------------------- */
.cc-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}
.cc-btn--accept {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}
.cc-btn--accept:hover {
    background: #218838;
    border-color: #1e7e34;
}
.cc-btn--secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}
.cc-btn--secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}
.cc-btn:focus-visible {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

/* ---- Modal ----------------------------------------------------------- */
.cc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
}
.cc-modal.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cc-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}
.cc-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1260px;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.cc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #dee2e6;
}
.cc-modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
}
.cc-modal__close {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #6c757d;
    padding: 0 4px;
    cursor: pointer;
}
.cc-modal__close:hover {
    color: #212529;
}
.cc-modal__body {
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
}
.cc-modal__footer {
    padding: 14px 20px;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

/* ---- Tabs + panes ---------------------------------------------------- */
.cc-tablist {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 16px;
    border-right: 1px solid #dee2e6;
}
.cc-tab {
    -webkit-appearance: none;
    appearance: none;
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.92rem;
    color: #495057;
    cursor: pointer;
}
.cc-tab:hover {
    background: #f1f3f5;
}
.cc-tab.is-active {
    background: #28a745;
    color: #fff;
    font-weight: 600;
}
.cc-panes {
    flex: 1 1 auto;
    min-width: 0;
}
.cc-pane {
    display: none;
}
.cc-pane.is-active {
    display: block;
}
.cc-pane__title {
    margin: 0 0 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
}
.cc-pane__content {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #495057;
}
.cc-pane__content p {
    margin: 0 0 10px;
}

/* ---- Toggle switch (port of simple-checkbox-switch.css) -------------- */
.cc-switch-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
}
.cc-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex: 0 0 auto;
}
.cc-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.cc-switch__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 34px;
    cursor: pointer;
    transition: 0.4s;
}
.cc-switch__slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background: #fff;
    border-radius: 50%;
    transition: 0.4s;
}
.cc-switch input:checked + .cc-switch__slider {
    background: #28a745;
}
.cc-switch input:disabled + .cc-switch__slider {
    cursor: not-allowed;
    opacity: 0.7;
}
.cc-switch input:checked + .cc-switch__slider:before {
    -webkit-transform: translateX(26px);
    transform: translateX(26px);
}
.cc-switch input:focus-visible + .cc-switch__slider {
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.45);
}
.cc-switch__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #495057;
}

body.cc-modal-open {
    overflow: hidden;
}

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 640px) {
    .cc-banner {
        padding: 14px 16px;
    }
    .cc-banner__actions {
        width: 100%;
    }
    .cc-banner__actions .cc-btn {
        flex: 1 1 auto;
        text-align: center;
    }
    .cc-modal.is-visible {
        padding: 10px;
    }
    .cc-modal__body {
        flex-direction: column;
    }
    .cc-tablist {
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding-right: 0;
        padding-bottom: 12px;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
}
