/**
 * CHCF Engage — layout shell only.
 * These classes just POSITION the box on screen; all visual design
 * (colors, fonts, spacing inside the box) should come from the content
 * HTML/CSS your designer provides per dialog. Override any of this in
 * Settings → Custom CSS if needed.
 */

.chcf-engage-overlay {
    position: fixed;
    z-index: 999999;
    box-sizing: border-box;
    animation: chcfEngageIn 0.25s ease;
}

.chcf-engage-overlay * {
    box-sizing: border-box;
}

.chcf-engage-overlay.chcf-closing {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Center modal — dims the page behind it */
.chcf-pos-center {
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}
.chcf-pos-center .chcf-engage-box {
    max-width: 480px;
    width: calc(100% - 40px);
}

/* Bottom bar — full width strip, e.g. cookie consent */
.chcf-pos-bottom-bar {
    left: 0; right: 0; bottom: 0;
}
.chcf-pos-bottom-bar .chcf-engage-box {
    width: 100%;
}

/* Top bar — full width strip at the top */
.chcf-pos-top-bar {
    left: 0; right: 0; top: 0;
}
.chcf-pos-top-bar .chcf-engage-box {
    width: 100%;
}

/* Bottom-right corner card — e.g. small offer nudge */
.chcf-pos-bottom-right {
    right: 20px; bottom: 20px;
    max-width: 340px;
}

/* ── Default box look (used unless your custom design overrides it) ── */
.chcf-engage-box {
    background: #ffffff;
    color: #1d2327;
    padding: 18px 22px;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.chcf-pos-bottom-bar .chcf-engage-box,
.chcf-pos-top-bar .chcf-engage-box {
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.chcf-engage-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chcf-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.chcf-btn-primary {
    background: #2271b1;
    color: #fff;
}

.chcf-btn-secondary {
    background: #f0f0f1;
    color: #1d2327;
}

@keyframes chcfEngageIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .chcf-pos-bottom-right {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
    }
}

/* Auto-injected close (×) control — anchored to the visible box itself
   via .chcf-engage-box-with-close (added in JS), so it lands in the
   box's corner rather than the full-screen overlay's corner. */
.chcf-engage-box-with-close {
    position: relative;
}
.chcf-engage-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chcf-engage-close:hover {
    background: rgba(0, 0, 0, 0.18);
}

/* [codehazel_dialog_button] output — deliberately minimal so it
   inherits your theme's button look; override freely with the
   optional class="" attribute on the shortcode. */
.chcf-dialog-open-btn {
    cursor: pointer;
    font-family: inherit;
}
