/* ============================================
   RSL Pricing Table Component
   Version: 1.0.0

   A premium, accessible pricing table component
   with multiple variants, billing toggle, and
   feature comparison matrix.

   WCAG 2.1 AA Compliant
   ============================================ */

/* ============================================
   CSS Custom Properties (Theming)
   ============================================ */
:root {
    /* Colors */
    --rsl-pricing-bg: #ffffff;
    --rsl-pricing-border: #e2e8f0;
    --rsl-pricing-text: #334155;
    --rsl-pricing-text-muted: #64748b;
    --rsl-pricing-heading: #1e293b;
    --rsl-pricing-accent: #6366f1;
    --rsl-pricing-accent-light: rgba(99, 102, 241, 0.1);
    --rsl-pricing-accent-dark: #4f46e5;

    /* Highlighted tier */
    --rsl-pricing-highlight-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --rsl-pricing-highlight-text: #ffffff;
    --rsl-pricing-highlight-border: transparent;
    --rsl-pricing-highlight-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.35);

    /* Feature states */
    --rsl-pricing-check: #10b981;
    --rsl-pricing-cross: #ef4444;
    --rsl-pricing-partial: #f59e0b;

    /* Spacing */
    --rsl-pricing-gap: 1.5rem;
    --rsl-pricing-padding: 2rem;
    --rsl-pricing-radius: 16px;
    --rsl-pricing-radius-sm: 8px;

    /* Shadows */
    --rsl-pricing-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rsl-pricing-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -5px rgba(0, 0, 0, 0.04);

    /* Animation */
    --rsl-pricing-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Base Container
   ============================================ */
.rsl-pricing-table {
    position: relative;
    font-family: inherit;
    width: 100%;
}

/* Ensure all elements use border-box */
.rsl-pricing-table *,
.rsl-pricing-table *::before,
.rsl-pricing-table *::after {
    box-sizing: border-box;
}

/* Screen reader only text */
.rsl-pricing-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Live region for announcements */
.rsl-pricing-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Billing Toggle
   ============================================ */
.rsl-pricing-toggle-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.rsl-pricing-toggle-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--rsl-pricing-text-muted);
    transition: color var(--rsl-pricing-transition);
    cursor: pointer;
    padding: 0.25rem 0;
}

.rsl-pricing-toggle-label.active {
    color: var(--rsl-pricing-heading);
    font-weight: 600;
}

