/* =============================================
   Tariffs Page Styles
   ============================================= */

.tariffs-hero {
    background-color: #e0e5fd;
    padding: 20px 0 60px;
    text-align: center;
}

.tariffs-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 16px;
}

.text-highlight {
    background-color: rgb(255 255 255 / 40%);
    color: var(--brand-purple);
    padding: 2px 18px;
    border-radius: 100px;
    border-top-right-radius: 0;
}

.tariffs-hero p {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 32px;
}

/* Billing period switch (sticky bar above the plan cards) */
.pricing-wrap {
    position: relative;
}

.billing-bar {
    position: sticky;
    top: calc(var(--header-offset, 0px) + 80px);
    z-index: 30;
    text-align: center;
    padding: 10px 0;
    margin-top: -70px;
    margin-bottom: 70px;
}

.billing-switch {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    border-radius: 100px;
    background: var(--brand-purple);
    box-shadow: 0 10px 30px rgba(85,52,165,0.35);
}

.billing-option {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.billing-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.billing-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    opacity: 14px;
    transition: 0.3s;
    white-space: nowrap;
}

.billing-option:hover .billing-pill {
    opacity: 1;
    background: rgba(255,255,255,0.12);
}

.billing-option input:checked + .billing-pill {
    height: 100%;
    background: #fff;
    color: var(--brand-purple);
    opacity: 1;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.billing-option input:focus-visible + .billing-pill {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.save-badge {
    background: #10b981;
    color: #fff;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 30px;
}

/* one line on every screen size: shrink instead of wrapping */
@media (max-width: 767px) {
    .billing-bar {
        top: calc(var(--header-offset, 0px) + 62px);
        padding: 8px 0;
        margin-bottom: 20px;
    }
    .billing-switch {
        display: flex;
        width: calc(100% + 30px);
        gap: 2px;
        padding: 4px;
        border-radius: 0;
        position: relative;
        right: -15px;
    }
    .billing-option {
        flex: 1 1 0;
        min-width: 0;
    }
    .billing-pill {
        width: 100%;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 8px 2px;
        border-radius: 16px;
        font-size: 0.82rem;
        min-height: 54px;
    }
    .save-badge {
        font-size: 0.62rem;
        padding: 1px 6px;
    }
}

@media (max-width: 380px) {
    .billing-pill {
        font-size: 0.76rem;
    }
    .save-badge {
        font-size: 0.56rem;
        padding: 1px 5px;
    }
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 80px;
}

@media (max-width: 991px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto 60px;
    }
}

.pricing-card {
    background: #fff;
    border-radius: 24px;
    padding: 36px 28px;
    border: 2px solid #e2e8f0;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    border-color: var(--brand-purple);
    box-shadow: 0 20px 40px rgba(106,92,226,0.1);
    transform: translateY(-4px);
}

.pricing-card-featured {
    border-color: var(--brand-purple);
    background: linear-gradient(160deg, #f5f3ff 0%, #fff 60%);
    box-shadow: 0 20px 50px rgba(106,92,226,0.15);
}

.featured-ribbon {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-purple);
    color: #fff;
    padding: 4px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.plan-header {
    margin-bottom: 24px;
}

.plan-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.badge-starter { background: #e0f2fe; color: #0284c7; }
.badge-pro     { background: #ede9fe; color: #7c3aed; }
.badge-business{ background: #fef3c7; color: #d97706; }

.plan-name {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.plan-desc {
    font-size: 0.9rem;
    color: #64748b;
}

.plan-price {
    margin-bottom: 24px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-heading);
}

.price-unit {
    font-size: 0.9rem;
    color: #94a3b8;
    display: block;
    margin-top: 4px;
}

.price-amount-text {
    font-size: 1.7rem;
}

.price-old {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    min-height: 24px;
}

.price-old[hidden] {
    display: flex;
    visibility: hidden;
}

.price-old del {
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 600;
}

.save-chip {
    background: #d1fae5;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 30px;
}

.price-total {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #64748b;
    background: #f8fafc;
    border-radius: 10px;
    padding: 6px 12px;
    min-height: 32px;
}

.pricing-card-featured .price-total {
    background: #ede9fe;
    color: #6d28d9;
}

/* Plan CTA Buttons */
.btn-plan {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 28px;
    text-align: center;
}

.btn-plan-primary {
    background: var(--brand-purple);
    color: #fff;
}

.btn-plan-primary:hover {
    background: var(--brand-purple-dark);
}

.btn-plan-outline {
    background: transparent;
    border: 2px solid #cbd5e1;
    color: var(--text-heading);
}

.btn-plan-outline:hover {
    border-color: var(--brand-purple);
    color: var(--brand-purple);
}

.btn-poe {
    margin-top: 80px;
}

/* Features List */
.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.feature-yes::before {
    content: '✓';
    width: 22px;
    height: 22px;
    background: #d1fae5;
    color: #059669;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    flex-shrink: 0;
}

.feature-no {
    opacity: 0.4;
}

.feature-no::before {
    content: '×';
    width: 22px;
    height: 22px;
    background: #f1f5f9;
    color: #94a3b8;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Compare Table */
.compare-section {
    margin-top: 40px;
}

.compare-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--text-heading);
}

.compare-subtitle {
    color: #64748b;
    margin: 0 0 32px;
}

.compare-table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.compare-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    text-align: center;
    direction: rtl;
}

.compare-table tbody tr:not(.cat-row):hover td {
    background: #fafafa;
}

.compare-table tbody tr:not(.cat-row):hover td.td-featured {
    background: #ede9fe;
}

/* keep the feature-name column visible on horizontal scroll (mobile) */
.compare-table th:first-child,
.compare-table td:first-child {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 1;
    min-width: 220px;
}

.compare-table thead th:first-child {
    background: #f8fafc;
}

.row-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.7;
}

.price-row td {
    background: #fcfcff;
    padding-top: 18px;
    padding-bottom: 18px;
}

.price-row strong {
    font-size: 1.15rem;
    font-weight: 900;
}

.price-row small {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 400;
}

.compare-table th, .compare-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.compare-table thead th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-heading);
    font-size: 1rem;
}

