/* ============================================================================
 * TraPay — reusable static SERVICE-PAGE wrapper styles
 *
 * ONE stylesheet for every top-menu service/landing page. Chrome only:
 * hero, trust strip, body wrapper, process, CTA band. The DB body content
 * keeps its own legacy styles (trapay-legacy-content.css).
 *
 * Design tokens: trapay-tokens.css (loaded globally). Never hardcode a hex —
 * alias to token vars below. .tp-* role classes supply all text sizing.
 * ============================================================================ */

:root {
    --brand:    var(--colors-primary-DEFAULT);        /* #0d3e7e */
    --brand-50: var(--colors-primary-50);             /* #eef4fc */
    --brand-100:var(--colors-primary-100);            /* #dbe8f8 */
    --brand-500:var(--colors-primary-500);
    --accent:   var(--colors-semantic-warning-base);  /* amber #F59E0B */
    --green:    var(--colors-semantic-success-base);  /* #10B981 */
    --ink:      var(--colors-surface-foreground);
    --muted:    var(--colors-neutral-500);
    --hair:     var(--colors-neutral-200);
    --tp-ease:  cubic-bezier(.2,.7,.2,1);
    --tp-ease-pop: cubic-bezier(.34,1.56,.64,1);

    /* category accent — defaults to brand blue, overridden per .svc--* below */
    --cat:      var(--brand);
    --cat-50:   var(--brand-50);
    --cat-ink:  var(--brand);        /* readable accent text on white */
}

/* ---- category brand accents (follow each service's real brand color) ---- */
.svc--paypal { --cat: #003087; --cat-50: #e9eff8; --cat-ink: #003087; }  /* PayPal blue */
.svc--card   { --cat: #EB001B; --cat-50: #fdeceb; --cat-ink: #c00016; }  /* Mastercard red */
.svc--wu     { --cat: #FFB600; --cat-50: #fff7e6; --cat-ink: #9a6a00; }  /* Western Union yellow (dark ink for contrast) */
.svc--utopia { --cat: #4CAF50; --cat-50: #eaf6ea; --cat-ink: #2e7d32; }  /* Utopia green */

/* ---- horizontal-overflow safety: no service section may bleed past the viewport ---- */
.svc-hero, .svc-trust, .svc-body-wrap, .svc-flow, .svc-cta { overflow-x: clip; }

/* ---- shared container + reveal ---- */
.svc-hero__inner,
.svc-trust__inner,
.svc-body-inner,
.svc-flow__inner,
.svc-cta__inner {
    max-width: 72rem;               /* max-w-6xl */
    margin-inline: auto;
    padding-inline: 20px;           /* px-5 */
}

@keyframes svc-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: svc-rise .7s var(--tp-ease) both; }

/* ============================ HERO ============================ */
.svc-hero {
    position: relative;
    overflow: hidden;
    padding-block: 80px;            /* py-20 */
    background: var(--brand-50);
    text-align: center;
}
@media (min-width: 1024px) { .svc-hero { padding-block: 112px; } } /* lg:py-28 */

.svc-hero__bg { position: absolute; inset: 0; pointer-events: none; }
.svc-hero__glow {
    position: absolute;
    width: 460px; height: 460px;
    border-radius: 9999px;
    filter: blur(90px);
    opacity: .28;
}
.svc-hero__glow--brand { background: var(--cat);  inset-inline-start: -120px; top: -140px; }
.svc-hero__glow--amber { background: var(--accent);  inset-inline-end: -120px; bottom: -160px; opacity: .18; }

.svc-hero__inner { position: relative; }

/* ---- breadcrumb ---- */
.svc-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 18px;
    font-size: .8125rem;
}
.svc-crumbs a { color: var(--cat-ink); text-decoration: none; opacity: .85; }
.svc-crumbs a:hover { opacity: 1; text-decoration: underline; }
.svc-crumbs__sep { color: var(--muted); }
.svc-crumbs__current { color: var(--muted); }

.svc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    padding: 6px 16px;
    background: #fff;
    color: var(--cat-ink);
    box-shadow: 0 1px 2px rgba(13,62,126,.08);
}
.svc-eyebrow__dot {
    width: 7px; height: 7px; border-radius: 9999px;
    background: var(--cat);
}

.svc-hero__title {
    margin-top: 20px;                /* mt-5 */
    color: var(--ink);
    line-height: 1.3;
    letter-spacing: -.01em;
    /* long Persian titles must wrap, never overflow the viewport */
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
/* smaller hero title on phones — .tp-display clamp is too wide for RTL headers.
   Scope with .svc-hero so it beats .tp-display regardless of stylesheet order. */
@media (max-width: 640px) {
    .svc-hero .svc-hero__title { font-size: 1.9rem; line-height: 1.45; }
}
.svc-hero__lead {
    margin-top: 16px;                /* mt-4 */
    margin-inline: auto;
    max-width: 44rem;
    color: var(--muted);
    line-height: 2;
}

.svc-hero__actions {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.svc-hero__edit {
    display: inline-block;
    margin-top: 20px;
    font-size: .8125rem;
    color: var(--brand-500);
    text-decoration: underline;
}

/* ---- buttons (shared) ---- */
.svc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    padding: 14px 32px;              /* a touch wider */
    min-height: 52px;               /* equal height for primary + ghost */
    font-family: var(--typography-fontFamily-sans);
    font-weight: 600;               /* semibold — never 700 */
    font-size: 1rem;
    white-space: nowrap;            /* keep «ثبت سفارش» on ONE line (was wrapping) */
    cursor: pointer;
    transition: transform .25s var(--tp-ease), box-shadow .25s var(--tp-ease), background .25s, color .25s;
}
.svc-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.svc-btn--primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand) 60%, transparent);
}
.svc-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px -14px color-mix(in srgb, var(--brand) 55%, transparent);
}
.svc-btn--ghost {
    background: #fff;
    color: var(--brand);
    border: 2px solid color-mix(in srgb, var(--brand) 20%, transparent);
}
.svc-btn--ghost:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.svc-btn--lg { padding: 16px 34px; }
.svc-btn .rtl-flip { transform: rotate(180deg); }