.rsl-pricing-toggle-label:focus-visible {
    outline: 2px solid var(--rsl-pricing-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* The toggle switch */
.rsl-pricing-toggle {
    position: relative;
    width: 56px;
    height: 28px;
    background: var(--rsl-pricing-border);
    border-radius: 14px;
    padding: 2px;
    cursor: pointer;
    border: none;
    transition: background var(--rsl-pricing-transition);
}

.rsl-pricing-toggle:hover {
    background: #cbd5e1;
}

.rsl-pricing-toggle:focus-visible {
    outline: 2px solid var(--rsl-pricing-accent);
    outline-offset: 2px;
}

.rsl-pricing-toggle[aria-checked="true"] {
    background: var(--rsl-pricing-accent);
}

.rsl-pricing-toggle[aria-checked="true"]:hover {
    background: var(--rsl-pricing-accent-dark);
}

.rsl-pricing-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform var(--rsl-pricing-transition);
}

.rsl-pricing-toggle[aria-checked="true"] .rsl-pricing-toggle-knob {
    transform: translateX(28px);
}

/* Savings badge */
.rsl-pricing-savings {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

/* ============================================
   Tiers Container (Cards Variant)
   ============================================ */
.rsl-pricing-tiers {
    display: grid;
    gap: var(--rsl-pricing-gap);
    align-items: start;
}

/* Responsive grid */
.rsl-pricing-tiers[data-tier-count="2"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
    margin: 0 auto;
}

.rsl-pricing-tiers[data-tier-count="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.rsl-pricing-tiers[data-tier-count="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.rsl-pricing-tiers[data-tier-count="5"] {
    grid-template-columns: repeat(5, 1fr);
}

/* ============================================
   Individual Tier Card
   ============================================ */
.rsl-pricing-tier {
    position: relative;
    background: var(--rsl-pricing-bg);
    border: 1px solid var(--rsl-pricing-border);
    border-radius: var(--rsl-pricing-radius);
    padding: var(--rsl-pricing-padding);
    box-shadow: var(--rsl-pricing-shadow);
    transition: transform var(--rsl-pricing-transition),
                box-shadow var(--rsl-pricing-transition);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible;
    margin-top: 1rem;
}

.rsl-pricing-tier:hover {
    transform: translateY(-4px);
    box-shadow: var(--rsl-pricing-shadow-hover);
}

/* Highlighted tier */
.rsl-pricing-tier.rsl-pricing-tier-highlighted {
    background: var(--rsl-pricing-highlight-bg);
    border-color: var(--rsl-pricing-highlight-border);
    box-shadow: var(--rsl-pricing-highlight-shadow);
    transform: scale(1.02);
    z-index: 2;
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted:hover {
    transform: scale(1.02) translateY(-4px);
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-tier-name,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-tier-description,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-price,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-price-period,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-price-note,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature-text {
    color: var(--rsl-pricing-highlight-text);
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-price-note {
    color: rgba(255, 255, 255, 0.85);
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature-icon.included {
    color: rgba(255, 255, 255, 0.95);
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature-icon.excluded {
    color: rgba(255, 255, 255, 0.5);
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-original-price {
    color: rgba(255, 255, 255, 0.7);
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature-tooltip-icon {
    color: rgba(255, 255, 255, 0.85);
    opacity: 1;
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature-tooltip:hover .rsl-pricing-feature-tooltip-icon,
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature-tooltip:focus-within .rsl-pricing-feature-tooltip-icon {
    color: #ffffff;
}

/* ============================================
   Tier Badge
   ============================================ */
.rsl-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 1rem;
    background: var(--rsl-pricing-accent);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-badge {
    background: #ffffff;
    color: var(--rsl-pricing-accent);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
}

/* Badge variants */
.rsl-pricing-badge[data-badge-variant="success"] {
    background: var(--rsl-pricing-check);
}

.rsl-pricing-badge[data-badge-variant="warning"] {
    background: var(--rsl-pricing-partial);
    color: #1a1a1a;
}

/* ============================================
   Tier Header
   ============================================ */
.rsl-pricing-tier-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}

.rsl-pricing-tier-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rsl-pricing-heading);
    margin: 0 0 0.5rem 0;
}

.rsl-pricing-tier-description {
    font-size: 0.875rem;
    color: var(--rsl-pricing-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   Price Display
   ============================================ */
.rsl-pricing-price-wrapper {
    text-align: center;
    margin-bottom: 1.5rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rsl-pricing-price-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.125rem;
}

.rsl-pricing-currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--rsl-pricing-heading);
    align-self: flex-start;
    margin-top: 0.5rem;
}

.rsl-pricing-price {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--rsl-pricing-heading);
    line-height: 1;
    letter-spacing: -0.025em;
}

.rsl-pricing-price-period {
    font-size: 1rem;
    font-weight: 500;
    color: var(--rsl-pricing-text-muted);
    margin-left: 0.25rem;
}

/* Original price (for discounts) */
.rsl-pricing-original-price {
    font-size: 1rem;
    color: var(--rsl-pricing-text-muted);
    text-decoration: line-through;
    margin-top: 0.25rem;
}

/* Price note (billed annually, etc.) */
.rsl-pricing-price-note {
    font-size: 0.8125rem;
    color: var(--rsl-pricing-text-muted);
    margin-top: 0.5rem;
}

/* Custom price text (Contact Sales, Free, etc.) */
.rsl-pricing-custom-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rsl-pricing-heading);
}

/* ============================================
   Features List
   ============================================ */
.rsl-pricing-features {
    flex: 1;
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
    border-top: 1px solid var(--rsl-pricing-border);
    padding-top: 1.5rem;
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-features {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.rsl-pricing-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0;
    font-size: 0.9375rem;
    color: var(--rsl-pricing-text);
    line-height: 1.5;
}

.rsl-pricing-feature:first-child {
    padding-top: 0;
}

.rsl-pricing-feature-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
}

.rsl-pricing-feature-icon.included {
    color: var(--rsl-pricing-check);
}

.rsl-pricing-feature-icon.excluded {
    color: var(--rsl-pricing-cross);
    opacity: 0.6;
}

.rsl-pricing-feature-icon.partial {
    color: var(--rsl-pricing-partial);
}

.rsl-pricing-feature-icon svg {
    width: 18px;
    height: 18px;
}

.rsl-pricing-feature-text {
    flex: 1;
}

.rsl-pricing-feature.excluded .rsl-pricing-feature-text {
    color: var(--rsl-pricing-text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Feature with tooltip */
.rsl-pricing-feature-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.rsl-pricing-feature-tooltip-icon {
    width: 14px;
    height: 14px;
    margin-left: 0.375rem;
    color: var(--rsl-pricing-text-muted);
    opacity: 0.7;
}

.rsl-pricing-feature-tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--rsl-pricing-heading);
    color: #ffffff;
    font-size: 0.8125rem;
    border-radius: var(--rsl-pricing-radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--rsl-pricing-transition), visibility var(--rsl-pricing-transition);
    z-index: 10;
    margin-bottom: 0.5rem;
    min-width: 200px;
    max-width: 280px;
    width: max-content;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

.rsl-pricing-feature-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--rsl-pricing-heading);
}

.rsl-pricing-feature-tooltip:hover .rsl-pricing-feature-tooltip-content,
.rsl-pricing-feature-tooltip:focus-within .rsl-pricing-feature-tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* Feature category/group header */
.rsl-pricing-feature-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rsl-pricing-text-muted);
    padding: 1rem 0 0.5rem 0;
    border-top: 1px solid var(--rsl-pricing-border);
    margin-top: 0.5rem;
}

.rsl-pricing-feature-category:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-feature-category {
    color: rgba(255, 255, 255, 0.7);
    border-top-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   CTA Button
   ============================================ */
.rsl-pricing-cta {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: var(--rsl-pricing-radius-sm);
    border: 2px solid var(--rsl-pricing-accent);
    background: transparent;
    color: var(--rsl-pricing-accent);
    cursor: pointer;
    transition: all var(--rsl-pricing-transition);
    box-sizing: border-box;
    max-width: 100%;
}

.rsl-pricing-cta:hover {
    background: var(--rsl-pricing-accent);
    color: #ffffff;
    transform: translateY(-1px);
}

.rsl-pricing-cta:focus-visible {
    outline: 2px solid var(--rsl-pricing-accent);
    outline-offset: 2px;
}

.rsl-pricing-cta:active {
    transform: translateY(0);
}

/* Primary CTA (for highlighted tier) */
.rsl-pricing-cta.rsl-pricing-cta-primary {
    background: var(--rsl-pricing-accent);
    color: #ffffff;
    border-color: var(--rsl-pricing-accent);
}

.rsl-pricing-cta.rsl-pricing-cta-primary:hover {
    background: var(--rsl-pricing-accent-dark);
    border-color: var(--rsl-pricing-accent-dark);
}

/* CTA on highlighted tier */
.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-cta {
    background: #ffffff;
    color: var(--rsl-pricing-accent);
    border-color: #ffffff;
}

.rsl-pricing-tier.rsl-pricing-tier-highlighted .rsl-pricing-cta:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* Secondary CTA */
.rsl-pricing-cta.rsl-pricing-cta-secondary {
    background: transparent;
    color: var(--rsl-pricing-text-muted);
    border-color: var(--rsl-pricing-border);
}

.rsl-pricing-cta.rsl-pricing-cta-secondary:hover {
    background: var(--rsl-pricing-accent-light);
    color: var(--rsl-pricing-accent);
    border-color: var(--rsl-pricing-accent);
}

/* ============================================
   Comparison Variant (Table Layout)
   ============================================ */
.rsl-pricing-table-comparison {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rsl-pricing-comparison {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

/* Header row */
.rsl-pricing-comparison thead th {
    padding: 1.5rem 1rem;
    text-align: center;
    background: var(--rsl-pricing-bg);
    border-bottom: 2px solid var(--rsl-pricing-border);
    vertical-align: bottom;
    position: sticky;
    top: 0;
    z-index: 10;
}

.rsl-pricing-comparison thead th:first-child {
    text-align: left;
    width: 200px;
    min-width: 200px;
}

.rsl-pricing-comparison .rsl-pricing-comparison-tier-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.rsl-pricing-comparison .rsl-pricing-tier-name {
    margin: 0;
}

/* Highlighted column header */
.rsl-pricing-comparison th.highlighted {
    background: var(--rsl-pricing-accent);
    color: #ffffff;
}

.rsl-pricing-comparison th.highlighted .rsl-pricing-tier-name,
.rsl-pricing-comparison th.highlighted .rsl-pricing-tier-description,
.rsl-pricing-comparison th.highlighted .rsl-pricing-price,
.rsl-pricing-comparison th.highlighted .rsl-pricing-price-period {
    color: #ffffff;
}

/* Feature rows */
.rsl-pricing-comparison tbody tr {
    transition: background var(--rsl-pricing-transition);
}

.rsl-pricing-comparison tbody tr:hover {
    background: var(--rsl-pricing-accent-light);
}

.rsl-pricing-comparison tbody td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--rsl-pricing-border);
    vertical-align: middle;
}

.rsl-pricing-comparison tbody td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--rsl-pricing-text);
}

/* Highlighted column cells */
.rsl-pricing-comparison tbody td.highlighted {
    background: rgba(99, 102, 241, 0.05);
}

/* Category row */
.rsl-pricing-comparison tbody tr.category-row td {
    background: var(--rsl-pricing-accent-light);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rsl-pricing-accent);
    padding: 0.75rem 1rem;
}

