/*
 * Pricing Table - Base + Utilities
 *
 * Note: Selectors support both `.pt-*` and legacy `.bf-*` classnames so existing
 * `/black-friday` pages keep working while new pages migrate to the neutral `pt-*` naming.
 */

/* Longhand properties are a Webflow compatibility mandate (the design-system hook
   blocks shorthand in Webflow files), which conflicts with stylelint-config-standard's
   redundant-longhand rule; the mandate wins for this file. */
/* stylelint-disable declaration-block-no-redundant-longhand-properties --
   Webflow only accepts longhand properties. */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family-primary);
  overflow-x: hidden;
}

:is(.pt-page, .bf-page) {
  max-width: 1120px;
  margin-top: 0;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: auto;
  padding-top: clamp(2.5rem, 5vh, 4rem);
  padding-right: 1.5rem;
  padding-bottom: 4.5rem;
  padding-left: 1.5rem;
  overflow-x: hidden;
}

:is(.pt-page, .bf-page) :focus-visible {
  outline: 2px solid rgb(92 129 255 / 55%);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--pt-white);
  transition: outline-color 100ms ease, box-shadow 100ms ease;
}

/* Utility reveal children */
:is(.pt-reveal-child, .bf-reveal-child) {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(6px);
  transition: opacity 200ms ease, transform 200ms ease, filter 200ms ease;
}

:is(.pt-reveal-child, .bf-reveal-child).is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ========================================
   Lifetime Highlight Mini-Card
   ======================================== */
:is(.pt-lifetime-highlight, .bf-lifetime-highlight) {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-right: 1.25rem;
  padding-bottom: 0.75rem;
  padding-left: 1.25rem;
  margin-top: 1rem;
  margin-right: 0;
  margin-bottom: 1rem;
  margin-left: 0;
  background: linear-gradient(135deg, rgb(92 129 255 / 8%), rgb(114 199 197 / 6%));
  border-width: 1px;
  border-style: solid;
  border-color: rgb(92 129 255 / 20%);
  border-radius: 12px;
  font-size: 0.9rem;
}

:is(.pt-lifetime-badge, .bf-lifetime-badge) {
  background: linear-gradient(135deg, var(--shape-dark-blue), var(--shapescale-teal));
  color: var(--pt-white);
  padding-top: 0.3rem;
  padding-right: 0.7rem;
  padding-bottom: 0.3rem;
  padding-left: 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

:is(.pt-lifetime-details, .bf-lifetime-details) {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

:is(.pt-lifetime-details, .bf-lifetime-details) strong {
  font-size: 1rem;
  color: var(--text);
}

:is(.pt-lifetime-details, .bf-lifetime-details) span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

:is(.pt-financing-note, .bf-financing-note) {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--shapescale-teal);
  font-weight: 500;
  margin-top: 0.25rem;
}

:is(.pt-financing-note, .bf-financing-note) i {
  font-size: 0.9em;
}

/* ========================================
   Desktop: Sticky Sales Bar (Top)
   ======================================== */
@media (width >= 721px) {
  :is(.pt-sales-bar, .bf-sales-bar) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.75rem;
    padding-right: 1.5rem;
    padding-bottom: 0.75rem;
    padding-left: 1.5rem;
    background: linear-gradient(135deg, rgb(92 129 255 / 95%), rgb(114 199 197 / 95%));
    backdrop-filter: blur(10px);
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: rgb(255 255 255 / 20%);
    animation: slideDown 0.3s ease-out;
  }

  /* Add top padding to page to prevent content being hidden under fixed bar */
  :is(.pt-page, .bf-page) {
    padding-top: calc(clamp(2.5rem, 5vh, 4rem) + 52px); /* Original padding + bar height */
  }

  :is(.pt-sales-bar-content, .bf-sales-bar-content) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    flex: 1;
    justify-content: center;
  }

  :is(.pt-sales-bar, .bf-sales-bar) :is(.pt-sales-label, .bf-sales-label) {
    color: rgb(255 255 255 / 90%);
    font-weight: 600;
  }

  :is(.pt-sales-bar, .bf-sales-bar) :is(.pt-sales-phone, .bf-sales-phone) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgb(255 255 255 / 95%);
    color: var(--shape-dark-blue);
    padding-top: 0.35rem;
    padding-right: 0.75rem;
    padding-bottom: 0.35rem;
    padding-left: 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  :is(.pt-sales-bar, .bf-sales-bar) :is(.pt-sales-phone, .bf-sales-phone):hover {
    background: var(--pt-white);
    transform: translateY(-1px);
  }

  :is(.pt-sales-bar, .bf-sales-bar) :is(.pt-sales-phone, .bf-sales-phone) i {
    font-size: 1em;
  }

  :is(.pt-sales-bar, .bf-sales-bar) :is(.pt-sales-divider, .bf-sales-divider) {
    color: rgb(255 255 255 / 70%);
    font-size: 0.85rem;
  }

  :is(.pt-sales-bar, .bf-sales-bar) :is(.pt-sales-email, .bf-sales-email) {
    color: rgb(255 255 255 / 90%);
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  :is(.pt-sales-bar, .bf-sales-bar) :is(.pt-sales-email, .bf-sales-email):hover {
    color: var(--pt-white);
  }

  :is(.pt-sales-bar-close, .bf-sales-bar-close) {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgb(255 255 255 / 20%);
    border-width: medium;
    border-style: none;
    border-color: currentcolor;
    border-radius: 50%;
    color: var(--pt-white);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    flex-shrink: 0;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    vertical-align: middle;
  }

  :is(.pt-sales-bar-close, .bf-sales-bar-close):hover {
    background: rgb(255 255 255 / 30%);
    transform: scale(1.05);
  }

  :is(.pt-sales-bar-close, .bf-sales-bar-close) i {
    font-size: 1.1rem;
    line-height: 1;
    display: block;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
  }

  /* Hide mobile version on desktop */
  :is(.pt-sales-contact-mobile, .bf-sales-contact-mobile) {
    display: none;
  }
}

