/*
 * Pricing — block style for core/group (subscription / product pricing card).
 * Reuse unit: block style. Consumes ONLY token CSS vars (no raw hex/px).
 *
 * Composition inside the group:
 *   optional badge (.wpdl-badge) · heading (plan name) · price paragraph
 *   · feature list (core/list) · divider · buttons
 *
 * Two variants:
 *   wpdl-pricing        — neutral card (surface bg, base border)
 *   wpdl-pricing-featured — brand-accented card (elevated bg, brand border)
 *
 * Ordering: base → featured variant → badge → price → list → divider →
 *           button area → hover/focus states.
 *
 * Tokens read:
 *   component.price.color / typography.*
 *   component.badge.bg-new / bg-sale / text / radius
 *   semantic.color.bg.surface / elevated · semantic.color.border.base / brand
 *   semantic.color.text.primary / secondary / brand / muted
 *   semantic.shadow.card / raised · semantic.radius.card
 *   semantic.typography.heading-2.* / heading-3.* / body.*
 *   space.3 / space.4 / space.5 / space.7 / space.9
 *   duration.base · easing.default
 */

/* --- Base ----------------------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing,
.wp-block-group.is-style-wpdl-pricing-featured {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* override WP's align-items:flex-start so children fill card width */
  padding: var(--wp--custom--space--9);
  background-color: var(--wp--custom--semantic--color--surface--primary);
  border: 1px solid var(--wp--custom--semantic--color--border--base);
  border-radius: var(--wp--custom--semantic--radius--card);
  box-shadow: var(--wp--custom--semantic--shadow--card);
  transition:
    box-shadow var(--wp--custom--duration--base) var(--wp--custom--easing--default),
    border-color var(--wp--custom--duration--base) var(--wp--custom--easing--default);
}

/* --- Featured variant ----------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing-featured {
  background-color: var(--wp--custom--semantic--color--surface--primary);
  border-color: var(--wp--custom--semantic--color--brand--soft);
  box-shadow: var(--wp--custom--semantic--shadow--raised);
}

/* --- Badge ---------------------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing .wpdl-badge,
.wp-block-group.is-style-wpdl-pricing-featured .wpdl-badge {
  display: inline-block;
  align-self: flex-start;
  margin-block-end: var(--wp--custom--space--5);
  padding-inline: var(--wp--custom--space--4);
  padding-block: var(--wp--custom--space--3);
  background-color: var(--wp--custom--semantic--color--badge--new);
  color: var(--wp--custom--semantic--color--badge--text);
  border-radius: var(--wp--custom--semantic--radius--badge);
  font-family: var(--wp--custom--semantic--typography--body--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.wp-block-group.is-style-wpdl-pricing .wpdl-badge--sale,
.wp-block-group.is-style-wpdl-pricing-featured .wpdl-badge--sale {
  background-color: var(--wp--custom--semantic--color--badge--sale);
}

/* --- Plan name (heading) -------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing > .wp-block-heading,
.wp-block-group.is-style-wpdl-pricing-featured > .wp-block-heading {
  font-family: var(--wp--custom--semantic--typography--heading-3--font-family);
  font-size: var(--wp--custom--semantic--typography--heading-3--font-size);
  font-weight: var(--wp--custom--semantic--typography--heading-3--font-weight);
  line-height: var(--wp--custom--semantic--typography--heading-3--line-height);
  color: var(--wp--custom--semantic--color--text--primary);
  margin-block: 0 var(--wp--custom--space--3);
}

/* --- Price display -------------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing > .wpdl-price,
.wp-block-group.is-style-wpdl-pricing-featured > .wpdl-price {
  font-family: var(--wp--custom--component--price--typography--font-family);
  font-size: var(--wp--custom--component--price--typography--font-size);
  font-weight: var(--wp--custom--component--price--typography--font-weight);
  line-height: var(--wp--custom--component--price--typography--line-height);
  color: var(--wp--custom--component--price--color);
  margin-block: 0 var(--wp--custom--space--3);
}

/* --- Description copy ----------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing > .wp-block-paragraph,
.wp-block-group.is-style-wpdl-pricing-featured > .wp-block-paragraph {
  font-family: var(--wp--custom--semantic--typography--body--font-family);
  font-size: var(--wp--custom--semantic--typography--body--font-size);
  color: var(--wp--custom--semantic--color--text--secondary);
  margin-block: 0 var(--wp--custom--space--5);
}

/* --- Divider -------------------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing > .wp-block-separator,
.wp-block-group.is-style-wpdl-pricing-featured > .wp-block-separator {
  border: none;
  border-block-start: 1px solid var(--wp--custom--semantic--color--border--base);
  margin-block: var(--wp--custom--space--7);
}

/* --- Feature list --------------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing > .wp-block-list,
.wp-block-group.is-style-wpdl-pricing-featured > .wp-block-list {
  padding-inline-start: var(--wp--custom--space--5);
  margin-block: 0 var(--wp--custom--space--7);
  color: var(--wp--custom--semantic--color--text--secondary);
  font-family: var(--wp--custom--semantic--typography--body--font-family);
  font-size: var(--wp--custom--semantic--typography--body--font-size);
  line-height: var(--wp--custom--semantic--typography--body--line-height);
}

.wp-block-group.is-style-wpdl-pricing > .wp-block-list li,
.wp-block-group.is-style-wpdl-pricing-featured > .wp-block-list li {
  margin-block-end: var(--wp--custom--space--3);
}

/* --- Buttons (pushed to bottom) ------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing > .wp-block-buttons,
.wp-block-group.is-style-wpdl-pricing-featured > .wp-block-buttons {
  margin-block-start: auto;
}

/* --- States --------------------------------------------------------------- */

.wp-block-group.is-style-wpdl-pricing:hover {
  border-color: var(--wp--custom--semantic--color--border--strong);
  box-shadow: var(--wp--custom--semantic--shadow--raised);
}

.wp-block-group.is-style-wpdl-pricing-featured:hover {
  box-shadow: var(--wp--custom--semantic--shadow--modal);
}

.wp-block-group.is-style-wpdl-pricing :focus-visible,
.wp-block-group.is-style-wpdl-pricing-featured :focus-visible {
  outline: 3px solid var(--wp--custom--semantic--color--focus--ring);
  outline-offset: 2px;
}

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .wp-block-group.is-style-wpdl-pricing,
  .wp-block-group.is-style-wpdl-pricing-featured {
    transition: none;
  }
}