.compare-table td:first-child,
.compare-table th:first-child {
    text-align: right;
    font-weight: 600;
    color: var(--text-heading);
}

.th-featured {
    background: var(--brand-purple) !important;
    color: #fff !important;
}

.td-featured {
    background: #f5f3ff;
    font-weight: 700;
    color: var(--brand-purple);
}

.cat-row td,
.compare-table .cat-row td:first-child {
    background: #f8fafc;
    font-weight: 700;
    text-align: right;
    color: #475569;
    font-size: 0.85rem;
    padding: 10px 20px;
}

.tbl-yes::before {
    content: '✓';
    color: #059669;
    font-size: 1.1rem;
    font-weight: 900;
}

.tbl-no::before {
    content: '—';
    color: #cbd5e1;
}

small.row-hint {
    font-weight: normal;
}


/* =============================================
   Responsive
   ============================================= */

/* plan tabs for compare table (hidden on desktop) */
.compare-tabs {
    display: none;
}

/* Tablet & below: single column cards, popular plan first */
@media (max-width: 991px) {
    .tariffs-hero {
        padding: 20px 0 44px;
    }
    .pricing-card-featured {
        order: -1;
    }
    .btn-poe {
        margin-top: 0;
    }
    .pricing-grid {
        gap: 36px;
        margin-bottom: 48px;
    }
}

