/**
 * ابزارتمام — Product Card Styles
 *
 * @package abzartamam
 */

/* ============================================================
   PRODUCT CARD
   ============================================================ */

.abzr-product-card {
    background-color: #fff;
    border: 1.5px solid #e8ecf0;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.abzr-product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .09);
    transform: translateY(-3px);
    border-color: var(--abzr-primary);
}

/* ناموجود — کم‌رنگ‌تر */
.abzr-product-card--out-of-stock {
    opacity: .7;
}

/* ---- IMAGE WRAP ---- */
.abzr-product-card__image-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: #f7f8fa;
}

.abzr-product-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .75rem;
    transition: transform .35s ease;
}

.abzr-product-card:hover .abzr-product-card__img {
    transform: scale(1.06);
}

/* ---- BADGE (تخفیف / جدید / ویژه) ---- */
.abzr-product-card__badge {
    position: absolute;
    inset-block-start: .6rem;
    inset-inline-start: .6rem;
    z-index: 2;
    border-radius: .4rem;
    font-size: .7rem;
    font-weight: 700;
    padding: .2em .55em;
    line-height: 1.4;
}

.abzr-badge--discount { background-color: #E53E3E; color: #fff; }
.abzr-badge--new      { background-color: #38A169; color: #fff; }
.abzr-badge--special  { background-color: var(--abzr-primary); color: #fff; }
.abzr-badge--available    { background-color: #C6F6D5; color: #276749; }
.abzr-badge--last-units   { background-color: #FEEBC8; color: #975A16; }
.abzr-badge--out-of-stock { background-color: #FED7D7; color: #9B2C2C; }

/* ---- WISHLIST BUTTON ---- */
.abzr-product-card__wishlist {
    position: absolute;
    inset-block-start: .6rem;
    inset-inline-end: .6rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #e8ecf0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    padding: 0;
    opacity: 0;
    transition: opacity .18s, color .18s, border-color .18s, transform .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.abzr-product-card:hover .abzr-product-card__wishlist {
    opacity: 1;
}

.abzr-product-card__wishlist:hover,
.abzr-product-card__wishlist--active {
    color: #E53E3E;
    border-color: #E53E3E;
    opacity: 1;
}

.abzr-product-card__wishlist--active svg { fill: #E53E3E; }
.abzr-product-card__wishlist:active { transform: scale(.88); }

/* ---- UNAVAILABLE OVERLAY ---- */
.abzr-product-card__unavailable-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.abzr-product-card__unavailable-overlay span {
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: .3em .9em;
    border-radius: 2rem;
}

/* ---- BODY ---- */
.abzr-product-card__body {
    padding: .875rem .875rem .5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: .4rem;
}

/* نام محصول */
.abzr-product-card__title {
    font-size: .85rem;
    font-weight: 600;
    color: #2D3748;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.abzr-product-card__title-link {
    text-decoration: none;
    color: inherit;
    transition: color .15s;
}

.abzr-product-card__title-link:hover { color: var(--abzr-primary); }

/* رتبه‌بندی */
.abzr-product-card__rating {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.abzr-rating__stars {
    display: flex;
    gap: .1rem;
    color: #F6AD55;
}

.abzr-rating__count {
    font-size: .7rem;
    color: #a0aec0;
}

/* badge موجودی */
.abzr-product-card__stock { margin-block: .1rem; }

/* قیمت */
.abzr-product-card__price {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin-block-start: auto;
    padding-block-start: .3rem;
}

.abzr-price__original {
    font-size: .72rem;
    color: #a0aec0;
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

.abzr-price__final {
    font-size: 1rem;
    font-weight: 700;
    color: var(--abzr-primary);
    font-variant-numeric: tabular-nums;
}

.abzr-price__final--na {
    font-size: .8rem;
    color: #718096;
}

/* قیمت WooCommerce native */
.abzr-product-card__price del .amount,
.abzr-product-card__price del {
    font-size: .72rem;
    color: #a0aec0;
    text-decoration: line-through;
}

.abzr-product-card__price ins,
.abzr-product-card__price ins .amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--abzr-primary);
    text-decoration: none;
}

/* ---- FOOTER ---- */
.abzr-product-card__footer {
    padding: .5rem .875rem .875rem;
}

/* دکمه افزودن به سبد */
.abzr-btn--primary.abzr-btn--full,
.abzr-add-to-cart.abzr-btn--full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    background-color: var(--abzr-primary);
    color: #fff;
    border: none;
    border-radius: .6rem;
    padding: .6rem 1rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .18s, transform .15s;
    font-family: inherit;
}

.abzr-btn--primary.abzr-btn--full:hover,
.abzr-add-to-cart.abzr-btn--full:hover {
    background-color: var(--abzr-primary-dark, #c9520a);
    transform: translateY(-1px);
}

/* دکمه اطلاع‌رسانی */
.abzr-btn--ghost.abzr-btn--full,
.abzr-notify-btn.abzr-btn--full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    background-color: transparent;
    color: #718096;
    border: 1.5px solid #e8ecf0;
    border-radius: .6rem;
    padding: .58rem 1rem;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s, color .18s;
    font-family: inherit;
}

.abzr-btn--ghost.abzr-btn--full:hover,
.abzr-notify-btn.abzr-btn--full:hover {
    border-color: var(--abzr-primary);
    color: var(--abzr-primary);
}

/* ============================================================
   PRODUCTS GRID (آرشیو)
   ============================================================ */

.abzr-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}

/* ============================================================
   PRODUCTS ROW (صفحه اصلی — ردیف افقی)
   ============================================================ */

.abzr-products-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .abzr-products-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .abzr-products-grid,
    .abzr-products-row {
        grid-template-columns: repeat(2, 1fr);
        gap: .75rem;
    }
}

@media (max-width: 360px) {
    .abzr-products-grid,
    .abzr-products-row {
        grid-template-columns: 1fr;
    }
}
