/* Product Card Component - Shared Styles */
.product-card-component {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-component:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Product Image */
.product-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f9fafb;
}

.product-card-image a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card-component:hover .product-card-image img {
    transform: scale(1.05);
}

/* Discount Badge */
.product-badge-discount {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    z-index: 2;
}

/* Quick Add Button */
.product-quick-add {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 2;
}

.product-card-component:hover .product-quick-add {
    opacity: 1;
    transform: translateY(0);
}

.product-quick-add:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.product-quick-add:active {
    transform: scale(0.95);
}

/* Product Content */
.product-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.product-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    min-height: 45px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s;
}

.product-card-title a:hover {
    color: #667eea;
}

/* Product Price */
.product-card-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.price-old {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 0.85rem;
}

.price-current {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .product-card-component {
        border-radius: 12px;
    }
    
    .product-card-image {
        padding-top: 100%;
    }
    
    .product-card-content {
        padding: 12px;
    }
    
    .product-card-title {
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .price-current {
        font-size: 1rem;
    }
    
    .product-quick-add {
        opacity: 1;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}



/* List View (Optional) */
.product-list-view .product-card-component {
    flex-direction: row;
    height: auto;
}

.product-list-view .product-card-image {
    width: 200px;
    padding-top: 0;
    height: 200px;
    flex-shrink: 0;
}

.product-list-view .product-card-content {
    flex: 1;
}

@media (max-width: 576px) {
    .product-list-view .product-card-component {
        flex-direction: column;
    }
    
    .product-list-view .product-card-image {
        width: 100%;
        padding-top: 100%;
        height: auto;
    }
}


/* Quantity Controls - Compact Design */
.product-quantity-controls {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    z-index: 10;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qty-control-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.qty-control-btn.qty-delete {
    background: #fee2e2;
    color: #dc2626;
}

.qty-control-btn.qty-delete:hover {
    background: #fecaca;
    transform: scale(1.1);
}

.qty-control-btn.qty-plus {
    background: #dbeafe;
    color: #3b82f6;
}

.qty-control-btn.qty-plus:hover {
    background: #bfdbfe;
    transform: scale(1.1);
}

.qty-control-btn.qty-minus {
    background: #f3f4f6;
    color: #6b7280;
}

.qty-control-btn.qty-minus:hover {
    background: #e5e7eb;
    transform: scale(1.1);
}

.qty-control-display {
    min-width: 24px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    padding: 0 6px;
}

.qty-control-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qty-control-buttons .qty-control-btn {
    width: 24px;
    height: 12px;
    border-radius: 4px;
    font-size: 8px;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .product-quantity-controls {
        bottom: 6px;
        left: 6px;
    }
    
    .qty-control-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .qty-control-display {
        font-size: 0.85rem;
        min-width: 22px;
    }
    
    .qty-control-buttons .qty-control-btn {
        width: 22px;
        height: 11px;
    }
}

/* Notification Styles */
.product-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.product-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.product-notification.success {
    border-right: 4px solid #10b981;
}

.product-notification.success i {
    color: #10b981;
    font-size: 1.2rem;
}

.product-notification.error {
    border-right: 4px solid #ef4444;
}

.product-notification.error i {
    color: #ef4444;
    font-size: 1.2rem;
}

@media (max-width: 576px) {
    .product-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}


/* Daily Deals - استایل‌های ساده برای کارت HTML */

/* ==========================================
   Products Section - Normal Styles
   ========================================== */

/* استایل‌های عادی برای قسمت‌های دیگر حفظ می‌شود */
.products-section .product-card-component:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   Carousel Specific Styles
   ========================================== */

.daily-deals-carousel {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.daily-deals-carousel::-webkit-scrollbar {
    display: none;
}

.daily-deals-carousel-container {
    overflow: visible !important;
}

/* ==========================================
   جلوگیری از تداخل
   ========================================== */

/* Reset کامل برای products-section */
.products-section .product-quick-add {
    opacity: 0;
    transform: translateY(10px);
}

.products-section .product-card-component:hover .product-quick-add {
    opacity: 1;
    transform: translateY(0);
}

/* کنترل‌های تعداد در products-section */
/* توجه: display: none پیش‌فرض است و JavaScript آن را به flex تغییر می‌دهد */
.products-section .product-quantity-controls {
    position: absolute !important;
    bottom: 8px !important;
    left: 8px !important;
    z-index: 10 !important;
    /* display توسط JavaScript کنترل می‌شود */
}

/* وقتی که JavaScript display را flex کرده، اطمینان از نمایش صحیح */
.products-section .product-quantity-controls:not([style*="display: none"]) {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* اطمینان کامل از نمایش - استایل‌ها از parent گرفته می‌شود */

/* هماهنگ‌سازی اندازه با daily deals */
.products-section .product-quantity-controls {
    padding: 4px;
    gap: 4px;
}

.products-section .qty-control-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.products-section .qty-control-display {
    min-width: 24px;
    height: 28px;
    font-size: 0.9rem;
}

.products-section .qty-control-buttons .qty-control-btn {
    width: 24px;
    height: 12px;
    font-size: 8px;
}

/* در hover هم اگر visible بود، نمایش بده */
.products-section .product-card-component:hover .product-quantity-controls[style*="display: flex"] {
    opacity: 1 !important;
}