/* ============================ TRUST STRIP ============================ */
.svc-trust { padding-block: 0; margin-top: -34px; position: relative; z-index: 2; }
.svc-trust__inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: #fff;
    border: 1px solid var(--hair);
    border-radius: 24px;             /* rounded-3xl */
    padding: 24px;
    box-shadow: 0 20px 44px -28px color-mix(in srgb, var(--brand) 30%, transparent);
}
@media (min-width: 768px) { .svc-trust__inner { grid-template-columns: repeat(4, 1fr); } }

.svc-trust__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 8px;
}
.svc-trust__label { color: var(--brand); }
.svc-trust__sub   { color: var(--muted); }

/* ============================ SUB-SERVICES (hub) ============================ */
.svc-subs { padding-block: 56px 24px; }
.svc-subs__inner { max-width: 72rem; margin-inline: auto; padding-inline: 20px; }
.svc-subs__h { text-align: center; color: var(--ink); line-height: 1.5; }
.svc-subs__lead { text-align: center; color: var(--muted); margin-top: 8px; }
.svc-subs__grid {
    margin-top: 40px;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .svc-subs__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .svc-subs__grid { grid-template-columns: repeat(3, 1fr); } }

.svc-sub-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--hair);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    transition: transform .35s var(--tp-ease), box-shadow .35s, border-color .35s;
}
.svc-sub-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 44px -16px color-mix(in srgb, var(--brand) 28%, transparent);
    border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.svc-sub-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.svc-sub-card__title { color: var(--ink); }
.svc-sub-card__desc  { color: var(--muted); margin-top: 8px; flex: 1; }
.svc-sub-card__go {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cat-ink);
    font-weight: 600;
    font-size: .9375rem;
}
.svc-sub-card:hover { border-color: color-mix(in srgb, var(--cat) 35%, transparent); }
.svc-sub-card:hover { box-shadow: 0 20px 44px -16px color-mix(in srgb, var(--cat) 28%, transparent); }
.svc-sub-card__go .rtl-flip { transform: rotate(180deg); width: 18px; height: 18px; }
.svc-sub-card:hover .svc-sub-card__go { gap: 10px; }

