/**
 * استایل کارت محصول - نسخه BEM
 * 
 * @package LZTheme_V2
 * @version 2.1.0
 */

/* ========================================
   کارت محصول (BEM: Block)
   ======================================== */

.product-card {
    border: 1px solid var(--catalog-border-color, #e5e5e5);
    padding: 20px;
    border-radius: var(--catalog-radius-lg, 8px);
    background: var(--catalog-bg-white, #ffffff);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
    border-color: var(--catalog-primary-color, #2271b1);
}

/* ========================================
   تصویر محصول (BEM: Element)
   ======================================== */

.product-card__image-container {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: var(--catalog-radius-md, 6px);
}

.product-card__image-link {
    display: block;
    text-decoration: none;
}

.product-card__image-container img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-card:hover .product-card__image-container img {
    transform: scale(1.08);
}

/* ========================================
   Badge وضعیت موجودی (BEM: Element)
   ======================================== */

.product-card__stock {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.product-card__stock--in-stock {
    background: #28a745;
    color: #ffffff;
}

.product-card__stock--out-of-stock {
    background: #dc3545;
    color: #ffffff;
}

.product-card__stock--backorder {
    background: #ffc107;
    color: #212529;
}

/* ========================================
   دکمه‌های سریع (Quick Actions)
   ======================================== */

.product-card__actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-card:hover .product-card__actions {
    opacity: 1;
    visibility: visible;
}

.product-card__action {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #333;
}

.product-card__action:hover {
    background: var(--catalog-primary-color, #2271b1);
    color: #ffffff;
    transform: scale(1.1);
}

.product-card__action-icon {
    width: 20px;
    height: 20px;
}

/* ========================================
   اطلاعات محصول (BEM: Element)
   ======================================== */

.product-card__info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ========================================
   متادیتا (برند و دسته)
   ======================================== */

.product-card__meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.product-card__meta-item {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.product-card__meta-item--brand {
    background: #e3f2fd;
    color: #1976d2;
}

.product-card__meta-item--category {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* ========================================
   عنوان محصول
   ======================================== */

.product-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    min-height: 45px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.product-card__title-link:hover {
    color: var(--catalog-primary-color, #2271b1);
}

/* ========================================
   SKU
   ======================================== */

.product-card__sku {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

.product-card__sku-label {
    font-weight: 500;
}

.product-card__sku-value {
    font-family: 'Courier New', monospace;
    color: #666;
}

/* ========================================
   قیمت
   ======================================== */

.product-card__price {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--catalog-secondary-color, #e4002b);
    margin: 12px 0;
}

.product-card__price del {
    font-size: 0.8em;
    color: #999;
    margin-left: 8px;
}

.product-card__price ins {
    text-decoration: none;
}

/* ========================================
   دکمه استعلام قیمت (WhatsApp CTA) ⭐
   ======================================== */

.product-card__cta {
    margin-top: auto;
    padding-top: 15px;
}

.product-card__cta-button {
    /* استایل پایه */
    background: #25D366; /* رنگ سبز واتس‌اپ */
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 5px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
}

/* افکت Hover پیشرفته */
.product-card__cta-button:hover {
    background: #128C7E; /* رنگ کمی تیره‌تر */
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* افکت Active برای بازخورد لمسی */
.product-card__cta-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 1px 3px rgba(37, 211, 102, 0.3);
}

/* افکت Ripple (موج) */
.product-card__cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.product-card__cta-button:hover::before {
    width: 300px;
    height: 300px;
}

/* آیکون WhatsApp */
.product-card__cta-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* متن دکمه */
.product-card__cta-text {
    position: relative;
    z-index: 1;
}

/* حالت Focus برای دسترسی‌پذیری */
.product-card__cta-button:focus {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

/* افکت Loading (اختیاری) */
.product-card__cta-button--loading {
    pointer-events: none;
    opacity: 0.7;
}

.product-card__cta-button--loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cta-spin 0.6s linear infinite;
}

@keyframes cta-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 767px) {
    .product-card {
        padding: 15px 10px;
    }
    
    .product-card__image-container img {
        max-height: 150px;
    }
    
    .product-card__title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .product-card__cta-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .product-card__cta-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .product-card__meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .product-card__cta-button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ========================================
   حالت Dark Mode (اختیاری)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .product-card {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .product-card__title-link {
        color: #e0e0e0;
    }
    
    .product-card__title-link:hover {
        color: #4da3ff;
    }
}


