/* Schema Manager — Call Action Button */

.sm-callaction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border: 1px solid #e2e8f0;
    margin: 0 !important;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* No logo = center everything */
.sm-callaction.sm-no-logo {
    justify-content: center;
}

.sm-callaction-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.sm-callaction-logo img {
    width: auto;
    object-fit: contain;
    display: block;
}

.sm-callaction-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* No logo = keep buttons centered, not full width */
.sm-no-logo .sm-callaction-btns {
    width: auto;
    max-width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
}
.sm-no-logo .sm-callaction-btn {
    flex: 0 1 auto;
    justify-content: center;
    min-width: 150px;
    max-width: 230px;
    min-height: 44px;
}

.sm-callaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: var(--sm-btn-font-size, .92rem);
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
    line-height: 1.4;
    border-radius: 50px;
}

.sm-callaction-btn:hover {
    opacity: 1 !important;
    transform: translateY(-2px);
    text-decoration: none !important;
    color: var(--sm-btn-text-color) !important;
    background-color: var(--sm-btn-hover-bg, var(--sm-btn-bg)) !important;
}

.sm-callaction-btn svg {
    flex-shrink: 0;
}

/* RTL */
[dir="rtl"] .sm-callaction:not(.sm-no-logo) {
    flex-direction: row-reverse;
}
[dir="rtl"] .sm-callaction-btns {
    flex-direction: row-reverse;
}

/* Mobile */
@media (max-width: 600px) {
    .sm-callaction {
        flex-direction: column;
        align-items: center;
    }
    .sm-callaction-btns {
        width: 100%;
        justify-content: center;
    }
    .sm-callaction-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Mobile safety fix: keep CTA buttons on one row without overflowing */
@media (max-width: 600px) {
    .sm-callaction {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .sm-callaction-btns {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: stretch;
        align-items: stretch;
        gap: 8px;
        box-sizing: border-box;
    }

    [dir="rtl"] .sm-callaction-btns {
        flex-direction: row-reverse;
    }

    .sm-callaction-btn {
        width: auto;
        max-width: 100%;
        min-width: 0;
        flex: 1 1 0;
        justify-content: center;
        white-space: nowrap;
        text-align: center;
        padding-inline: 8px;
        font-size: min(var(--sm-btn-font-size, 15px), 17px);
        box-sizing: border-box;
    }

    .sm-callaction-btn span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}


/* No-logo CTA on mobile: use the full row, while desktop stays centered and compact */
@media (max-width: 600px) {
    .sm-no-logo .sm-callaction-btns {
        width: 100%;
        max-width: 100%;
        justify-content: stretch;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .sm-no-logo .sm-callaction-btn {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
    }
}
