/**
 * IPTV From Canada - components/plans.css
 * Shared subscription plans component (sections/plans.php).
 *
 * Used by the homepage and the IPTV Pricing page, so both render the same
 * cards, selectors and prices. Loaded through the ifc-plans handle
 * (see ifc_register_component_assets()).
 */

/* --------------------------------------------------------------------------
   Plans (ifc-pl) — subscription plans & pricing
   Full-width charcoal section on the dark fold artwork (general.css
   .ifc-fold-bg--dark). Centred intro → device selector → duration selector
   (always stacked) → two equal cards. Native radios styled as options;
   :checked drives the selected state, :focus-visible the ring.
   -------------------------------------------------------------------------- */

.ifc-pl {
  --ifc-pl-max: var(--ifc-container-max);   /* shared page width */
  --ifc-pl-pad-y: 44px;                 /* 80 px on desktop */
  --ifc-pl-gutter: var(--ifc-gutter);   /* shared gutters */
  --ifc-pl-intro-gap: 28px;             /* intro → selectors */
  --ifc-pl-group-gap: 24px;             /* devices → duration */
  --ifc-pl-cards-gap: 32px;             /* duration → cards */
  --ifc-pl-cards-max: 1040px;           /* two-card grid, centred in the section */
  --ifc-pl-card-gap: 24px;
  --ifc-pl-card-pad: 20px;              /* 24 px on desktop */
  --ifc-pl-card-radius: 14px;
  --ifc-pl-title-size: clamp(1.375rem, 1.25rem + 0.5vw, 1.625rem);  /* 22 → 26 px */
  --ifc-pl-currency-size: 1.125rem;     /* 18 px "CAD" suffix */
  --ifc-pl-heading-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);  /* 28 → 40 px */
  --ifc-pl-lead-size: 1rem;             /* 17 px on desktop */
  --ifc-pl-price-size: clamp(2.25rem, 1.9rem + 1.2vw, 2.75rem);    /* 36 → 44 px */
  --ifc-pl-feature-size: 0.9375rem;     /* 15 px */
  --ifc-pl-option-min: 44px;
  --ifc-pl-accent: var(--ifc-maple);    /* checks + savings dot; gold on Premium */
  --ifc-pl-divider: var(--ifc-white-a15);

  --ifc-bg: var(--ifc-ink);
  padding-block: var(--ifc-pl-pad-y);
  color: var(--ifc-paper);
  background-position: center;
}

.ifc-pl__inner {
  max-width: var(--ifc-pl-max);
  padding-inline: var(--ifc-pl-gutter);
}

/* Intro ----------------------------------------------------------------- */

.ifc-pl__intro {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.ifc-scope .ifc-pl__heading {
  font-size: var(--ifc-pl-heading-size);
  line-height: 1.15;
  color: var(--ifc-paper);
}

.ifc-scope .ifc-pl__lead {
  margin-block-start: 12px;
  font-size: var(--ifc-pl-lead-size);
  line-height: 1.6;
  color: var(--ifc-text-dim);
}

.ifc-scope .ifc-pl__trust {
  margin-block-start: 10px;
  font-size: var(--ifc-small);
  font-weight: 500;
  line-height: 1.6;
  color: var(--ifc-text-dim);
}

/* Selectors ------------------------------------------------------------- */

.ifc-pl__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ifc-pl-group-gap);
  margin-block-start: var(--ifc-pl-intro-gap);
}

.ifc-pl__group {
  width: 100%;
  max-width: 760px;
  margin: 0;
  padding: 0;
  border: 0;
  text-align: center;
}

.ifc-scope .ifc-pl__legend {
  display: block;
  width: 100%;
  margin-block-end: 12px;
  padding: 0;
  font-size: var(--ifc-body);
  font-weight: 600;
  color: var(--ifc-paper);
}

/* Wrapping flex rows of equal, non-growing options so an incomplete last
   row (4 + 5 Devices, or a lone option) centres as a group.
   --ifc-pl-option-w is set per group and breakpoint from the real gap:
     < 360 px   both groups 2 per row
     ≥ 360 px   devices 3 per row (1-2-3 / 4-5), duration 2 × 2
     ≥ 768 px   fixed 132 px → 5 devices / 4 durations on one row */
.ifc-pl__options {
  --ifc-pl-option-gap: 10px;
  --ifc-pl-option-w: calc((100% - var(--ifc-pl-option-gap)) / 2);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ifc-pl-option-gap);
  width: 100%;
}

.ifc-pl__option {
  position: relative;
  display: block;
  flex: 0 0 var(--ifc-pl-option-w);
  min-width: 0;
}