/* CTA row */
.rsl-pricing-comparison tfoot td {
    padding: 1.5rem 1rem;
    background: var(--rsl-pricing-bg);
    border-top: 2px solid var(--rsl-pricing-border);
}

.rsl-pricing-comparison tfoot td:first-child {
    background: transparent;
}

/* ============================================
   Compact Variant
   ============================================ */
.rsl-pricing-table-compact .rsl-pricing-tier {
    --rsl-pricing-padding: 1.25rem;
}

.rsl-pricing-table-compact .rsl-pricing-tier-header {
    margin-bottom: 1rem;
}

.rsl-pricing-table-compact .rsl-pricing-tier-name {
    font-size: 1.125rem;
}

.rsl-pricing-table-compact .rsl-pricing-price {
    font-size: 2.5rem;
}

.rsl-pricing-table-compact .rsl-pricing-feature {
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.rsl-pricing-table-compact .rsl-pricing-cta {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
}

/* ============================================
   Horizontal Variant (Single Row)
   ============================================ */
.rsl-pricing-table-horizontal .rsl-pricing-tier {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
}

.rsl-pricing-table-horizontal .rsl-pricing-tier-header {
    text-align: left;
    margin-bottom: 0;
    min-width: 150px;
}

.rsl-pricing-table-horizontal .rsl-pricing-price-wrapper {
    min-height: auto;
    margin-bottom: 0;
    min-width: 120px;
}

.rsl-pricing-table-horizontal .rsl-pricing-features {
    flex-direction: row;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    border-top: none;
    padding-top: 0;
    margin-bottom: 0;
    flex: 1;
}

.rsl-pricing-table-horizontal .rsl-pricing-feature {
    padding: 0;
}

.rsl-pricing-table-horizontal .rsl-pricing-cta {
    width: auto;
    min-width: 140px;
}

.rsl-pricing-table-horizontal .rsl-pricing-badge {
    left: auto;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================
   Animation Styles
   ============================================ */
.rsl-pricing-animate .rsl-pricing-tier {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.rsl-pricing-animate .rsl-pricing-tier.rsl-pricing-visible {
    opacity: 1;
    transform: translateY(0);
}

.rsl-pricing-animate .rsl-pricing-tier.rsl-pricing-tier-highlighted.rsl-pricing-visible {
    transform: scale(1.02);
}

/* Stagger animation */
.rsl-pricing-animate .rsl-pricing-tier:nth-child(1) { transition-delay: 0ms; }
.rsl-pricing-animate .rsl-pricing-tier:nth-child(2) { transition-delay: 100ms; }
.rsl-pricing-animate .rsl-pricing-tier:nth-child(3) { transition-delay: 200ms; }
.rsl-pricing-animate .rsl-pricing-tier:nth-child(4) { transition-delay: 300ms; }
.rsl-pricing-animate .rsl-pricing-tier:nth-child(5) { transition-delay: 400ms; }

/* Price change animation */
.rsl-pricing-price-animate {
    animation: rsl-pricing-price-change 0.4s ease;
}

@keyframes rsl-pricing-price-change {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Footer Note
   ============================================ */
.rsl-pricing-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rsl-pricing-border);
}

.rsl-pricing-footer-text {
    font-size: 0.875rem;
    color: var(--rsl-pricing-text-muted);
    margin: 0;
}

.rsl-pricing-footer-link {
    color: var(--rsl-pricing-accent);
    text-decoration: none;
    font-weight: 500;
}

.rsl-pricing-footer-link:hover {
    text-decoration: underline;
}

/* ============================================
   Dark Mode Support
   ============================================ */
[data-theme="dark"] .rsl-pricing-table,
[data-theme="dark"].rsl-pricing-table {
    --rsl-pricing-bg: #334155;
    --rsl-pricing-border: #475569;
    --rsl-pricing-text: #e2e8f0;
    --rsl-pricing-text-muted: #94a3b8;
    --rsl-pricing-heading: #f8fafc;
    --rsl-pricing-accent-light: rgba(99, 102, 241, 0.2);
    --rsl-pricing-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --rsl-pricing-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Dark mode tier cards - ensure readable text */
[data-theme="dark"] .rsl-pricing-tier {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .rsl-pricing-tier-name {
    color: #f8fafc;
}

[data-theme="dark"] .rsl-pricing-tier-description {
    color: #94a3b8;
}

[data-theme="dark"] .rsl-pricing-price,
[data-theme="dark"] .rsl-pricing-currency,
[data-theme="dark"] .rsl-pricing-custom-price {
    color: #f8fafc !important;
}

[data-theme="dark"] .rsl-pricing-price-period {
    color: #94a3b8;
}

[data-theme="dark"] .rsl-pricing-feature-text {
    color: #e2e8f0;
}

[data-theme="dark"] .rsl-pricing-feature-category {
    color: #94a3b8;
}

[data-theme="dark"] .rsl-pricing-original-price {
    color: #94a3b8;
}

/* Dark mode highlighted tier - keep gradient but ensure text is readable */
[data-theme="dark"] .rsl-pricing-tier-highlighted {
    background: var(--rsl-pricing-highlight-bg);
    color: #ffffff;
}

[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-tier-name,
[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-tier-description,
[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-price,
[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-price-period,
[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-feature-text,
[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-original-price {
    color: #ffffff;
}

[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-price-note {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .rsl-pricing-tier-highlighted .rsl-pricing-feature-category {
    color: rgba(255, 255, 255, 0.8);
}

/* Dark mode CTA buttons */
[data-theme="dark"] .rsl-pricing-cta {
    border-color: var(--rsl-pricing-accent) !important;
    color: #c7d2fe !important;
}

[data-theme="dark"] .rsl-pricing-cta:hover,
[data-theme="dark"] .rsl-pricing-cta:focus {
    background: var(--rsl-pricing-accent) !important;
    border-color: var(--rsl-pricing-accent) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .rsl-pricing-cta.rsl-pricing-cta-secondary {
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .rsl-pricing-cta.rsl-pricing-cta-secondary:hover,
[data-theme="dark"] .rsl-pricing-cta.rsl-pricing-cta-secondary:focus {
    background: var(--rsl-pricing-accent) !important;
    border-color: var(--rsl-pricing-accent) !important;
    color: #ffffff !important;
}

/* Dark mode toggle labels */
[data-theme="dark"] .rsl-pricing-toggle-label {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .rsl-pricing-toggle-label.active {
    color: #ffffff !important;
}

[data-theme="dark"] .rsl-pricing-toggle {
    background: #475569;
}

[data-theme="dark"] .rsl-pricing-toggle:hover {
    background: #64748b;
}

[data-theme="dark"] .rsl-pricing-savings {
    background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .rsl-pricing-comparison thead th {
    background: #1e293b;
}

[data-theme="dark"] .rsl-pricing-comparison tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .rsl-pricing-comparison tbody tr.category-row td {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .rsl-pricing-comparison tbody td.highlighted {
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .rsl-pricing-feature-tooltip-content {
    background: #f1f5f9;
    color: #1e293b;
}

[data-theme="dark"] .rsl-pricing-feature-tooltip-content::after {
    border-top-color: #f1f5f9;
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .rsl-pricing-tier,
    .rsl-pricing-toggle,
    .rsl-pricing-toggle-knob,
    .rsl-pricing-cta,
    .rsl-pricing-feature-tooltip-content,
    .rsl-pricing-animate .rsl-pricing-tier {
        transition: none !important;
        animation: none !important;
    }

    .rsl-pricing-tier:hover {
        transform: none;
    }

    .rsl-pricing-animate .rsl-pricing-tier {
        opacity: 1;
        transform: none;
    }

    .rsl-pricing-tier.rsl-pricing-tier-highlighted {
        transform: scale(1.02);
    }
}

/* ============================================
   Focus Styles (Accessibility)
   ============================================ */
.rsl-pricing-tier:focus-within {
    outline: 2px solid var(--rsl-pricing-accent);
    outline-offset: 4px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .rsl-pricing-tier {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .rsl-pricing-tier.rsl-pricing-tier-highlighted {
        background: #f0f0f0;
        color: inherit;
    }

    .rsl-pricing-toggle-wrapper {
        display: none;
    }

    .rsl-pricing-animate .rsl-pricing-tier {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Responsive Breakpoints
   ============================================ */
@media (max-width: 1024px) {
    .rsl-pricing-tiers[data-tier-count="4"],
    .rsl-pricing-tiers[data-tier-count="5"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rsl-pricing-tiers[data-tier-count="2"],
    .rsl-pricing-tiers[data-tier-count="3"] {
        grid-template-columns: 1fr;
    }

    .rsl-pricing-tier.rsl-pricing-tier-highlighted {
        transform: none;
        order: -1;
    }

    .rsl-pricing-tier.rsl-pricing-tier-highlighted:hover {
        transform: translateY(-4px);
    }

    .rsl-pricing-toggle-wrapper {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* Horizontal variant stacks on mobile */
    .rsl-pricing-table-horizontal .rsl-pricing-tier {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .rsl-pricing-table-horizontal .rsl-pricing-tier-header {
        text-align: center;
    }

    .rsl-pricing-table-horizontal .rsl-pricing-features {
        justify-content: center;
    }

    .rsl-pricing-table-horizontal .rsl-pricing-cta {
        width: 100%;
    }

    .rsl-pricing-table-horizontal .rsl-pricing-badge {
        left: 50%;
        right: auto;
        top: -12px;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .rsl-pricing-tiers[data-tier-count="4"],
    .rsl-pricing-tiers[data-tier-count="5"] {
        grid-template-columns: 1fr;
    }

    .rsl-pricing-tier {
        --rsl-pricing-padding: 1.5rem;
    }

    .rsl-pricing-price {
        font-size: 2.75rem;
    }

    .rsl-pricing-currency {
        font-size: 1.25rem;
    }
}

/* ============================================
   Mobile Accordion Mode
   ============================================ */
.rsl-pricing-accordion .rsl-pricing-tier {
    cursor: pointer;
}

.rsl-pricing-accordion .rsl-pricing-tier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rsl-pricing-accordion .rsl-pricing-accordion-icon {
    width: 24px;
    height: 24px;
    transition: transform var(--rsl-pricing-transition);
}

.rsl-pricing-accordion .rsl-pricing-tier[aria-expanded="true"] .rsl-pricing-accordion-icon {
    transform: rotate(180deg);
}

.rsl-pricing-accordion .rsl-pricing-tier-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.rsl-pricing-accordion .rsl-pricing-tier[aria-expanded="true"] .rsl-pricing-tier-content {
    max-height: 2000px;
}

/* ============================================
   FilterBus Integration
   ============================================ */
.rsl-pricing-tier.rsl-pricing-filterbus-hidden {
    display: none !important;
}

/* ============================================
   Currency Formatting Helpers
   ============================================ */
.rsl-pricing-currency-eur .rsl-pricing-currency::before { content: '\20AC'; }
.rsl-pricing-currency-gbp .rsl-pricing-currency::before { content: '\00A3'; }
.rsl-pricing-currency-jpy .rsl-pricing-currency::before { content: '\00A5'; }
