/*
 | صفحات القوائم والتفاصيل — منفذو الخدمة والطلبات.
 | يكمّل services.css بنفس النمط: شبكة مضغوطة وفلاتر تعمل.
 | يعتمد متغيرات style.css ولا يعدّلها.
 */

/* ── صور بديلة بالحرف الأول ────────────────────────────── */
.av-initial {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    line-height: 1;
    user-select: none;
}

/* ── شبكة منفذي الخدمة — 3 في الصف ─────────────────────── */
.pv-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 1400px) { .pv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .pv-grid { grid-template-columns: 1fr; } }

/* ── بطاقة منفذ خدمة ───────────────────────────────────── */
.pv-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
}

.pv-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-primary-light);
    box-shadow: 0 10px 28px rgba(4, 41, 77, 0.1);
}

.pv-card:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* الرأس: الصورة والاسم */
.pv-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
}

.pv-avatar,
.pv-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.pv-avatar { font-size: 22px; }

.pv-ident { min-width: 0; flex: 1; }

.pv-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-secondary);
    margin: 0 0 3px;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pv-role {
    display: inline-block;
    font-size: 12px;
    color: var(--brand-primary-dark);
    background: rgba(8, 148, 151, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    line-height: 1.7;
}

/* شارة التوفر */
.pv-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #16B187;
    margin-inline-start: auto;
    align-self: flex-start;
    white-space: nowrap;
}

.pv-live::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16B187;
    box-shadow: 0 0 0 3px rgba(22, 177, 135, 0.2);
}

/* الجسم */
.pv-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 16px 16px;
}

.pv-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 10px;
}

.pv-stars { color: #EAB308; font-size: 12px; letter-spacing: 1px; }
.pv-rate  { font-weight: 800; color: var(--text-primary); }
.pv-count { color: var(--text-light); font-size: 12px; }

.pv-bio {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
    margin: 0 0 12px;
    min-height: calc(2 * 1.8em);

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.pv-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pv-meta i { color: var(--brand-primary); width: 13px; text-align: center; }

.pv-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--surface-border);
}

.pv-price { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pv-price small  { font-size: 11px; color: var(--text-muted); }
.pv-price strong { font-size: 14px; font-weight: 800; color: var(--brand-primary-dark); white-space: nowrap; }

.pv-go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(8, 148, 151, 0.1);
    color: var(--brand-primary-dark);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.pv-card:hover .pv-go { background: var(--brand-primary); color: #fff; }

/* شارة مميّز */
.pv-premium {
    position: absolute;
    inset-inline-end: 12px;
    top: 12px;
    background: #EAB308;
    color: #422006;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
}

/* ═══════════ صفحة تفاصيل منفذ الخدمة ═══════════ */

.pd-hero {
    background: linear-gradient(135deg, var(--brand-secondary), #04294D);
    padding: 32px 0;
    color: #fff;
}

.pd-hero-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pd-avatar,
.pd-avatar img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    object-fit: cover;
    flex-shrink: 0;
}

.pd-avatar { font-size: 38px; }

.pd-ident { flex: 1; min-width: 220px; }

.pd-name {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.5;
}

.pd-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }

.pd-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
}

.pd-tags i { color: var(--brand-primary-light); }

.pd-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.pd-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
    transition: var(--transition-fast);
}

.pd-btn:hover { background: #0AA9AC; }

.pd-btn.ghost {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.pd-btn.ghost:hover { background: rgba(255, 255, 255, 0.2); }

/* شريط الإحصائيات */
.pd-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--surface-border);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: -24px 0 24px;
    position: relative;
    z-index: 2;
}

@media (max-width: 720px) { .pd-stats { grid-template-columns: repeat(2, 1fr); } }

.pd-stat {
    background: #fff;
    padding: 16px 12px;
    text-align: center;
}

.pd-stat b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-primary-dark);
    line-height: 1.4;
}

.pd-stat span { font-size: 12px; color: var(--text-muted); }

/* تخطيط المحتوى */
.pd-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
    padding-bottom: 56px;
}

@media (max-width: 1024px) { .pd-layout { grid-template-columns: 1fr; } }

.pd-card {
    background: #fff;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 18px;
}

.pd-card h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--brand-secondary);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pd-card h3 i { color: var(--brand-primary); font-size: 15px; }

.pd-bio { font-size: 14px; color: var(--text-secondary); line-height: 1.9; margin: 0; }

/* التبويبات */
.pd-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 18px;
    overflow-x: auto;
}

.pd-tab {
    padding: 12px 18px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pd-tab:hover { color: var(--brand-primary-dark); }

.pd-tab.active {
    color: var(--brand-primary-dark);
    border-bottom-color: var(--brand-primary);
}

.pd-panel { display: none; }
.pd-panel.active { display: block; }

/* قائمة مجالات العمل */
.pd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.pd-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
}

