/* ==========================================================
   Pelak Azad — Single Car Related Ads
========================================================== */

.pa-single-related-ads {
    width: 100%;
    min-width: 0;

    direction: rtl;
    font-family: "VazirMatn", "Vazir", Tahoma, Arial, sans-serif;
}

.pa-single-related-ads__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 18px;
}

.pa-single-related-ads__head h2 {
    margin: 0 0 4px;

    color: #111827;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.5;
}

.pa-single-related-ads__head p {
    margin: 0;

    color: #8a919b;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.8;
}

.pa-single-related-ads__head > a {
    flex: 0 0 auto;

    color: #ed1c24;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.pa-single-related-ads__head > a:hover {
    color: #c9141b;
}

.pa-single-related-ads__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.pa-related-card {
    min-width: 0;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 16px;

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease;
}

.pa-related-card:hover {
    transform: translateY(-4px);
    border-color: rgba(237, 28, 36, .14);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.pa-related-card__image-link {
    position: relative;

    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;

    overflow: hidden;
    background: #f4f6f8;
}

.pa-related-card__image,
.pa-related-card__image-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.pa-related-card__image {
    object-fit: cover;
    transition: transform .3s ease;
}

.pa-related-card:hover .pa-related-card__image {
    transform: scale(1.025);
}

.pa-related-card__image-placeholder {
    background: linear-gradient(135deg, #f8fafc, #eef2f6);
}

.pa-related-card__photo-count {
    position: absolute;
    left: 10px;
    bottom: 10px;
}

.pa-related-card__photo-count .pa-photo-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 28px;
    padding: 0 9px;

    background: rgba(17, 24, 39, .76);
    border-radius: 999px;
    backdrop-filter: blur(6px);

    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
}

.pa-related-card__body {
    padding: 13px 14px 14px;
}

.pa-related-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;

    min-height: 18px;
    margin-bottom: 5px;

    color: #969da7;
    font-size: 10px;
    line-height: 1.6;
}

.pa-related-card__meta i {
    display: block;
    width: 3px;
    height: 3px;

    background: #c8cdd4;
    border-radius: 50%;
}

.pa-related-card__title {
    margin: 0 0 10px;

    font-size: 14px;
    font-weight: 800;
    line-height: 1.75;
}

.pa-related-card__title a {
    display: -webkit-box;
    overflow: hidden;

    color: #1f2937;
    text-decoration: none;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pa-related-card__title a:hover {
    color: #ed1c24;
}

.pa-related-card__price {
    min-height: 54px;
    margin-bottom: 10px;
}

.pa-related-card__price .pa-card-price-wrap {
    margin: 0 !important;
    padding: 0 !important;
    text-align: right !important;
}

.pa-related-card__price .pa-card-main-price {
    margin: 0 !important;

    color: #ed1c24 !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1.6 !important;
}

.pa-related-card__price .pa-card-sub-price {
    margin-top: 1px !important;

    color: #9ca3af !important;
    font-size: 9.5px !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
}

.pa-related-card__specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;

    padding-top: 10px;
    border-top: 1px solid #eef1f4;
}

