/* پیشنهادات ویژه — کارت‌های فشرده */

.home-ad-section {
    --ad-accent: #7c3aed;
    --ad-border: #eeeaf5;
    direction: rtl;
    margin: 28px 0;
    padding: 0 12px;
}

.home-ad-section,
.home-ad-section * {
    box-sizing: border-box;
}

.home-ad-section a,
.home-ad-section a:hover,
.home-ad-section a:focus {
    text-decoration: none !important;
}

.home-ad-container {
    max-width: 1440px;
    margin-inline: auto;
}

/* سربرگ */

.home-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 15px 20px;
    border: 1px solid #e9e0fa;
    border-radius: 18px;
    background: linear-gradient(110deg, #f9f6ff, #f0e9fc);
}

.home-ad-label {
    display: block;
    margin-bottom: 3px;
    color: var(--ad-accent);
    font-size: 10px;
    font-weight: 700;
}

.home-ad-title {
    margin: 0;
    color: #35244e;
    font-size: clamp(17px, 2vw, 22px);
    font-weight: 800;
    line-height: 1.6;
}

.home-ad-header-image {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    padding: 5px;
    border-radius: 13px;
    background: #ffffffb3;
}

.home-ad-header-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* شبکه و کارت */

.home-ad-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.home-ad-grid:last-child {
    margin-bottom: 0;
}

.home-ad-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ad-border);
    border-radius: 17px;
    background: #fff;
    color: #352c43;
    box-shadow: 0 4px 15px rgb(40 25 65 / 3%);
    transition: transform .2s ease, box-shadow .2s ease;
}

/* عکس کامل، در کادر کوتاه‌تر */

.home-ad-image-wrapper {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: clamp(140px, 13vw, 180px);
    padding: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #fcfbff, #f0ebf9);
}

.home-ad-card:nth-child(3n + 2) .home-ad-image-wrapper {
    background: linear-gradient(145deg, #fcfefe, #eaf5f3);
}

.home-ad-card:nth-child(3n + 3) .home-ad-image-wrapper {
    background: linear-gradient(145deg, #fffdfa, #faf0e4);
}

.home-ad-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    filter: drop-shadow(0 6px 5px rgb(35 25 60 / 10%));
    transition: transform .25s ease;
}

.home-ad-no-image {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #b1a5c4;
    font-size: 38px;
}

/* فقط عنوان کوتاه و قیمت */

.home-ad-card .home-ad-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 11px 12px 13px;
}

.home-ad-product-title {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #665e72;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.8;
}

.home-ad-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px;
    min-height: 46px;
    margin-top: auto;
    font-variant-numeric: tabular-nums;
}

.home-ad-old-price {
    color: #aaa2b4;
    font-size: 10px;
    line-height: 1.5;
    text-decoration: line-through;
}

.home-ad-current-price {
    color: #30223f;
    font-size: clamp(15px, 1.4vw, 19px);
    font-weight: 850;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.home-ad-current-price small {
    margin-inline-start: 3px;
    color: #93879f;
    font-size: 10px;
    font-weight: 400;
}

/* تخفیف؛ حذف جزئیات اضافه */

.home-ad-card .home-ad-discount {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 3px 8px;
    border-radius: 8px;
    background: #ed4668;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    box-shadow: 0 3px 8px rgb(237 70 104 / 15%);
}

.home-ad-card .home-ad-featured,
.home-ad-card .home-ad-bottom {
    display: none;
}

.home-ad-card:focus-visible {
    outline: 3px solid var(--ad-accent);
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .home-ad-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 9px 22px rgb(51 28 82 / 9%);
    }

    .home-ad-card:hover .home-ad-image {
        transform: scale(1.04);
    }
}

/* تبلت */

@media (max-width: 1100px) {
    .home-ad-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .home-ad-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* موبایل */

@media (max-width: 560px) {
    .home-ad-section {
        margin: 22px 0;
        padding: 0 8px;
    }

    .home-ad-header {
        gap: 10px;
        padding: 12px 14px;
        border-radius: 15px;
    }

    .home-ad-header-image {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .home-ad-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-ad-card {
        border-radius: 14px;
    }

    .home-ad-image-wrapper {
        height: 145px;
        padding: 14px;
    }

    .home-ad-card .home-ad-content {
        gap: 6px;
        padding: 9px 10px 11px;
    }

    .home-ad-product-title {
        font-size: 11px;
    }

    .home-ad-current-price {
        font-size: 16px;
    }

    .home-ad-card .home-ad-discount {
        top: 7px;
        right: 7px;
        min-height: 23px;
        padding: 3px 6px;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-ad-card,
    .home-ad-image {
        transition: none;
    }
}
