/*
 * PricePro template — SaaS pricing table
 * ----------------------------------------------------------------------------
 * Modern card-based plan layout with:
 *  - auto-fit grid (minmax 260px) so 1 to 4 plans fit naturally
 *  - equalized column heights (flex column, features pushed by flex:1)
 *  - recommended plan elevated with translateY and 2px accent border
 *  - animated billing toggle (pill style)
 *
 * Applies to .pricepro-table--saas only — does not target lists.
 */

.pricepro-table--saas {
    --pp-bg: #ffffff;
    --pp-accent: #6366f1;
    --pp-text: #111827;
    --pp-muted: #6b7280;
    --pp-border: #e5e7eb;
    --pp-card-bg: #ffffff;
    --pp-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    background: var(--pp-bg);
    color: var(--pp-text);
    font-family: var(--pp-font-family);
    padding: 3rem 2rem;
    border-radius: 0;
    line-height: 1.5;
}

.pricepro-table--saas .pricepro-table__title {
    text-align: center;
    color: var(--pp-text);
    font-size: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
    font-weight: 700;
    margin: 0 0 1.5rem;
    letter-spacing: -0.01em;
}

/* Billing toggle pill */
.pricepro-table--saas .pricepro-table__toggle {
    display: inline-flex;
    margin: 0 auto 2.5rem;
    background: #f3f4f6;
    border: 1px solid var(--pp-border);
    border-radius: 999px;
    padding: 0.25rem;
    align-self: center;
}

.pricepro-table--saas .pricepro-table__toggle-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    background: transparent;
    color: var(--pp-muted);
    border: 0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.pricepro-table--saas .pricepro-table__toggle-btn[aria-pressed="true"],
.pricepro-table--saas .pricepro-table__toggle-btn--active {
    background: var(--pp-accent);
    color: #fff;
}

/* Layout shell — center the toggle, then plans in an auto-fit grid */
.pricepro-table--saas {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.pricepro-table--saas .pricepro-table__toggle {
    align-self: center;
}

.pricepro-table--saas .pricepro-table__plans {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

/* Each plan: flex column so the button is pushed to the bottom */
.pricepro-table--saas .pricepro-table__plan {
    display: flex;
    flex-direction: column;
    background: var(--pp-card-bg);
    border: 1px solid var(--pp-border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricepro-table--saas .pricepro-table__plan:hover {
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.1);
}

.pricepro-table--saas .pricepro-table__plan--recommended {
    border: 2px solid var(--pp-accent);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -16px rgba(99, 102, 241, 0.25);
}

.pricepro-table--saas .pricepro-table__plan-badge {
    position: absolute;
    top: -12px;
    right: 1.5rem;
    left: auto;
    transform: none;
    background: var(--pp-accent);
    color: #fff;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.pricepro-table--saas .pricepro-table__plan-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--pp-text);
}

.pricepro-table--saas .pricepro-table__plan-subtitle {
    color: var(--pp-muted);
    font-size: 0.875rem;
    margin: 0 0 1.25rem;
}

.pricepro-table--saas .pricepro-table__plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0 0 1.5rem;
}

.pricepro-table--saas .pricepro-table__plan-price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--pp-accent);
    line-height: 1;
    letter-spacing: -0.02em;
}

.pricepro-table--saas .pricepro-table__plan-recurrence {
    color: var(--pp-muted);
    font-size: 0.875rem;
}

.pricepro-table--saas .pricepro-table__plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pricepro-table--saas .pricepro-table__plan-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--pp-border);
    font-size: 0.95rem;
    color: var(--pp-text);
}

.pricepro-table--saas .pricepro-table__plan-feature:last-child {
    border-bottom: 0;
}

.pricepro-table--saas .pricepro-table__plan-feature-icon {
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
    border-radius: 50%;
    background: #d1fae5;
    color: #047857;
    border: 0;
    margin-top: 0.15em;
}

.pricepro-table--saas .pricepro-table__plan-feature--excluded .pricepro-table__plan-feature-icon {
    background: #f3f4f6;
    color: #9ca3af;
}

.pricepro-table--saas .pricepro-table__plan-feature--excluded .pricepro-table__plan-feature-text {
    color: var(--pp-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

.pricepro-table--saas .pricepro-table__plan-button {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--pp-accent);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    margin-top: auto;
}

.pricepro-table--saas .pricepro-table__plan-button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .pricepro-table--saas {
        padding: 2rem 1.25rem;
    }

    .pricepro-table--saas .pricepro-table__plan--recommended {
        transform: none;
    }
}

/* Dark mode: invert surfaces, keep the indigo accent. */
@media (prefers-color-scheme: dark) {
    .pricepro-table--saas {
        --pp-bg: #0f172a;
        --pp-text: #f3f4f6;
        --pp-muted: #94a3b8;
        --pp-border: rgba(255, 255, 255, 0.12);
        --pp-card-bg: #1e293b;
    }

    .pricepro-table--saas .pricepro-table__toggle {
        background: rgba(255, 255, 255, 0.06);
    }

    .pricepro-table--saas .pricepro-table__plan-feature-icon {
        background: rgba(16, 185, 129, 0.18);
        color: #34d399;
    }

    .pricepro-table--saas .pricepro-table__plan-feature--excluded .pricepro-table__plan-feature-icon {
        background: rgba(255, 255, 255, 0.05);
        color: #6b7280;
    }
}
