/**
 * تقييمات الموبايل — شكل احترافي، تفاصيل واضحة، متوافق W3C
 */

.mtp-reviews-tab,
.mtp-reviews-standalone {
    direction: rtl;
    padding: 0;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mtp-reviews-tab {
    padding: 1.25rem;
}

.mtp-reviews-standalone {
    padding: 1.5rem;
}

.mtp-reviews-heading {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    line-height: 1.3;
}

.mtp-reviews-intro {
    margin: 0 0 1.75rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #475569;
    text-align: center;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ——— نموذج التقييم ——— */
.mtp-reviews-form-section {
    margin-bottom: 2.5rem;
}

.mtp-reviews-form-heading {
    margin: 0 0 1.25rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
}

.mtp-reviews-form {
    max-width: 580px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.mtp-review-field {
    margin-bottom: 1.25rem;
}

.mtp-review-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

.mtp-review-field .required {
    color: #dc2626;
}

.mtp-review-field input[type="text"],
.mtp-review-field textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    box-sizing: border-box;
}

.mtp-review-field input:focus,
.mtp-review-field textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
    background: #fff;
}

.mtp-review-field textarea {
    resize: vertical;
    min-height: 120px;
}

.mtp-review-content-hint {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

/* حقل التقييمات 1–10 */
.mtp-review-ratings-fieldset {
    margin: 1.5rem 0 1.25rem;
    padding: 1.25rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.mtp-review-ratings-legend {
    padding: 0 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

.mtp-review-ratings-intro {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.mtp-review-ratings {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mtp-rating-row {
    display: grid;
    grid-template-columns: 100px 1fr 36px;
    align-items: center;
    gap: 0.75rem;
}

.mtp-rating-row label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
}

.mtp-rating-label-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.mtp-rating-label-inner .mtp-review-icon {
    flex-shrink: 0;
    color: #2563eb;
}

.mtp-review-icon {
    display: inline-block;
    vertical-align: middle;
}

.mtp-rating-slider {
    width: 100%;
    height: 10px;
    accent-color: #2563eb;
    cursor: pointer;
}

.mtp-rating-value {
    font-weight: 700;
    font-size: 1rem;
    color: #1e40af;
    text-align: left;
    min-width: 28px;
}

/* متوسط التقييم */
.mtp-review-average-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    margin: 1.25rem 0 1rem;
    padding: 1rem 1.25rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    font-size: 1rem;
}

.mtp-review-average-label {
    font-weight: 600;
    color: #1e40af;
}

.mtp-review-average-value {
    font-weight: 800;
    font-size: 1.5rem;
    color: #1e40af;
}

.mtp-review-average-max {
    color: #3b82f6;
    font-weight: 600;
}

.mtp-review-submit-wrap {
    margin-top: 1.25rem;
}

.mtp-review-submit {
    display: inline-block;
    padding: 0.7rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    border-radius: 10px;
    cursor: pointer;
}

.mtp-review-submit:hover {
    background: #1d4ed8;
}

.mtp-review-submit:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.mtp-review-message {
    margin-top: 0.85rem;
    font-size: 0.95rem;
}

.mtp-review-message.success {
    color: #059669;
    font-weight: 600;
}

.mtp-review-message.error {
    color: #dc2626;
}

/* ——— تقييمات الموقع (مربع مميز) ——— */
.mtp-site-reviews-box {
    margin-bottom: 2.5rem;
    padding: 1.5rem 1.25rem;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    color: #e2e8f0;
    direction: rtl;
}

.mtp-site-reviews-title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.mtp-site-reviews-desc {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    color: #94a3b8;
}

.mtp-site-reviews-summary {
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid #3b82f6;
    border-radius: 10px;
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
}

.mtp-site-reviews-avg {
    font-size: 1.5rem;
    font-weight: 800;
    color: #60a5fa;
}

.mtp-site-reviews-max {
    color: #93c5fd;
    font-weight: 600;
}

.mtp-site-reviews-count {
    font-size: 0.9rem;
    color: #94a3b8;
}

.mtp-site-reviews-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mtp-site-reviews-list .mtp-review-item {
    background: #1e293b;
    border-color: #334155;
}

.mtp-site-reviews-list .mtp-review-item-author,
.mtp-site-reviews-list .mtp-review-item-content {
    color: #e2e8f0;
}

.mtp-site-reviews-list .mtp-review-item-date {
    color: #94a3b8;
}

.mtp-site-reviews-list .mtp-review-item-rating {
    color: #60a5fa;
}

.mtp-site-reviews-list .mtp-review-detail dt {
    color: #94a3b8;
}

.mtp-site-reviews-list .mtp-review-detail-value {
    background: rgba(37, 99, 235, 0.25);
    border-color: #3b82f6;
    color: #93c5fd;
}

.mtp-site-reviews-list .mtp-review-item-avatar {
    background: #3b82f6;
}

/* ——— معلومات العرض ——— تصميم بسيط واحترافي */
.mtp-offer-details-box {
    margin-top: 2rem;
    padding: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    direction: rtl;
    overflow: hidden;
}

.mtp-offer-details-title {
    margin: 0;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    z-index: 1;
}

.mtp-offer-details-inner {
    padding: 0.5rem 0;
}

.mtp-offer-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.mtp-offer-detail-row:last-child {
    border-bottom: none;
}

.mtp-offer-detail-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #6b7280;
}

.mtp-offer-icon {
    flex-shrink: 0;
    color: #9ca3af;
}

.mtp-offer-detail-value {
    font-size: 0.9375rem;
    color: #111827;
}

.mtp-offer-detail-value.mtp-offer-detail-text {
    line-height: 1.5;
    color: #374151;
    text-align: left;
}

/* ——— زر «عرض التقيمات» أسفل المقال ——— */
.mtp-goto-reviews-wrap {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.mtp-goto-reviews-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: 1px solid #4f46e5;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    direction: rtl;
}

.mtp-goto-reviews-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border-color: #4338ca;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.mtp-goto-reviews-btn:focus {
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}

.mtp-goto-reviews-icon {
    flex-shrink: 0;
}

.mtp-goto-reviews-icon svg {
    display: block;
}

.mtp-offer-badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 6px;
}

.mtp-offer-instock {
    background: #ecfdf5;
    color: #047857;
}

.mtp-offer-outofstock {
    background: #fef2f2;
    color: #b91c1c;
}

.mtp-offer-preorder {
    background: #eff6ff;
    color: #1d4ed8;
}

.mtp-offer-return-yes {
    background: #f0fdf4;
    color: #15803d;
}

.mtp-offer-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
}

