/* Reusable CMP styles */
.cmp-hidden {
    display: none !important;
}

.cmp-overlay {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 58%);
    z-index: 99998;
    display: none;
}

.cmp-overlay.is-visible {
    display: block;
}

.cmp-overlay.cmp-overlay--light {
    background: rgb(0 0 0 / 32%);
}

.cmp-modal {
    position: fixed;
    left: 50%;
    width: min(660px, calc(100vw - 24px));
    background: #f3f3f3;
    border-radius: 12px;
    box-shadow: 0 20px 65px rgb(0 0 0 / 35%);
    padding: 18px;
    z-index: 99999;
    color: #2b2c33;
    font-family: Poppins, sans-serif;
    display: none;
}

.cmp-modal.is-visible {
    display: block;
}

.cmp-banner {
    bottom: 14px;
    top: auto;
    transform: translateX(-50%);
    max-height: none;
    overflow: visible;
    width: min(760px, calc(100vw - 24px));
    box-shadow: 0 10px 30px rgb(0 0 0 / 30%);
}

/* Slide-up entrance animation for first-visit banner */
@keyframes cmpSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.cmp-banner.is-visible {
    animation: cmpSlideUp 0.45s ease-out both;
}

.cmp-preferences {
    top: 50%;
    transform: translate(-50%, -50%);
    max-height: calc(100vh - 30px);
    overflow: auto;
}

.cmp-title {
    margin: 0 0 14px;
    text-align: center;
    font-size: 36px;
    line-height: 1.05;
    font-weight: 700;
    color: #0c1f55;
}

.cmp-subtitle {
    margin: 0 0 12px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
}

.cmp-copy {
    margin: 0;
    color: #444;
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
}

.cmp-banner .cmp-copy {
    text-align: left;
    font-size: 14px;
}

.cmp-banner .cmp-subtitle {
    margin-bottom: 8px;
    text-align: left;
}

.cmp-links,
.cmp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.cmp-actions {
    margin-top: 14px;
}

.cmp-links {
    margin-top: 10px;
}

.cmp-banner .cmp-links {
    justify-content: flex-start;
}

.cmp-banner .cmp-actions {
    justify-content: flex-start;
}

.cmp-btn {
    border: 0;
    border-radius: 9px;
    font-size: 15px;
    line-height: 1;
    padding: 10px 14px;
    min-height: 44px;
    font-weight: 600;
    cursor: pointer;
    background: #ececec;
    color: #21242d;
    min-width: 145px;
}

.cmp-btn:hover {
    opacity: 0.92;
}

.cmp-btn-primary {
    background: #0c64b8;
    color: #fff;
}

.cmp-link {
    color: #0c64b8;
    text-decoration: none;
    font-size: 14px;
    padding: 2px 10px;
}

.cmp-link:hover {
    text-decoration: underline;
}

.cmp-pref-list {
    margin-top: 14px;
}

.cmp-pref-item {
    background: #ececec;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}

.cmp-pref-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.cmp-pref-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cmp-pref-desc {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.3;
}

.cmp-switch {
    appearance: none;
    width: 50px;
    height: 28px;
    background: #b5b5b5;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.2s ease;
}

.cmp-switch:checked {
    background: #0c64b8;
}

.cmp-switch:disabled {
    background: #46a046;
    cursor: not-allowed;
}

.cmp-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s ease;
}

.cmp-switch:checked::after {
    left: 25px;
}

.cmp-fab {
    position: fixed;
    right: 20px;
    bottom: 88px;
    z-index: 99990;
    border: 0;
    border-radius: 999px;
    background: #0c1f55;
    color: #fff;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
    cursor: pointer;
}

.cmp-fab:hover {
    opacity: 0.95;
}

.cmp-embed-placeholder {
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #f6f7f8;
    padding: 16px;
    color: #383a44;
    text-align: center;
}

.cmp-embed-placeholder p {
    margin: 0 0 12px;
}

.cmp-embed-placeholder .cmp-btn {
    font-size: 16px;
    min-height: auto;
    min-width: 180px;
    padding: 10px 14px;
}

.scroll-to-top {
    bottom: 10px;
}

@media (width <= 991px) {
    .cmp-modal {
        width: calc(100vw - 16px);
        padding: 14px;
        border-radius: 12px;
    }

    .cmp-preferences {
        max-height: calc(100vh - 20px);
    }

    .cmp-banner {
        bottom: 10px;
        width: calc(100vw - 16px);
        box-shadow: 0 -4px 30px rgb(0 0 0 / 35%);
    }

    .cmp-title {
        font-size: 28px;
    }

    .cmp-subtitle {
        font-size: 18px;
    }

    .cmp-copy {
        font-size: 14px;
    }

    .cmp-banner .cmp-copy {
        font-size: 13px;
    }

    .cmp-btn {
        min-width: 130px;
        width: 100%;
        min-height: 42px;
        font-size: 15px;
        padding: 9px 12px;
    }

    .cmp-pref-name {
        font-size: 18px;
    }

    .cmp-pref-desc {
        font-size: 14px;
    }
}

@media (width <= 600px) {
    .cmp-subtitle {
        margin-bottom: 12px;
        font-size: 17px;
    }

    .cmp-copy {
        font-size: 13px;
    }

    .cmp-actions {
        margin-top: 14px;
        gap: 8px;
    }

    .cmp-banner .cmp-actions .cmp-btn {
        width: auto;
        flex: 1 1 calc(50% - 6px);
        min-width: 120px;
    }

    .cmp-links {
        margin-top: 12px;
        gap: 6px;
    }

    .cmp-link {
        font-size: 13px;
        padding: 0 6px;
    }

    .cmp-pref-item {
        padding: 10px;
    }

    .cmp-fab {
        right: 12px;
        bottom: 80px;
    }
}
