/* Match homepage service actions without rewriting published CMS content. */
#smpls-editor-content {
    --card-action-default-ink: hsl(var(--smplsColorPrimary-hsl));
}

.dark #smpls-editor-content {
    --card-action-default-ink: hsl(var(--smplsColorGray100-hsl));
}

#smpls-editor-content :is(
    .sc-solution-card > strong,
    .sc-solution-card > .smpls-box-content > [data-widget_type="heading"]:last-child strong,
    :is(
        .smpls-card, .sp-native-card, .home-service-card, .sc-feature,
        .sc-module, .sc-salon-choice, .sc-salon-price-card, .wnm-feature,
        .wnm-specialty-price, .industry-feature, .industry-integration,
        .smpls-column.rounded-3xl, [data-element_type="box"].rounded-smplsRadiusBase
    ) .smpls-button:is(.-underlined, .-flat)
) {
    --card-action-ink: var(--industry-link, var(--offer-link, var(--card-action-default-ink)));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 18px !important;
    border: 1px solid color-mix(in srgb, var(--card-action-ink) 35%, transparent) !important;
    border-radius: 999px;
    background: transparent !important;
    color: var(--card-action-ink) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;

    &:is(:hover, :focus-visible) {
        border-color: var(--card-action-ink) !important;
        background: color-mix(in srgb, var(--card-action-ink) 8%, transparent) !important;
    }

    &:focus-visible {
        outline: 2px solid var(--card-action-ink);
        outline-offset: 3px;
    }

    &::before,
    &::after {
        content: none;
    }

    & .smpls-button-icon {
        display: inline-flex;
        margin: 0 !important;
    }

    & :is(.smpls-hugeicon-up-right, .smpls-hugeicon-right) {
        --smpls-arrow-mask: url("/artwork/icons/arrow-right-sharp.svg");
        width: 18px;
        height: 18px;
        margin: 0;
        -webkit-mask-size: 125% 125%;
        mask-size: 125% 125%;
    }

    @media (prefers-reduced-motion: reduce) {
        transition: none;
    }
}

/* Native cards can have a solid brand surface, so use their configured ink. */
#smpls-editor-content .smpls-card .smpls-button:is(.-underlined, .-flat) {
    --card-action-ink: var(--smplsColorCardText);
}

.dark #smpls-editor-content .smpls-card .smpls-button:is(.-underlined, .-flat) {
    --card-action-ink: var(--smplsColorCardTextDark);
}

/* The heading's stretched link still makes the entire solution card clickable. */
#smpls-editor-content .sc-solution-card:is(:hover, :focus-within) strong {
    border-color: var(--card-action-ink) !important;
    background: color-mix(in srgb, var(--card-action-ink) 8%, transparent) !important;
}

@media (max-width: 767px) {
    #smpls-editor-content .sc-hero .sc-actions,
    #smpls-editor-content .sc-hero .sc-actions > .smpls-box-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 20px !important;
    }

    #smpls-editor-content .sc-hero .sc-actions .sp-native-button {
        width: 100%;
    }

    #smpls-editor-content .sc-hero .sc-actions .smpls-widget-content {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    #smpls-editor-content .sc-hero .sc-actions .smpls-button {
        justify-content: center;
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    #smpls-editor-content .sc-hero .sc-actions .smpls-button:not(.-underlined) {
        width: 100%;
    }

    #smpls-editor-content .sc-hero .sc-actions .smpls-button.-underlined {
        align-self: center;
        width: fit-content;
    }
}