.pd-list i { color: var(--brand-primary); }
.pd-list .pd-list-price { margin-inline-start: auto; font-weight: 700; color: var(--brand-primary-dark); font-size: 13px; }

/* معرض الأعمال */
.pd-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 720px) { .pd-gallery { grid-template-columns: repeat(2, 1fr); } }

.pd-gallery-item {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-light);
}

.pd-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* توزيع التقييمات */
.pd-rating-summary {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    align-items: center;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--surface-border);
}

@media (max-width: 560px) { .pd-rating-summary { grid-template-columns: 1fr; } }

.pd-score { text-align: center; }
.pd-score b { display: block; font-size: 42px; font-weight: 800; color: var(--brand-secondary); line-height: 1.2; }
.pd-score .pd-score-stars { color: #EAB308; font-size: 14px; letter-spacing: 2px; }
.pd-score small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.pd-bars { display: grid; gap: 7px; }

.pd-bar-row {
    display: grid;
    grid-template-columns: 52px 1fr 28px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.pd-bar {
    height: 7px;
    border-radius: var(--radius-pill);
    background: var(--surface-light);
    overflow: hidden;
}

.pd-bar span {
    display: block;
    height: 100%;
    background: #EAB308;
    border-radius: var(--radius-pill);
}

/* ═══════════ صفحة تفاصيل الطلب ═══════════ */

.rq-hero {
    background: linear-gradient(135deg, var(--brand-secondary), #04294D);
    color: #fff;
    padding: 28px 0;
}

.rq-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 12px;
}

.rq-back:hover { color: #fff; }

.rq-title { font-size: 25px; font-weight: 800; margin: 0 0 10px; line-height: 1.6; }

.rq-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.rq-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.14);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
}

.rq-tag.urgent { background: #EA580C; }
.rq-tag.teal   { background: var(--brand-primary); }

.rq-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
    padding: 24px 0 56px;
}

@media (max-width: 1024px) { .rq-layout { grid-template-columns: 1fr; } }

/* شبكة البيانات */
.rq-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.rq-fact {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
}

.rq-fact-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.rq-fact small { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.rq-fact b { font-size: 13px; color: var(--text-primary); font-weight: 700; line-height: 1.6; }

/* المراحل */
.rq-stages { list-style: none; margin: 0; padding: 0; }

.rq-stage {
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
    position: relative;
}

.rq-stage:last-child { padding-bottom: 0; }

.rq-stage-num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    z-index: 1;
}

/* خط رابط بين المراحل */
.rq-stage:not(:last-child)::before {
    content: '';
    position: absolute;
    inset-inline-start: 14px;
    top: 30px;
    bottom: 4px;
    width: 2px;
    background: var(--surface-border);
}

.rq-stage-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    padding-top: 4px;
}

/* تنبيه */
.rq-note {
    display: flex;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    background: rgba(8, 148, 151, 0.07);
    border-inline-start: 3px solid var(--brand-primary);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 18px;
}

.rq-note i { color: var(--brand-primary); margin-top: 3px; flex-shrink: 0; }

/* الشريط الجانبي اللاصق */
.rq-side { position: sticky; top: 84px; }

@media (max-width: 1024px) { .rq-side { position: static; } }

.rq-cta {
    background: #fff;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.rq-budget { margin-bottom: 16px; }
.rq-budget small { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.rq-budget b { font-size: 20px; font-weight: 800; color: var(--brand-primary-dark); }

.rq-cta-btn {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-sm);
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    min-height: 46px;
    transition: var(--transition-fast);
}

.rq-cta-btn:hover { background: #0AA9AC; }

.rq-cta-note { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
    .pv-card, .pv-go, .pd-btn { transition: none; }
    .pv-card:hover { transform: none; }
}

/* شارة «منفذ جديد» بدل «0.0 تقييم» التي توحي بتقييم سيّئ */
.pv-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(8, 148, 151, .1);
    color: var(--brand-primary, #089497);
    font-size: 12.5px;
    font-weight: 700;
}

.pv-new i {
    font-size: 11px;
}


/* الخدمة القادمة من بطاقة الصفحة الرئيسية — تُبرز لحظة الوصول
   حتى يعرف الزائر أين وقع، فالصفحة تعرض كل خدمات المنفّذ. */
.pd-service{scroll-margin-top:96px;border-radius:10px;padding:6px;transition:background .3s;}
.pd-service.is-target{
  background:rgba(8,148,151,.10);
  box-shadow:inset 0 0 0 2px rgba(8,148,151,.45);
  animation:pdTargetPulse 2.4s ease-out 1;
}
@keyframes pdTargetPulse{
  0%{background:rgba(8,148,151,.28);}
  100%{background:rgba(8,148,151,.10);}
}