/* The native radio stays in the tab order but paints nothing itself. */
.ifc-scope .ifc-pl__radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ifc-pl__option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ifc-pl-option-min);
  padding: 8px 14px;
  border: 1px solid var(--ifc-white-a15);
  border-radius: var(--ifc-radius-control);
  font-size: var(--ifc-small);
  font-weight: 600;
  line-height: var(--ifc-lh-ui);
  color: var(--ifc-paper-soft);
  background: var(--ifc-graphite);
  transition:
    background-color var(--ifc-duration) var(--ifc-ease),
    border-color var(--ifc-duration) var(--ifc-ease),
    color var(--ifc-duration) var(--ifc-ease);
}

.ifc-scope .ifc-pl__radio:checked + .ifc-pl__option-label {
  color: var(--ifc-surface);
  background: var(--ifc-action);
  border-color: var(--ifc-action);
}

@media (hover: hover) {
  .ifc-scope .ifc-pl__radio:not(:checked):hover + .ifc-pl__option-label {
    border-color: var(--ifc-white-a35);
    color: var(--ifc-surface);
  }
}

.ifc-scope .ifc-pl__radio:focus-visible + .ifc-pl__option-label {
  outline: 3px solid var(--ifc-surface);
  outline-offset: 3px;
}

/* Until the script enables the groups, options are visibly inert. */
.ifc-pl__group:disabled .ifc-pl__option-label {
  opacity: .7;
}

.ifc-pl__group:disabled .ifc-pl__radio {
  cursor: default;
}

.ifc-scope .ifc-pl__help {
  max-width: 640px;
  margin: 12px auto 0;
  font-size: var(--ifc-small);
  line-height: 1.6;
  color: var(--ifc-text-dim);
}

/* Cards ------------------------------------------------------------------ */

/* The card grid has its own width so the cards stay ~508 px wide inside
   the wider site container; the section background remains full width. */
.ifc-pl__cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ifc-pl-card-gap);
  width: 100%;
  max-width: var(--ifc-pl-cards-max);
  margin-inline: auto;
  margin-block-start: var(--ifc-pl-cards-gap);
}

.ifc-pl__card {
  display: flex;
  flex-direction: column;
  padding: var(--ifc-pl-card-pad);
  border: 1px solid var(--ifc-white-a15);
  border-radius: var(--ifc-pl-card-radius);
  background: var(--ifc-graphite);
}

.ifc-scope .ifc-pl__title {
  font-size: var(--ifc-pl-title-size);
  line-height: var(--ifc-lh-title);
  letter-spacing: normal;
  color: var(--ifc-paper);
}

.ifc-scope .ifc-pl__summary {
  margin-block-start: 4px;
  font-size: var(--ifc-small);
  font-weight: 500;
  color: var(--ifc-text-dim);
}

.ifc-pl__price {
  margin-block-start: 14px;
  padding-block-end: 16px;
  border-block-end: 1px solid var(--ifc-pl-divider);
}

/* Price: large value with a smaller currency suffix on the same baseline. */
.ifc-scope .ifc-pl__amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--ifc-pl-price-size);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: var(--ifc-tracking-tight);
  color: var(--ifc-paper);
}

.ifc-pl__currency {
  font-size: var(--ifc-pl-currency-size);
  font-weight: 600;
  letter-spacing: normal;
  color: var(--ifc-text-dim);
}

.ifc-scope .ifc-pl__price-note {
  margin-block-start: 6px;
  font-size: var(--ifc-small);
  line-height: 1.5;
  color: var(--ifc-text-dim);
}

/* Savings line: keeps its row even when empty (3-month plans). */
.ifc-scope .ifc-pl__savings {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.5em;
  margin-block-start: 6px;
  font-size: var(--ifc-small);
  font-weight: 600;
  line-height: 1.6;
  color: var(--ifc-paper);
}

.ifc-pl__savings::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ifc-pl-accent);
}

.ifc-scope .ifc-pl__savings:empty {
  visibility: hidden;
}

.ifc-scope .ifc-pl__features-heading {
  margin-block-start: 16px;
  font-size: var(--ifc-small);
  font-weight: 700;
  line-height: var(--ifc-lh-ui);
  letter-spacing: var(--ifc-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ifc-text-dim);
}

.ifc-scope .ifc-pl__features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-block-start: 10px;
}

.ifc-pl__feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--ifc-pl-feature-size);
  line-height: 1.5;
  color: var(--ifc-paper-soft);
}

.ifc-scope .ifc-pl__check {
  width: 18px;
  height: 18px;
  margin-block-start: .2em;
  color: var(--ifc-pl-accent);
}

