/* UX fixes shared by the WordPress and WooCommerce hosting pages (mobile comparison table, speed card,
   contrast and small text). Loaded from the page head; selectors are scoped and
   specific enough to win over the older page CSS that loads later. */

/* Comparison table on phones/tablets: the plan-name header row is hidden below
   992px and the table was a 650px-wide strip inside a 358px box. Show each
   feature as a block: feature name on top, the three plans side by side below,
   each value labelled with its plan name. */
@media (max-width: 991px) {
    #Comparisonplans .compare-table-wrapper,
    #Comparisonplans .compare-table-wrapper table.compare-table,
    #Comparisonplans .compare-table-wrapper table.compare-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-bottom: 1px solid #E6ECF8;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr > td {
        display: block !important;
        position: static !important;
        width: auto !important;
        min-width: 0 !important;
        box-shadow: none !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        text-align: center !important;
        font-size: 14px !important;
        padding: 10px 6px !important;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr > td:first-child {
        grid-column: 1 / -1;
        text-align: right !important;
        font-size: 15px !important;
        font-weight: 700;
        padding: 12px 16px 4px !important;
        background: transparent !important;
        border: none !important;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr.category-row > td:first-child {
        background: #E6ECF8 !important;
        color: var(--nc-navy, #001538) !important;
        padding: 12px 16px !important;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr > td:nth-child(n+2)::before {
        display: block;
        font-size: 12px;
        font-weight: 500;
        color: #475569;
        margin-bottom: 4px;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr > td:nth-child(2)::before { content: var(--nc-plan-1, "استارتر"); }
    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr > td:nth-child(3)::before { content: var(--nc-plan-2, "حرفه‌ای"); }
    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr > td:nth-child(4)::before { content: var(--nc-plan-3, "پیشرفته"); }

    #Comparisonplans .compare-table-wrapper table.compare-table .value-highlight {
        font-size: 14px !important;
    }
}

@media (max-width: 991px) {
    /* Plan names default to استارتر/حرفه‌ای/پیشرفته; pages with other plan
       names set --nc-plan-1..3 on #Comparisonplans. */
    /* limoo.style.css gives every td:before position:absolute (old responsive
       table pattern), which pushed the plan labels out of the cell. */
    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr > td:nth-child(n+2)::before {
        position: static !important;
        width: auto !important;
        padding: 0 !important;
        white-space: normal !important;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr.cta-row > td:first-child {
        display: none !important;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr.cta-row > td::before {
        content: none !important;
    }

    #Comparisonplans .compare-table-wrapper table.compare-table tbody tr.cta-row > td {
        padding: 14px 4px !important;
    }

    #Comparisonplans .compare-table-wrapper .compare-cta-btn {
        display: flex !important;
        width: 100% !important;
        height: auto !important;
        min-height: 44px;
        padding: 10px 4px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }
}

/* "Fast loading" benefit card: three stat boxes with min-width 140px made the
   content 484px wide inside a 358px card with overflow:hidden, so text and
   stats were cut off on phones. */
@media (max-width: 767px) {
    .why-feature-card.large .feature-content {
        min-width: 0 !important;
        width: 100% !important;
    }

    .why-feature-card.large .feature-stats {
        gap: 8px !important;
    }

    .why-feature-card.large .feature-stats .stat-item {
        min-width: 0 !important;
        width: auto !important;
        flex: 1 1 0 !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .why-feature-card.large .feature-stats .stat-item > *:first-child {
        font-size: 24px !important;
    }
}

/* Contrast (WCAG AA). Brand teal var(--nc-teal, #1AB8C9) on light backgrounds is only ~2.3:1;
   var(--nc-teal-text, #0A7380) is the same hue darkened to 5.3:1. On the dark featured card the
   blue var(--nc-blue, #1654E0) was 2.4:1; brand teal there is 7.5:1. */
.pricing-card:not(.featured) .tier-discount,
.why-feature-card .stat-value,
.tech-stat .tech-stat-value,
.speed-card-title span {
    color: var(--nc-teal-text, #0A7380) !important;
}

.pricing-card.featured .spec-value {
    color: var(--nc-teal, #1AB8C9) !important;
}

.location-tabs .location-tab:not(.active) {
    color: #475569 !important;
}

/* Text below 12px (support card descriptions were 11px on phones; several
   labels and badges were 10-11px). This file loads before layouts-master-1.css,
   hence the extra parent selectors. */
body .support-features-grid .support-feature-card p {
    font-size: 14px !important;
    line-height: 1.7 !important;
}

body .tech-stat .tech-stat-label,
body .tech-bar-name .winner-badge,
body .progress-value .progress-label,
body .pricing-card .featured-badge,
body .compare-table .plan-header .plan-popular {
    font-size: 12px !important;
}

/* WooCommerce page: "campaign performance" card. */
.woo-chart-labels span {
    color: #64748B !important; /* was #94A3B8, 2.6:1 on white */
}

.woo-perf-badge.live {
    color: #053B32 !important; /* light text on the green badge was 1.6:1 */
}

.woo-metric .woo-metric-value.success {
    color: #15803D !important; /* was #22C55E, 2.3:1 on white */
}

body .woo-chart-bar span {
    font-size: 12px !important;
}

/* ---- Tech comparison: the navy slant follows the header's real height ----
   The old ::before was a fixed 300-350px, so a heading or intro that wrapped to more lines
   ended up as white text on the white part of the slant. The slant now hangs off the header. */
section.tech-compare-section::before {
    display: none;
}

section.tech-compare-section .tech-header {
    position: relative;
    isolation: isolate;
}

section.tech-compare-section .tech-header::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -100px;
    bottom: -150px;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--nc-navy, #001538) 0%, var(--nc-navy-deep, #00102A) 100%);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 90px), 0 100%);
    pointer-events: none;
}

@media (max-width: 767px) {
    section.tech-compare-section .tech-header::before {
        top: -60px;
        bottom: -90px;
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), 0 100%);
    }
}

/* "More specs" link under the plans: teal text on white is 2.4:1, use the text teal.
   (Scoped to its wrapper: the table's "choose plan" buttons share the class.) */
.compare-cta-wrapper .compare-cta-btn {
    color: var(--nc-teal-text, #0A7380) !important;
    border-color: rgba(10, 115, 128, 0.35) !important;
}

/* "Our pick" badge in the speed bars: navy on solid teal instead of white on a teal-to-blue gradient. */
.tech-bar-name .winner-badge {
    background: var(--nc-teal, #1AB8C9) !important;
    color: var(--nc-navy, #001538) !important;
}

/* Hero button: navy text on a blue-to-teal gradient was 2.9:1 on the blue end.
   Same solid brand blue with white text as the home page (6.2:1). */
.hero-cta-btn,
.hero-cta-btn span {
    color: #FFFFFF !important;
}

.hero-cta-btn {
    background: var(--nc-blue, #1654E0) !important;
}

/* "کاربلد" in the support banner: gradient text over a photo dropped to 2.6:1; solid teal instead. */
.support-hero-title span {
    background: none !important;
    -webkit-text-fill-color: var(--nc-teal, #1AB8C9) !important;
    color: var(--nc-teal, #1AB8C9) !important;
}
