/* =========================================
   Product Card - Desktop / Tablet
   ========================================= */

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    padding: 12px;
    overflow: hidden;
    color: #172033;
    background: #fff;
    border: 1px solid #e7edf4;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}

.product-card:hover {
    z-index: 1;
    border-color: #bfd7ff;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.12);
    transform: translateY(-4px);
}

.product-card:active {
    transform: scale(0.985);
}

.product-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

/* تصویر */
.pc-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    margin-bottom: 11px;
    overflow: hidden;
    background: linear-gradient(145deg, #fbfdff, #f1f5f9);
    border: 1px solid #edf1f6;
    border-radius: 14px;
}

.pc-image img {
    display: block;
    width: 86%;
    height: 86%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .pc-image img {
    transform: scale(1.05);
}

/* عنوان محصول */
.pc-title {
    display: -webkit-box;
    min-height: 46px;
    margin: 0 2px 10px;
    overflow: hidden;
    color: #172033;
    font-size: 0.87rem;
    font-weight: 700;
    line-height: 1.75;
    text-align: right;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* بخش قیمت */
.pc-price-box {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed #e5eaf1;
}

.pc-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
}

.pc-price {
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 800;
    white-space: nowrap;
}

.pc-old {
    max-width: 62%;
    overflow: hidden;
    color: #94a3b8;
    font-size: 0.75rem;
    text-align: left;
    text-decoration: line-through;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-discount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 24px;
    padding: 2px 8px;
    color: #fff;
    background: linear-gradient(135deg, #fb4b61, #e11d48);
    border-radius: 999px;
    box-shadow: 0 4px 9px rgba(225, 29, 72, 0.2);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

/* ناموجود */
.pc-unavailable {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: #e11d48;
    font-size: 0.82rem;
    font-weight: 800;
}

.pc-unavailable::before {
    width: 7px;
    height: 7px;
    margin-left: 7px;
    background: #e11d48;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #fff1f2;
    content: "";
}

/* اطلاعات جانبی */
.pc-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 25px;
    margin-top: 10px;
}

.pc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 24px;
    padding: 3px 9px;
    overflow: hidden;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e7edf4;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-type {
    flex: 0 0 auto;
    padding: 3px 9px;
    font-size: 1rem;
}

.pc-multiplier {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 800;
}

.pc-call-for-price {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 800;
}

.pc-call-for-price::before {
    width: 7px;
    height: 7px;
    margin-left: 7px;
    background: #2563eb;
    border-radius: 50%;
    content: "";
}

/* =========================================
   Mobile
   هر کارت یک ردیف تمام‌عرض است.
   تصویر در سمت راست و اطلاعات در سمت چپ.
   ========================================= */

@media (max-width: 768px) {
    .shop-products {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 11px !important;
        width: 100% !important;
    }

    .shop-products .product-card {
        display: grid !important;
        grid-template-columns: 102px minmax(0, 1fr) !important;
        grid-template-rows: auto 1fr auto !important;
        column-gap: 12px !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 122px !important;
        aspect-ratio: auto !important;

        padding: 10px !important;
        border-radius: 16px;
    }

    .shop-products .product-card:hover {
        border-color: #e7edf4;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
        transform: none;
    }

    /* تصویر سمت راست */
    .shop-products .product-card .pc-image {
        grid-row: 1 / 4;
        grid-column: 1;

        width: 102px;
        height: 102px;
        min-width: 102px;
        margin: 0;
        border-radius: 12px;
    }

    .shop-products .product-card .pc-image img {
        width: 88%;
        height: 88%;
    }

    /* عنوان سمت چپ تصویر */
    .shop-products .product-card .pc-title {
        grid-row: 1;
        grid-column: 2;

        min-width: 0;
        min-height: 0;
        height: auto;
        margin: 0 0 6px;

        font-size: 0.85rem;
        line-height: 1.7;
    }

    /* اطلاعات میانی */
    .shop-products .product-card .pc-meta-row {
        grid-row: 2;
        grid-column: 2;

        justify-content: flex-start;
        min-width: 0;
        margin: 0;
        gap: 6px;
    }

    .shop-products .product-card .pc-badge {
        min-height: 22px;
        padding: 2px 7px;
        font-size: 0.67rem;
    }

    /* قیمت */
    .shop-products .product-card .pc-price-box {
        grid-row: 3;
        grid-column: 2;

        min-width: 0;
        margin: 7px 0 0;
        padding-top: 7px;
    }

    .shop-products .product-card .pc-price-row {
        justify-content: flex-start;
        gap: 8px;
    }

    .shop-products .product-card .pc-price {
        font-size: 0.9rem;
    }

    .shop-products .product-card .pc-old {
        max-width: 50%;
        font-size: 0.7rem;
    }

    .shop-products .product-card .pc-discount {
        min-width: 34px;
        min-height: 22px;
        padding: 2px 7px;
        font-size: 0.65rem;
    }

    /* حالت ناموجود یا استعلام قیمت */
    .shop-products .product-card .pc-unavailable,
    .shop-products .product-card .pc-call-for-price {
        grid-row: 3;
        grid-column: 2;
        margin-top: 8px;
    }
}

/* گوشی‌های کوچک */
@media (max-width: 380px) {
    .shop-products .product-card {
        grid-template-columns: 84px minmax(0, 1fr) !important;
        column-gap: 9px !important;
        min-height: 104px !important;
        padding: 8px !important;
    }

    .shop-products .product-card .pc-image {
        width: 84px;
        height: 84px;
        min-width: 84px;
    }

    .shop-products .product-card .pc-title {
        font-size: 0.77rem;
    }

    .shop-products .product-card .pc-price {
        font-size: 0.8rem;
    }

    .shop-products .product-card .pc-old {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card,
    .pc-image img {
        transition: none;
    }
}
