/* استایل‌های کارت محصول */

/* انیمیشن ظاهر شدن محصولات */
#product-list > div {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* کارت محصول */
.product-card {
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    box-shadow: 0 4px 12px var(--shadow-color);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.4s ease,
    background-color 0.3s ease;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 32px var(--shadow-color);
    border-color: var(--primary-color);
}

.product-card:hover::before {
    opacity: 0.03;
}

/* بج‌های محصول */
.product-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.product-badge i {
    font-size: 0.95rem;
}

.badge-out-of-stock {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.badge-discount {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.badge-limited {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

/* کانتینر تصویر */
.product-image-container {
    position: relative;
    width: 100%;
    padding: 1rem 1rem 0;
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    aspect-ratio: 1/1;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

/* اورلی تصویر */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.btn-quick-view {
    background: white;
    color: var(--primary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.product-card:hover .btn-quick-view {
    transform: translateY(0);
}

.btn-quick-view:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* محتوای محصول */
.product-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    z-index: 1;
    flex: 1;
}

/* نام محصول */
.product-name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-name a:hover {
    color: var(--primary-color);
}

/* وضعیت موجودی */
.product-stock-status {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.product-stock-status span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    background: var(--light-bg);
    transition: background-color 0.3s ease;
}

.stock-available {
    color: #059669;
}

.stock-limited {
    color: #D97706;
}

.stock-out {
    color: #DC2626;
}

.product-stock-status i {
    font-size: 0.9rem;
}

/* بخش قیمت */
.product-price-section {
    margin-top: auto;
}

.price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price-original {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.price-final {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.price-final .price-amount {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-final .price-currency {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.3s ease;
}

.price-save {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    color: #065F46;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .price-save {
    background: linear-gradient(135deg, #064E3B, #065F46);
    color: #D1FAE5;
}

.price-save i {
    font-size: 0.9rem;
}

/* کنترل سبد خرید */
.product-actions {
    margin-top: 0.8rem;
}

.btn-add-to-cart {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    background: linear-gradient(135deg, var(--success-color), #6A7C5D);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-add-to-cart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-add-to-cart:hover::before {
    width: 300px;
    height: 300px;
}

.btn-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.btn-add-to-cart:active {
    transform: translateY(0);
}

.btn-icon {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-unavailable {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-unavailable:hover {
    transform: none;
    box-shadow: none;
}

.btn-unavailable::before {
    display: none;
}

/* کنترل تعداد محصول در سبد */
.btn-quantity-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--light-bg);
    border-radius: 14px;
    border: 2px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-quantity-control button {
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-quantity-control button:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.btn-quantity-control button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-quantity-control span {
    font-weight: 700;
    font-size: 1.15rem;
    min-width: 40px;
    text-align: center;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* حالت لودینگ */
.product-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
    z-index: 100;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ریسپانسیو */
@media (max-width: 576px) {
    .product-card {
        border-radius: 16px;
        min-width: 0 !important;
        max-width: 100% !important;
        width: auto !important;
        box-sizing: border-box !important;
    }

    .product-image-container {
        padding: 0.8rem 0.8rem 0;
    }

    .product-image-wrapper {
        border-radius: 12px;
    }

    .product-content {
        padding: 1rem;
        gap: 0.6rem;
    }

    .product-name {
        font-size: 0.95rem;
        min-height: 2.4em;
    }

    .price-final .price-amount {
        font-size: 1.3rem;
    }

    .btn-add-to-cart {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}
