130 lines
4.4 KiB
PHP
130 lines
4.4 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Coach Payment Cards
|
|
* Description: Styles the Book Session test payment products as site-matching cards.
|
|
*/
|
|
|
|
add_action('wp_enqueue_scripts', function () {
|
|
if (!is_page('book-session')) {
|
|
return;
|
|
}
|
|
|
|
wp_register_style('coach-payment-cards', false, [], null);
|
|
wp_enqueue_style('coach-payment-cards');
|
|
|
|
$css = <<<'CSS'
|
|
body.coaching-mvp-active .coach-payment-section {
|
|
margin-top: clamp(1rem, 2vw, 1.5rem) !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-section > .wp-block-group__inner-container {
|
|
display: grid;
|
|
gap: 1rem;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-section h2.wp-block-heading {
|
|
margin: 0 !important;
|
|
max-width: 14ch;
|
|
font-size: clamp(2rem, 4.3vw, 3rem) !important;
|
|
line-height: .98 !important;
|
|
letter-spacing: -.04em !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-section > .wp-block-group__inner-container > p:not(.coach-badge) {
|
|
max-width: 42rem;
|
|
margin: 0 !important;
|
|
color: var(--coach-muted) !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-note {
|
|
padding: 1rem 1.1rem !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-note p {
|
|
margin: 0 !important;
|
|
color: var(--coach-text) !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid,
|
|
body.coaching-mvp-active .coach-payment-grid > .wp-block-group__inner-container {
|
|
display: grid !important;
|
|
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid > .wp-block-group__inner-container > * {
|
|
margin: 0 !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: .9rem;
|
|
min-height: 100%;
|
|
margin: 0 !important;
|
|
padding: clamp(1.2rem, 2.2vw, 1.45rem) !important;
|
|
background: var(--coach-surface) !important;
|
|
border: 1px solid var(--coach-border) !important;
|
|
border-radius: 8px !important;
|
|
box-shadow: none !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_item_top {
|
|
display: block !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_item_thumbnail,
|
|
body.coaching-mvp-active .coach-payment-grid .asp_under_price_line,
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_description:empty,
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_item > div[style*="clear:both"] {
|
|
display: none !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_name {
|
|
margin: 0 !important;
|
|
color: var(--coach-text) !important;
|
|
font-size: clamp(1.14rem, 1.8vw, 1.34rem) !important;
|
|
line-height: 1.18 !important;
|
|
font-weight: 600 !important;
|
|
letter-spacing: -.02em !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_price_container {
|
|
margin-top: auto;
|
|
padding-top: .25rem;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_price_amount {
|
|
display: inline-block;
|
|
color: var(--coach-text) !important;
|
|
font-size: clamp(1.75rem, 3vw, 2.2rem) !important;
|
|
line-height: 1 !important;
|
|
font-weight: 700 !important;
|
|
letter-spacing: -.04em !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_buy_button {
|
|
margin-top: .1rem;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_all_buttons_container,
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_buy_btn_container {
|
|
width: 100%;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_buy_btn {
|
|
width: 100%;
|
|
min-height: 48px;
|
|
padding: .85rem 1rem !important;
|
|
border-radius: 6px !important;
|
|
border: 1px solid var(--coach-border) !important;
|
|
background: var(--color-button-secondary-bg) !important;
|
|
color: var(--color-button-secondary-text) !important;
|
|
box-shadow: none !important;
|
|
font-weight: 600 !important;
|
|
transition: border-color .16s ease, background-color .16s ease, color .16s ease, opacity .16s ease !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_buy_btn:hover,
|
|
body.coaching-mvp-active .coach-payment-grid .asp_product_buy_btn:focus-visible {
|
|
background: var(--color-button-secondary-hover-bg) !important;
|
|
border-color: var(--coach-border) !important;
|
|
color: var(--coach-text) !important;
|
|
}
|
|
@media (max-width: 781px) {
|
|
body.coaching-mvp-active .coach-payment-section {
|
|
padding: 1rem !important;
|
|
}
|
|
body.coaching-mvp-active .coach-payment-grid,
|
|
body.coaching-mvp-active .coach-payment-grid > .wp-block-group__inner-container {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
CSS;
|
|
|
|
wp_add_inline_style('coach-payment-cards', $css);
|
|
}, 30);
|