/**
 * TA Pricing Table – Frontend Styles
 * Complete design system with CSS custom properties.
 */

/* === Fade-in animation === */
@keyframes taPtFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ta-pt-fade-in {
    animation: taPtFadeUp 0.5s ease both;
}

/* === Wrapper === */
.ta-pt-wrapper {
    margin: 40px auto;
    overflow-x: auto;
    border-radius: var(--ta-radius, 16px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    font-family: var(--ta-font, 'DM Sans', sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    direction: ltr;
}

/* RTL support */
[dir="rtl"] .ta-pt-wrapper {
    direction: rtl;
}

/* === Table === */
.ta-pt-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 600px;
}

/* === Header === */
.ta-pt-table thead th {
    padding: 28px 16px 24px;
    text-align: center;
    vertical-align: bottom;
    background: var(--ta-header-bg, #1a5a32);
    color: var(--ta-header-text, #ffffff);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.ta-pt-table thead th:first-child {
    text-align: left;
    padding-inline-start: 28px;
    border-left: none;
    width: 260px;
}

[dir="rtl"] .ta-pt-table thead th:first-child {
    text-align: right;
}

.ta-pt-table thead th:first-child {
    border-top-left-radius: var(--ta-radius, 16px);
}

[dir="rtl"] .ta-pt-table thead th:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: var(--ta-radius, 16px);
}

.ta-pt-table thead th:last-child {
    border-top-right-radius: var(--ta-radius, 16px);
}

[dir="rtl"] .ta-pt-table thead th:last-child {
    border-top-right-radius: 0;
    border-top-left-radius: var(--ta-radius, 16px);
}

/* === Featured column header === */
.ta-pt-plan-header.ta-pt-featured {
    background: var(--ta-highlight-bg, #f5c842);
    color: var(--ta-highlight-text, #1a5a32);
    position: relative;
}

/* === Plan header content === */
.ta-pt-plan-subtitle {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}

.ta-pt-plan-title {
    display: block;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.ta-pt-plan-price {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.85;
}

.ta-pt-plan-price strong {
    font-size: 26px;
    font-weight: 700;
    opacity: 1;
}

/* === Popular badge === */
.ta-pt-popular-badge {
    display: inline-block;
    background: var(--ta-header-bg, #1a5a32);
    color: var(--ta-highlight-bg, #f5c842);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    margin-bottom: 8px;
}

/* === Features header (first column) === */
.ta-pt-features-header span {
    font-size: 18px;
    font-weight: 700;
    color: var(--ta-highlight-bg, #f5c842);
}

/* === Body cells === */
.ta-pt-table tbody td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
    transition: background 0.15s ease;
}

.ta-pt-table tbody td:first-child {
    text-align: left;
    padding-inline-start: 28px;
    font-weight: 500;
    color: #1a1a1a;
}

[dir="rtl"] .ta-pt-table tbody td:first-child {
    text-align: right;
}

.ta-pt-table tbody td:not(:first-child) {
    border-left: 1px solid #e5e7eb;
}

[dir="rtl"] .ta-pt-table tbody td:not(:first-child) {
    border-left: none;
    border-right: 1px solid #e5e7eb;
}

/* === Zebra striping === */
.ta-pt-table tbody tr:nth-child(even) td {
    background: var(--ta-stripe, #f3f4f6);
}

/* === Row hover === */
.ta-pt-table tbody tr:hover td {
    background: var(--ta-hover, #e8f5ec);
}

/* === Featured column cells === */
.ta-pt-featured-col {
    background: var(--ta-highlight-tint, #fef9e7) !important;
}

.ta-pt-table tbody tr:nth-child(even) .ta-pt-featured-col {
    filter: brightness(0.97);
}

.ta-pt-table tbody tr:hover .ta-pt-featured-col {
    filter: brightness(0.93);
}

/* === Check icon === */
.ta-pt-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ta-check-color, #1a5a32);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

/* === Cross icon === */
.ta-pt-cross {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ta-cross-color, #e5e7eb);
    color: #c0c0c0;
    font-size: 14px;
    line-height: 1;
}

/* === Custom text value === */
.ta-pt-custom-value {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

/* === CTA row === */
.ta-pt-cta-row td {
    padding: 24px 16px 28px;
    border-bottom: none;
}

/* === Buttons === */
.ta-pt-btn {
    display: inline-block;
    padding: 11px 28px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    font-family: inherit;
    line-height: 1.4;
    box-sizing: border-box;
}

.ta-pt-btn:hover {
    text-decoration: none;
}

.ta-pt-btn:focus-visible {
    outline: 2px solid var(--ta-header-bg, #1a5a32);
    outline-offset: 2px;
}

/* Outline */
.ta-pt-btn-outline {
    background: transparent;
    border: 1.5px solid var(--ta-header-bg, #1a5a32);
    color: var(--ta-header-bg, #1a5a32);
}

.ta-pt-btn-outline:hover {
    background: var(--ta-hover, #e8f5ec);
    color: var(--ta-header-bg, #1a5a32);
}

/* Filled */
.ta-pt-btn-filled {
    background: var(--ta-header-bg, #1a5a32);
    color: #fff;
    border: 1.5px solid var(--ta-header-bg, #1a5a32);
}

.ta-pt-btn-filled:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #fff;
}

/* Gold */
.ta-pt-btn-gold {
    background: var(--ta-highlight-bg, #f5c842);
    color: var(--ta-highlight-text, #1a5a32);
    border: 1.5px solid var(--ta-highlight-bg, #f5c842);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ta-pt-btn-gold:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    color: var(--ta-highlight-text, #1a5a32);
}

/* === Bottom corners === */
.ta-pt-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--ta-radius, 16px);
}

[dir="rtl"] .ta-pt-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: var(--ta-radius, 16px);
}

.ta-pt-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--ta-radius, 16px);
}

[dir="rtl"] .ta-pt-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: var(--ta-radius, 16px);
}

/* ======================================================
   MOBILE: Cards Layout
   ====================================================== */
.ta-pt-mobile-cards {
    display: none;
    flex-direction: column;
    gap: 20px;
    padding: 0 4px;
}

.ta-pt-mobile-card {
    background: #fff;
    border-radius: var(--ta-radius, 16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1.5px solid #e5e7eb;
}

.ta-pt-mobile-card.ta-pt-card-featured {
    border: 2px solid var(--ta-header-bg, #1a5a32);
}

.ta-pt-mobile-card-header {
    padding: 24px 20px;
    background: var(--ta-header-bg, #1a5a32);
    color: var(--ta-header-text, #ffffff);
    text-align: center;
}

.ta-pt-card-featured .ta-pt-mobile-card-header {
    background: var(--ta-highlight-bg, #f5c842);
    color: var(--ta-highlight-text, #1a5a32);
}

.ta-pt-mobile-features {
    list-style: none;
    padding: 16px 20px;
    margin: 0;
}

.ta-pt-mobile-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
}

.ta-pt-mobile-features li:last-child {
    border-bottom: none;
}

.ta-pt-mobile-features li.excluded {
    opacity: 0.35;
    text-decoration: line-through;
}

.ta-pt-mobile-features li .ta-pt-check,
.ta-pt-mobile-features li .ta-pt-cross {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    font-size: 12px;
}

.ta-pt-mobile-card-footer {
    padding: 0 20px 24px;
    text-align: center;
}

.ta-pt-mobile-card-footer .ta-pt-btn {
    display: block;
    width: 100%;
}

/* ======================================================
   MOBILE: Accordion Layout
   ====================================================== */
.ta-pt-mobile-accordion {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.ta-pt-accordion-item {
    background: #fff;
    border-radius: var(--ta-radius, 16px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1.5px solid #e5e7eb;
}

.ta-pt-accordion-item.ta-pt-accordion-featured {
    border-color: var(--ta-header-bg, #1a5a32);
}

.ta-pt-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    background: var(--ta-header-bg, #1a5a32);
    color: var(--ta-header-text, #ffffff);
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

[dir="rtl"] .ta-pt-accordion-header {
    text-align: right;
}

.ta-pt-accordion-featured .ta-pt-accordion-header {
    background: var(--ta-highlight-bg, #f5c842);
    color: var(--ta-highlight-text, #1a5a32);
}

.ta-pt-accordion-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ta-pt-accordion-header .ta-pt-plan-title {
    font-size: 16px;
    margin-bottom: 0;
}

.ta-pt-accordion-header .ta-pt-plan-price {
    font-size: 13px;
}

.ta-pt-accordion-header .ta-pt-plan-price strong {
    font-size: 18px;
}

.ta-pt-accordion-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.ta-pt-accordion-header.ta-pt-accordion-open .ta-pt-accordion-arrow {
    transform: rotate(180deg);
}

.ta-pt-accordion-content {
    display: none;
    padding: 0;
}

.ta-pt-accordion-content .ta-pt-mobile-features {
    padding: 12px 20px;
}

.ta-pt-accordion-content .ta-pt-mobile-card-footer {
    padding: 0 20px 20px;
}

/* ======================================================
   SCROLL LAYOUT: sticky column shadow (injected dynamic)
   ====================================================== */

/* ======================================================
   Print styles
   ====================================================== */
@media print {
    .ta-pt-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .ta-pt-btn {
        border: 1px solid #333 !important;
    }

    .ta-pt-mobile-cards,
    .ta-pt-mobile-accordion {
        display: none !important;
    }

    .ta-pt-table {
        display: table !important;
    }
}