/* Touch devices: no hover lift */
@media (hover: none) {
    .pricing-card:hover {
        transform: none;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .tariffs-hero {
        padding: 20px 0 36px;
    }
    .tariffs-hero h1 {
        font-size: 2rem;
        line-height: 1.5;
        margin-bottom: 10px;
    }
    .tariffs-hero p {
        font-size: 1rem;
        margin-bottom: 24px;
        line-height: 1.9;
    }

    .pricing-card {
        padding: 32px 20px 24px;
        border-radius: 20px;
    }
    .plan-name {
        font-size: 1.5rem;
    }
    .price-amount {
        font-size: 1.8rem;
    }
    .plan-features li {
        font-size: 0.92rem;
        align-items: flex-start;
        line-height: 1.7;
    }
    .plan-features li::before {
        margin-top: 2px;
    }

    /* ---- Compare table: show one plan at a time ---- */
    .compare-section {
        margin-top: 8px;
    }
    .compare-title {
        font-size: 1.5rem;
    }
    .compare-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .compare-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        background: #f1f5f9;
        padding: 5px;
        border-radius: 16px;
        margin-bottom: 14px;
    }
    .compare-tab {
        border: 0;
        background: transparent;
        font-family: inherit;
        font-size: 0.95rem;
        font-weight: 700;
        color: #475569;
        padding: 12px 4px;
        border-radius: 12px;
        cursor: pointer;
        transition: 0.25s;
    }
    .compare-tab[aria-selected="true"] {
        background: var(--brand-purple);
        color: #fff;
        box-shadow: 0 6px 16px rgba(106,92,226,0.3);
    }
    .compare-tab:focus-visible {
        outline: 3px solid var(--brand-purple);
        outline-offset: 2px;
    }

    .compare-table-wrapper {
        overflow-x: visible;
    }
    /* rows become 2-column grids (feature name | selected plan value) */
    .compare-table,
    .compare-table thead,
    .compare-table tbody {
        display: block;
        min-width: 0;
        width: 100%;
    }
    .compare-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 40%;
        align-items: stretch;
    }
    .compare-table tr.cat-row {
        grid-template-columns: 1fr;
    }
    .compare-table td,
    .compare-table th {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        text-align: center;
        word-break: break-word;
    }
    .compare-table td:first-child,
    .compare-table th:first-child {
        display: block;
        text-align: right;
    }
    .compare-table .cat-row td {
        display: block;
    }
    .compare-table .price-row td:not(:first-child) {
        flex-direction: column;
    }

    /* hide the plans that are not selected (col 2 = starter, 3 = pro, 4 = business) */
    .compare-table[data-active="2"] th:nth-child(3),
    .compare-table[data-active="2"] td:nth-child(3),
    .compare-table[data-active="2"] th:nth-child(4),
    .compare-table[data-active="2"] td:nth-child(4),
    .compare-table[data-active="3"] th:nth-child(2),
    .compare-table[data-active="3"] td:nth-child(2),
    .compare-table[data-active="3"] th:nth-child(4),
    .compare-table[data-active="3"] td:nth-child(4),
    .compare-table[data-active="4"] th:nth-child(2),
    .compare-table[data-active="4"] td:nth-child(2),
    .compare-table[data-active="4"] th:nth-child(3),
    .compare-table[data-active="4"] td:nth-child(3) {
        display: none;
    }

    .compare-table th,
    .compare-table td {
        padding: 14px 12px;
        font-size: 0.9rem;
        vertical-align: middle;
    }
    .compare-table th:first-child,
    .compare-table td:first-child {
        position: static;
        min-width: 0;
    }
    .compare-table .cat-row td,
    .compare-table .cat-row td:first-child {
        padding: 10px 12px;
    }

    /* active column: always highlighted, whichever plan is selected */
    .compare-table thead th:not(:first-child) {
        background: var(--brand-purple);
        color: #fff;
    }
    .compare-table td:not(:first-child) {
        background: #f5f3ff;
        color: var(--brand-purple);
        font-weight: 700;
        line-height: 1.7;
    }
    .compare-table tbody tr:not(.cat-row):hover td,
    .compare-table tbody tr:not(.cat-row):hover td:not(:first-child) {
        background: inherit;
    }
    .compare-table .cat-row td {
        background: #f8fafc;
        color: #475569;
    }

    .row-hint {
        font-size: 0.75rem;
        line-height: 1.8;
    }
    .price-row small {
        display: block;
    }
    .price-row strong {
        font-size: 1.05rem;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .tariffs-hero h1 {
        font-size: 1.7rem;
    }
    .price-amount {
        font-size: 1.6rem;
    }
    .compare-tab {
        font-size: 0.88rem;
    }
}

@media (max-width: 767px) {
    .compare-table[data-active="2"] th:nth-child(3), .compare-table[data-active="2"] td:nth-child(3),
    .compare-table[data-active="2"] th:nth-child(4), .compare-table[data-active="2"] td:nth-child(4),
    .compare-table[data-active="3"] th:nth-child(2), .compare-table[data-active="3"] td:nth-child(2),
    .compare-table[data-active="3"] th:nth-child(4), .compare-table[data-active="3"] td:nth-child(4),
    .compare-table[data-active="4"] th:nth-child(2), .compare-table[data-active="4"] td:nth-child(2),
    .compare-table[data-active="4"] th:nth-child(3), .compare-table[data-active="4"] td:nth-child(3) {
        display: none;
    }
}

/* hero no longer holds the switch; pricing section starts closer to it */
.tariffs-hero p {
    margin-bottom: 25px;
}
section.pricing-section.section-padding {
    padding-top: 28px;
}