.ifc-pl__foot {
  margin-block-start: auto;   /* bottom-aligned CTAs in the flex-column card */
  padding-block-start: 18px;
}

.ifc-scope .ifc-pl__cta {
  --ifc-button-height: 48px;
  --ifc-button-radius: var(--ifc-radius-sm);
  display: flex;
  width: 100%;
}

.ifc-scope .ifc-pl__fine {
  margin-block-start: 10px;
  font-size: var(--ifc-small);
  line-height: 1.6;
  text-align: center;
  color: var(--ifc-text-dim);
}

/* Premium: gold accents, scoped to the card so nothing else turns gold. */
.ifc-pl__card--premium {
  --ifc-pl-accent: var(--ifc-gold);
  --ifc-pl-divider: var(--ifc-gold-a35);
  border-color: var(--ifc-gold);
}

.ifc-pl__title-accent {
  color: var(--ifc-gold);
}

.ifc-scope .ifc-pl__card--premium .ifc-pl__cta {
  --ifc-btn-bg: var(--ifc-gold);
  --ifc-btn-border: var(--ifc-gold);
  --ifc-btn-fg: var(--ifc-ink);
}

.ifc-scope .ifc-pl__card--premium .ifc-pl__cta:active {
  --ifc-btn-bg: var(--ifc-gold-active);
  --ifc-btn-border: var(--ifc-gold-active);
}

@media (hover: hover) {
  .ifc-scope .ifc-pl__card--premium .ifc-pl__cta:hover {
    --ifc-btn-bg: var(--ifc-gold-hover);
    --ifc-btn-border: var(--ifc-gold-hover);
    --ifc-btn-fg: var(--ifc-ink);
  }

  .ifc-scope .ifc-pl__card--premium .ifc-pl__cta:hover:active {
    --ifc-btn-bg: var(--ifc-gold-active);
    --ifc-btn-border: var(--ifc-gold-active);
  }
}

/* Responsive ------------------------------------------------------------ */

@media (min-width: 360px) {
  .ifc-pl__options--devices {
    --ifc-pl-option-w: calc((100% - var(--ifc-pl-option-gap) * 2) / 3);
  }
}

@media (min-width: 768px) {
  .ifc-pl__options {
    --ifc-pl-option-w: 132px;
  }

  .ifc-pl__option-label {
    padding: 8px 16px;
  }
}

@media (min-width: 768px) {
  .ifc-pl {
    --ifc-pl-pad-y: 64px;
    --ifc-pl-card-pad: 24px;
    --ifc-pl-lead-size: 1.0625rem;
  }

  .ifc-pl__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;   /* equal heights → CTAs align at the bottom */
  }
}

@media (min-width: 1024px) {
  .ifc-pl {
    --ifc-pl-pad-y: 80px;
    --ifc-pl-intro-gap: 32px;
  }
}

/* --------------------------------------------------------------------------
   Purchase form (WooCommerce direct checkout)
   The section is one POST form so the selection works without JavaScript.
   The form itself is a plain block wrapper: the controls and card grid keep
   their own widths and margins, so the layout is unchanged.
   -------------------------------------------------------------------------- */

.ifc-pl__form {
  display: block;
  margin: 0;
}

/* Returned here because a selection could not be honoured. */
.ifc-scope .ifc-pl__alert {
  max-width: 720px;
  margin-inline: auto;
  margin-block-start: 20px;
  padding: 12px 16px;
  border: 1px solid var(--ifc-maple);
  border-radius: var(--ifc-radius-control);
  background: rgba(227, 41, 61, .12);
  font-size: var(--ifc-small);
  line-height: 1.5;
  text-align: center;
  color: var(--ifc-surface);
}

/* Shown in place of a usable button when a combination is not orderable. */
.ifc-scope .ifc-pl__unavailable {
  margin-block-start: 10px;
  font-size: var(--ifc-small);
  line-height: 1.5;
  text-align: center;
  color: var(--ifc-text-dim);
}

.ifc-scope .ifc-pl__unavailable[hidden] {
  display: none;
}

/* A disabled or in-flight "Get This Plan" button. */
.ifc-scope .ifc-pl__cta:disabled,
.ifc-scope .ifc-pl__cta[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
}

@media (hover: hover) {
  .ifc-scope .ifc-pl__cta:disabled:hover,
  .ifc-scope .ifc-pl__cta[aria-disabled="true"]:hover {
    --ifc-btn-bg: var(--ifc-action);
    --ifc-btn-border: var(--ifc-action);
  }

  .ifc-scope .ifc-pl__card--premium .ifc-pl__cta:disabled:hover {
    --ifc-btn-bg: var(--ifc-gold);
    --ifc-btn-border: var(--ifc-gold);
  }
}