.dark .svc-subs__h { color: #fff; }
.dark .svc-subs__lead { color: #94a3b8; }
.dark .svc-sub-card { background: #0f172a; border-color: #1f2937; }
.dark .svc-sub-card__title { color: #fff; }
.dark .svc-sub-card__desc  { color: #94a3b8; }
.dark .svc-sub-card__go { color: #cfe0ff; }

/* ============================ BODY WRAP ============================ */
.svc-body-wrap { padding-block: 56px 24px; }
.svc-body-inner { max-width: 52rem; }   /* narrower for reading comfort */

.tp-service-body { color: var(--ink); line-height: 2; }
.tp-service-body img { max-width: 100%; height: auto; border-radius: 12px; }

/* ---- flatten legacy Bootstrap boxes → clean flowing content (not box-after-box) ---- */
.tp-service-body .ibox2,
.tp-service-body .ibox {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
.tp-service-body .row { margin: 0 !important; display: block !important; }
.tp-service-body .row > [class*="col-"] { padding: 0 !important; width: auto !important; }

/* section rhythm: each H2 gets air + a subtle accent tick (replaces the boxes) */
.tp-service-body h2 {
    margin-top: 44px;
    margin-bottom: 14px;
    padding-inline-start: 14px;
    border-inline-start: 3px solid color-mix(in srgb, var(--cat) 55%, transparent);
    line-height: 1.6;
}
.tp-service-body h2:first-child { margin-top: 8px; }
.tp-service-body h3 { margin-top: 28px; margin-bottom: 10px; }
.tp-service-body p  { margin: 0 0 16px; }
.tp-service-body ul, .tp-service-body ol { margin: 0 0 18px; padding-inline-start: 22px; }
.tp-service-body li { margin-bottom: 6px; }
.tp-service-body strong { color: var(--ink); font-weight: 600; }

/* real callouts stay styled (sign / alert / block-note) — accent-tinted note cards */
.tp-service-body .sign,
.tp-service-body .alert,
.tp-service-body .block-note {
    display: block;
    margin: 22px 0;
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--cat-50);
    border: 1px solid color-mix(in srgb, var(--cat) 22%, transparent);
    border-inline-start: 4px solid var(--cat);
    color: var(--ink);
    font-weight: 500;
    line-height: 1.9;
}
.dark .tp-service-body h2 { border-inline-start-color: color-mix(in srgb, var(--cat) 60%, transparent); }
.dark .tp-service-body strong { color: #fff; }
.dark .tp-service-body .sign,
.dark .tp-service-body .alert,
.dark .tp-service-body .block-note {
    background: color-mix(in srgb, var(--cat) 14%, #0f172a);
    border-color: color-mix(in srgb, var(--cat) 30%, transparent);
    color: #e5e7eb;
}

/* ---- tables (styled card) — legacy .table markup + bare tables in DB body ---- */
.tp-service-body .table-responsive {
    margin: 28px 0;
    border: 1px solid var(--hair);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px -22px color-mix(in srgb, var(--cat) 40%, transparent);
}
/* bare tables (no .table-responsive wrapper, e.g. inline-styled comparison tables) */
.tp-service-body > table,
.tp-service-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: .9375rem;
    border: 1px solid var(--hair);
    border-radius: 16px;
    overflow: hidden;
}
.tp-service-body .table-responsive table {
    margin: 0 !important;   /* inside a wrapper → no double margin/gap */
    border: none;
    border-radius: 0;
}
/* thead (comparison tables) */
.tp-service-body table thead th {
    background: var(--cat-50);
    color: var(--cat-ink);
    font-weight: 600;
    padding: 14px 18px;
    border: none;
    border-bottom: 2px solid color-mix(in srgb, var(--cat) 30%, var(--hair));
    text-align: center;
}
.tp-service-body table tr { transition: background .2s var(--tp-ease); }
.tp-service-body table tbody tr:nth-child(even) { background: var(--cat-50); }
.tp-service-body table tbody tr:hover { background: color-mix(in srgb, var(--cat) 6%, #fff); }
.tp-service-body table td {
    padding: 14px 20px;
    border: none;
    border-bottom: 1px solid var(--hair);
    vertical-align: middle;
    text-align: center;
}
.tp-service-body table tbody tr:last-child td { border-bottom: none; }
/* 2-column key/value tables: first cell = label (wider, right-aligned) */
.tp-service-body table tr > td:first-child:nth-last-child(2) {
    font-weight: 600;
    text-align: start;
    width: 55%;
    border-inline-start: 1px solid var(--hair);
}
/* 2-column value cell (the last of exactly 2) → accent emphasis */
.tp-service-body table tr > td:last-child:nth-child(2) {
    color: var(--cat-ink);
    font-weight: 600;
}

.dark .tp-service-body .table-responsive,
.dark .tp-service-body table { border-color: #1f2937; }
.dark .tp-service-body table thead th { background: color-mix(in srgb, var(--cat) 16%, #0f172a); color: #fff; }
.dark .tp-service-body table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--cat) 12%, #0f172a); }
.dark .tp-service-body table tbody tr:hover { background: #1f2937; }
.dark .tp-service-body table td { border-bottom-color: #1f2937; color: #e5e7eb; }
.dark .tp-service-body table tr > td:first-child:nth-last-child(2) { border-inline-start-color: #1f2937; }
.dark .tp-service-body table tr > td:last-child:nth-child(2) { color: #cfe0ff; }

/* ---- FAQ accordion (styled <details>) ---- */
.tp-service-faq { margin-top: 8px; }
.tp-service-faq details {
    border: 1px solid var(--hair);
    border-radius: 14px;
    margin-bottom: 12px;
    background: #fff;
    overflow: hidden;
    transition: border-color .25s var(--tp-ease), box-shadow .25s var(--tp-ease);
}
.tp-service-faq details[open] {
    border-color: color-mix(in srgb, var(--brand) 30%, transparent);
    box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--brand) 40%, transparent);
}
.tp-service-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.tp-service-faq summary::-webkit-details-marker { display: none; }
.tp-service-faq summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--brand);
    transition: transform .25s var(--tp-ease);
    flex: none;
}
.tp-service-faq details[open] summary::after { transform: rotate(45deg); }
.tp-service-faq summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: -3px; }
.tp-service-faq details > p { padding: 0 20px 18px; color: var(--muted); margin: 0; }

.dark .tp-service-faq details { background: #0f172a; border-color: #1f2937; }
.dark .tp-service-faq summary { color: #e5e7eb; }
.dark .tp-service-faq summary::after { color: #cfe0ff; }
.dark .tp-service-faq details > p { color: #94a3b8; }

/* ============================ PROCESS ============================ */
.svc-flow { padding-block: 56px; background: var(--colors-neutral-50, #f9fafb); }
.svc-flow__h { text-align: center; color: var(--ink); line-height: 1.5; }
.svc-flow__steps {
    list-style: none;
    margin: 48px 0 0;
    padding: 0;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) { .svc-flow__steps { grid-template-columns: repeat(3, 1fr); } }

.svc-step {
    background: #fff;
    border: 1px solid var(--hair);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    transition: transform .35s var(--tp-ease), box-shadow .35s, border-color .35s;
}
.svc-step:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 44px -16px color-mix(in srgb, var(--brand) 28%, transparent);
    border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.svc-step__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 1.125rem;
    margin-bottom: 12px;
}
.svc-step h3 { color: var(--ink); }
.svc-step p  { color: var(--muted); margin-top: 8px; }
.svc-step--brand .svc-step__n { background: var(--brand-100); color: var(--brand); }
.svc-step--amber .svc-step__n { background: color-mix(in srgb, var(--accent) 16%, #fff); color: #b45309; }
.svc-step--green .svc-step__n { background: color-mix(in srgb, var(--green) 16%, #fff); color: #047857; }

/* ============================ CTA BAND ============================ */
.svc-cta { padding-block: 56px; }
.svc-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, var(--brand), var(--brand-500));
    border-radius: 24px;
    padding: 40px;
    color: #fff;
}
.svc-cta__copy h2 { color: #fff; line-height: 1.4; }
.svc-cta__copy p  { color: color-mix(in srgb, #fff 82%, transparent); margin-top: 8px; }
.svc-cta .svc-btn--primary {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 10px 24px -12px rgba(0,0,0,.35);
}
.svc-cta .svc-btn--primary:hover { background: #fff; color: var(--brand-500); }

/* ============================ MOTION SAFETY ============================ */
@media (prefers-reduced-motion: reduce) {
    .rise { animation: none; opacity: 1; }
    .svc-btn, .svc-step { transition: none; }
    .svc-btn--primary:hover, .svc-step:hover { transform: none; }
}

/* ============================ DARK MODE ============================ */
.dark .svc-hero { background: #0f172a; }
.dark .svc-hero__title { color: #fff; }
.dark .svc-hero__lead  { color: #94a3b8; }
.dark .svc-eyebrow { background: #1f2937; color: #cfe0ff; }
.dark .svc-trust__inner { background: #0f172a; border-color: #1f2937; }
.dark .svc-trust__label { color: #cfe0ff; }
.dark .svc-trust__sub   { color: #94a3b8; }
.dark .svc-btn--ghost { background: #0f172a; color: #cfe0ff; border-color: #374151; }
.dark .tp-service-body { color: #e5e7eb; }
.dark .svc-flow { background: #020617; }
.dark .svc-flow__h { color: #fff; }
.dark .svc-step { background: #0f172a; border-color: #1f2937; }
.dark .svc-step h3 { color: #fff; }
.dark .svc-step p  { color: #94a3b8; }