/* ========================================
   CTA Microcopy & Financing Elements
   ======================================== */
:is(.pt-cta-microcopy, .bf-cta-microcopy) {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  font-style: normal; /* Removed italic for cleaner look */
  text-align: center;
  opacity: 0.9;
  letter-spacing: 0.01em;
}

:is(.pt-financing-cta, .bf-financing-cta) {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

:is(.pt-financing-cta, .bf-financing-cta) i {
  color: var(--shapescale-teal);
}

:is(.pt-financing-cta, .bf-financing-cta) a {
  color: var(--shape-dark-blue);
  font-weight: 600;
  text-decoration: none;
}

:is(.pt-financing-cta, .bf-financing-cta) a:hover {
  text-decoration: underline;
}

/* ========================================
   Financing Feature with Info Tooltip
   ======================================== */
:is(.pt-financing-feature, .bf-financing-feature) {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

:is(.pt-info-tooltip, .bf-info-tooltip) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--shape-dark-blue);
  text-decoration: none;
  position: relative;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

:is(.pt-info-tooltip, .bf-info-tooltip) i {
  font-size: 1rem;
}

:is(.pt-info-tooltip, .bf-info-tooltip):hover {
  color: var(--shapescale-teal);
  transform: scale(1.1);
}

/* Info tooltip inside value callout - inline with text */
:is(.pt-value-callout, .bf-value-callout) :is(.pt-info-tooltip, .bf-info-tooltip) {
  margin-left: 0.25rem;
  font-weight: 400;
}

/* Allow tooltip to overflow value callout paragraphs */
:is(.pt-value-callout, .bf-value-callout) p:has(.pt-info-tooltip),
:is(.pt-value-callout, .bf-value-callout) p:has(.bf-info-tooltip) {
  overflow: visible;
}

/* Mobile: Larger tap target for touch */
@media (width <= 720px) {
  :is(.pt-info-tooltip, .bf-info-tooltip) {
    min-width: 44px;
    min-height: 44px;
    margin-top: -12px;
    margin-right: -12px;
    margin-bottom: -12px;
    margin-left: -12px; /* Expand tap area without affecting layout */
    padding-top: 12px;
    padding-right: 12px;
    padding-bottom: 12px;
    padding-left: 12px;
  }

  :is(.pt-info-tooltip, .bf-info-tooltip) i {
    font-size: 1.1rem;
  }

  /* Active state for touch feedback */
  :is(.pt-info-tooltip, .bf-info-tooltip):active {
    color: var(--shapescale-teal);
    transform: scale(0.95);
  }
}

/* Tooltip on hover (desktop) */
@media (width >= 721px) {
  :is(.pt-info-tooltip, .bf-info-tooltip)::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding-top: 0.5rem;
    padding-right: 0.75rem;
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;
    background: var(--shapescale-dark-100);
    color: var(--pt-white);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
  }

  :is(.pt-info-tooltip, .bf-info-tooltip):hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
  }

  /* Hide native title on hover to prevent double tooltip */
  :is(.pt-info-tooltip, .bf-info-tooltip):hover {
    /* Browser title suppressed by CSS pseudo-element */
  }
}

/* ========================================
   Dark Mode Support
   ======================================== */
@media (prefers-color-scheme: dark) {
  /* Sticky bar already has gradient background, no dark mode changes needed */

  :is(.pt-info-tooltip, .bf-info-tooltip) {
    color: var(--dark-brand-blue);
  }

  :is(.pt-info-tooltip, .bf-info-tooltip):hover {
    color: var(--shapescale-teal);
  }
}

/* ========================================
   Sticky Plan Toggle
   ShapeScale Design System Compliant
   ======================================== */
@media (width >= 721px) {
  :is(.pt-plan-toggle, .bf-plan-toggle) {
    position: sticky;
    top: 52px; /* Below fixed sales bar */
    z-index: 999;
    background: rgb(255 255 255 / 95%);
    backdrop-filter: blur(10px);
    padding-top: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem;  /* 16px - 8px grid */
    margin-top: -1rem;
    margin-right: -1rem;
    margin-bottom: 1rem;
    margin-left: -1rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: rgb(0 0 0 / 5%);
  }
}

@media (width <= 720px) {
  :is(.pt-plan-toggle, .bf-plan-toggle) {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgb(255 255 255 / 95%);
    backdrop-filter: blur(10px);
    padding-top: 0.5rem;
    padding-right: 0;
    padding-bottom: 0.5rem;
    padding-left: 0;  /* 8px - 8px grid */
  }
}

/* Dark mode sticky toggle */
@media (prefers-color-scheme: dark) {
  :is(.pt-plan-toggle, .bf-plan-toggle) {
    background: rgb(18 18 18 / 95%);
    border-bottom-color: rgb(255 255 255 / 8%);
  }
}
