/* ============================================
   Custom CTA Manager — Frontend Styles v1.3.0
   ============================================ */

/* ── Shared Box ── */
.ccm-cta-box {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    font-family: inherit;
    line-height: 1.5;
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ── Inline (shortcode) ── */
.ccm-inline-box {
    align-items: stretch;
    margin: 1.5em 0;
}

.ccm-inline-box .ccm-cta-img-wrap {
    flex: 0 0 200px;
    overflow: hidden;
}

.ccm-inline-box .ccm-cta-img-wrap img.ccm-cta-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ccm-inline-box .ccm-cta-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Headline & Text ── */
.ccm-cta-headline {
    margin: 0 0 8px !important;
    font-weight: 700;
    line-height: 1.3;
}

.ccm-cta-text {
    margin: 0 0 14px !important;
    opacity: 0.9;
    line-height: 1.6;
}

/* ── Button wrapper (handles left / center / right positioning) ── */
.ccm-cta-btn-wrap {
    display: flex;
}

/* ── Button ── */
.ccm-cta-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 5px;
    text-decoration: none !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity 0.15s ease, transform 0.15s ease;
    line-height: 1.4;
    border: none;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
}

.ccm-cta-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.ccm-cta-btn:active {
    transform: translateY(0);
    opacity: 1;
}

/* ── Slide-in Wrapper ── */
.ccm-slidein-wrapper {
    position: fixed;
    bottom: 32px;
    left: 0;
    z-index: 99999;
    width: 320px;
    transform: translateX(-110%);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.ccm-slidein-wrapper.ccm-is-visible {
    transform: translateX(0);
    pointer-events: auto;
}

/* ── Slide-in Box ── */
.ccm-slidein-box {
    border-radius: 0 10px 10px 0 !important;
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.18);
    flex-direction: column;
    width: 100%;
}

.ccm-slidein-box .ccm-cta-img-wrap {
    overflow: hidden;
    max-height: 160px;
    border-radius: 0 10px 0 0;
    flex: 0 0 auto;
}

.ccm-slidein-box .ccm-cta-img-wrap img.ccm-cta-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.ccm-slidein-box .ccm-cta-content {
    display: flex;
    flex-direction: column;
}

.ccm-slidein-box .ccm-cta-headline {
    padding-right: 22px;
}

.ccm-slidein-box .ccm-cta-btn {
    padding: 9px 16px;
}

/* ── Close Button ── */
.ccm-close-btn {
    position: absolute;
    top: 9px;
    right: 10px;
    background: rgba(0, 0, 0, 0.12);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: inherit;
    transition: background 0.15s;
    z-index: 2;
}

.ccm-close-btn:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .ccm-inline-box {
        flex-direction: column !important;
    }
    .ccm-inline-box .ccm-cta-img-wrap {
        flex: 0 0 auto;
        height: 160px;
        width: 100%;
    }
    .ccm-slidein-wrapper {
        width: 280px;
        bottom: 16px;
    }
}