.mtp-offer-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.mtp-offer-link:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.mtp-offer-discontinued {
    background: #f3f4f6;
    color: #4b5563;
}

/* ——— تقييمات الزوار (مربع مميز + لمسة بصرية) ——— */
.mtp-reviews-list {
    margin-top: 2.5rem;
    padding: 1.5rem 1.25rem;
    background: linear-gradient(160deg, #f0fdf4 0%, #ecfdf5 35%, #f0f9ff 100%);
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    direction: rtl;
}

.mtp-reviews-list-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #86efac;
    font-size: 1.2rem;
    font-weight: 700;
    color: #14532d;
}

.mtp-reviews-list-count {
    color: #166534;
}

.mtp-reviews-list-avg {
    color: #059669;
}

.mtp-reviews-list-avg abbr {
    text-decoration: none;
    font-weight: 600;
}

.mtp-reviews-list-inner {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* قاعدة مشتركة لبطاقة التقييم */
.mtp-review-item {
    padding: 1.35rem 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.mtp-review-item-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.mtp-review-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mtp-review-item-avatar span {
    line-height: 1;
}

.mtp-review-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    flex: 1;
    min-width: 0;
}

.mtp-review-item-author {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
}

.mtp-review-item-date {
    font-size: 0.875rem;
    color: #64748b;
}

.mtp-review-item-rating {
    font-size: 1rem;
    font-weight: 700;
    color: #2563eb;
}

.mtp-review-item-rating abbr {
    text-decoration: none;
    font-weight: 600;
}

.mtp-review-item-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 1rem;
}

.mtp-review-item-content p {
    margin: 0 0 0.5em;
}

.mtp-review-item-content p:last-child {
    margin-bottom: 0;
}

/* بطاقة تقييم واحدة — تقييمات الزوار */
.mtp-reviews-list .mtp-review-item {
    border-color: #bbf7d0;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.08);
}

.mtp-reviews-list .mtp-review-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mtp-reviews-list .mtp-review-item-author {
    font-weight: 700;
    font-size: 1.05rem;
    color: #14532d;
}

.mtp-reviews-list .mtp-review-item-date {
    font-size: 0.875rem;
    color: #15803d;
}

.mtp-reviews-list .mtp-review-item-rating {
    font-size: 1rem;
    font-weight: 700;
    color: #059669;
}

.mtp-reviews-list .mtp-review-item-rating abbr {
    text-decoration: none;
    font-weight: 600;
}