.pa-related-card__specs span {
    overflow: hidden;

    color: #6b7280;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.55;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 1024px) {
    .pa-single-related-ads__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .pa-single-related-ads__head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 10px;

        margin-bottom: 10px;
        padding: 0 16px;
    }

    .pa-single-related-ads__head > div {
        min-width: 0;
    }

    body .pa-single-related-ads .pa-single-related-ads__head h2 {
        margin: 0 !important;
        font-size: 19px !important;
        line-height: 1.5 !important;
    }

    .pa-single-related-ads__head p {
        display: none;
    }

    .pa-single-related-ads__head > a {
        justify-self: start;
        align-self: center;
        font-size: 12px;
        white-space: nowrap;
    }

    .pa-single-related-ads__grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;

        overflow-x: auto;
        overflow-y: hidden;

        padding: 4px 0 16px 16px;
        margin: 0;

        scroll-snap-type: x mandatory;
        scroll-padding-right: 0;
        scroll-padding-left: 16px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .pa-single-related-ads__grid::after {
        content: "";
        flex: 0 0 16px;
    }

    .pa-single-related-ads__grid::-webkit-scrollbar {
        display: none;
    }

    .pa-related-card {
        width: min(calc(100vw - 96px), 292px);
        min-width: min(calc(100vw - 96px), 292px);
        flex: 0 0 min(calc(100vw - 96px), 292px);

        border-radius: 14px;
        scroll-snap-align: start;
        transform: none !important;
    }

    .pa-related-card:hover {
        transform: none !important;
        box-shadow: none;
    }

    .pa-related-card__body {
        padding: 12px 12px 13px;
    }

    .pa-related-card__meta {
        font-size: 11px;
        line-height: 1.65;
    }

    .pa-related-card__title {
        font-size: 14px;
        line-height: 1.75;
    }

    .pa-related-card__price .pa-card-main-price {
        font-size: 16px !important;
    }

    .pa-related-card__price .pa-card-sub-price {
        font-size: 10.5px !important;
        line-height: 1.65 !important;
    }

    .pa-related-card__specs span {
        font-size: 10.5px;
        line-height: 1.6;
    }

    .pa-related-card__photo-count .pa-photo-count-badge {
        font-size: 10.5px;
    }
}

/* ==========================================================
   v1.1.72.375 — Related ads typography readability pass
========================================================== */
.pa-single-related-ads__head p {
    color: #667085;
    font-size: 13px;
    line-height: 1.85;
}

.pa-single-related-ads__head > a {
    font-size: 13px;
}

.pa-related-card__photo-count {
    font-size: 11px;
}

.pa-related-card__meta {
    color: #667085;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.7;
}

.pa-related-card__title,
.pa-related-card__title > a {
    font-size: 15.5px;
    line-height: 1.75;
}

.pa-related-card__price .pa-card-sub-price {
    color: #7c8797 !important;
    font-size: 11.5px !important;
    line-height: 1.7 !important;
}

.pa-related-card__specs span {
    color: #596579;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.65;
}

@media (max-width: 767px) {
    .pa-related-card__meta {
        font-size: 12px;
    }

    body .pa-single-related-ads .pa-related-card h3.pa-related-card__title,
    body .pa-single-related-ads .pa-related-card h3.pa-related-card__title > a {
        font-size: 16px !important;
    }

    .pa-related-card__price .pa-card-sub-price,
    .pa-related-card__specs span {
        font-size: 11.5px !important;
    }
}

/* ==========================================================
   Pelak Azad — Related Ads final refinements
========================================================== */

.pa-single-related-ads__head {
    align-items: center;
}

.pa-single-related-ads__head > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;
    padding: 0 11px;

    background: rgba(237, 28, 36, .055);
    border: 1px solid rgba(237, 28, 36, .10);
    border-radius: 9px;

    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease;
}

.pa-single-related-ads__head > a:hover {
    background: rgba(237, 28, 36, .09);
    border-color: rgba(237, 28, 36, .16);
}

.pa-related-card__image--fallback {
    object-fit: cover;
    object-position: center;
    background: #f6f7f9;
}

@media (max-width: 767px) {
    .pa-single-related-ads__head > a {
        min-height: 30px;
        padding: 0 9px;
        border-radius: 8px;
    }
}

/* ==========================================================
   v1.1.72.64 — Mobile related-card title specificity fix
   Forces each related ad card title (h3/link) to 16px
   against global heading CSS.
========================================================== */
@media (max-width: 767px) {
    body .pa-single-related-ads .pa-related-card h3.pa-related-card__title,
    body .pa-single-related-ads .pa-related-card h3.pa-related-card__title > a {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }
}