.mtp-reviews-list .mtp-review-item-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 1rem;
}

.mtp-reviews-list .mtp-review-item-content p {
    margin: 0 0 0.5em;
}

/* تفاصيل التقييم (التصميم، الشاشة، …) */
.mtp-review-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem 1rem;
    margin: 0;
    padding: 1rem 0 0;
    border-top: 1px solid #f1f5f9;
}

.mtp-reviews-list .mtp-review-item-details {
    border-top-color: #dcfce7;
}

.mtp-review-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.mtp-review-detail dt {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mtp-review-detail dt .mtp-review-icon {
    flex-shrink: 0;
    color: #2563eb;
}

.mtp-reviews-list .mtp-review-detail dt .mtp-review-icon {
    color: #059669;
}

.mtp-review-detail dd {
    margin: 0;
    font-size: 0.9rem;
}

.mtp-review-detail-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.2rem 0.5rem;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.mtp-reviews-list .mtp-review-detail-value {
    color: #065f46;
    background: #d1fae5;
    border-color: #6ee7b7;
}

/* ——— responsive ——— */
@media (max-width: 640px) {
    .mtp-reviews-form {
        padding: 1.25rem 1rem;
    }

    .mtp-rating-row {
        grid-template-columns: 80px 1fr 32px;
        gap: 0.5rem;
    }

    .mtp-rating-row label {
        font-size: 0.9rem;
    }

    .mtp-review-item-details {
        grid-template-columns: 1fr 1fr;
    }

    .mtp-offer-details-title {
        padding: 0.85rem 1rem;
        font-size: 1.1rem;
    }

    .mtp-offer-details-inner {
        padding: 1rem;
    }

    .mtp-offer-detail-card {
        padding: 0.85rem 1rem;
    }

    .mtp-offer-detail-value {
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .mtp-review-item-details {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ——— الوضع الليلي ——— */
[data-theme="dark"] .mtp-reviews-tab,
[data-theme="dark"] .mtp-reviews-standalone {
    background: var(--mtp-card-bg);
    border-color: var(--mtp-card-border);
}

[data-theme="dark"] .mtp-reviews-form {
    background: var(--mtp-card-bg);
    border-color: var(--mtp-card-border);
}

[data-theme="dark"] .mtp-reviews-form-title {
    color: var(--mtp-heading);
}

[data-theme="dark"] .mtp-rating-row label {
    color: var(--text-color);
}

[data-theme="dark"] .mtp-rating-stars {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .mtp-reviews-form-input,
[data-theme="dark"] .mtp-reviews-form-textarea {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .mtp-reviews-form-input:focus,
[data-theme="dark"] .mtp-reviews-form-textarea:focus {
    background: var(--bg-color);
    border-color: var(--mtp-accent);
}

[data-theme="dark"] .mtp-reviews-form-submit {
    background: var(--mtp-accent);
    color: #fff;
}

[data-theme="dark"] .mtp-reviews-form-submit:hover {
    background: #3b82f6;
}

[data-theme="dark"] .mtp-reviews-list {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .mtp-reviews-list-title {
    color: var(--mtp-heading);
    border-color: var(--border-color);
}

[data-theme="dark"] .mtp-review-item {
    background: var(--mtp-card-bg);
    border-color: var(--mtp-card-border);
}

[data-theme="dark"] .mtp-review-item-author {
    color: var(--text-color);
}

[data-theme="dark"] .mtp-review-item-date {
    color: var(--text-light);
}

[data-theme="dark"] .mtp-review-item-content {
    color: var(--text-color);
}

[data-theme="dark"] .mtp-offer-details-box {
    background: var(--mtp-card-bg);
    border-color: var(--mtp-card-border);
}

[data-theme="dark"] .mtp-offer-details-title {
    color: var(--mtp-heading) !important;
    background: var(--bg-light) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .mtp-offer-details-inner {
    background: var(--mtp-card-bg);
}

[data-theme="dark"] .mtp-offer-detail-value {
    color: var(--text-color);
}

[data-theme="dark"] .mtp-offer-icon {
    color: var(--text-light);
}

[data-theme="dark"] .mtp-offer-link {
    color: var(--mtp-accent);
}

[data-theme="dark"] .mtp-offer-detail-row {
    border-color: var(--border-color);
}

[data-theme="dark"] .mtp-offer-detail-label {
    color: var(--text-color);
}

[data-theme="dark"] .mtp-offer-badge {
    background: var(--bg-light);
    color: var(--text-color);
    border-color: var(--border-color);
}
