/* ===========================================
   أنماط بطاقات المنتجات
   Product Cards Styles
   =========================================== */

/* ============ Products Grid ============ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ============ Product Card ============ */
/* ============ Product Card (Modern Minimalist) ============ */
.product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  border: none;
  /* No border for cleaner look */
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(10, 36, 99, 0.15);
  /* Colored shadow */
}

/* Product Image */
.product-card-image {
  position: relative;
  height: 220px;
  /* Slightly taller */
  overflow: hidden;
  background: #f8f9fa;
  /* Clean plain background */
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Changed to contain for better product visibility */
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  padding: 15px;
  /* Add padding so product breathes */
}

.product-card:hover .product-card-image img,
.product-card:hover .product-image-placeholder {
  transform: scale(1.05);
}

/* Product Badges */
/* Badges Container */
.product-badges-container {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

body.ltr .product-badges-container {
  right: auto;
  left: 12px;
}

.product-badge {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-badge.sale {
  background: var(--red-main, #DC2626);
}

.product-badge.new {
  background: var(--primary-light, #1E40AF);
}

.product-badge.out-of-stock {
  background: #6b7280;
}

/* Quick Actions */
/* Fixed Actions Layout (As per user request for clear structure) */
.product-actions-fixed {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

body.ltr .product-actions-fixed {
  left: auto;
  right: 12px;
}

/* Actions are always visible now for better UX, or can hover-effect if preferred */
.product-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #f3f4f6;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  color: var(--primary-color);
  font-size: 1rem;
}

.product-action-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.product-action-btn.cart:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.product-action-btn.whatsapp:hover {
  background: var(--primary-light, #1E40AF);
  color: white;
  border-color: var(--primary-light, #1E40AF);
}



/* Product Body */
.product-card-body {
  padding: 16px;
}

.product-category {
  font-size: 0.75rem;
  color: #0A2463;
  font-weight: 600;
  margin-bottom: 6px;
}

.product-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.product-title a:hover {
  color: var(--red-main, #DC2626);
}

/* Product Price */
.product-price {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.price-current {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0A2463;
}

.price-old {
  font-size: 0.85rem;
  color: var(--red-main);
  text-decoration: line-through;
}

.price-discount {
  font-size: 0.7rem;
  background: rgba(220, 38, 38, 0.1);
  color: var(--red-main, #DC2626);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Product Footer */
.product-card-footer {
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.product-stock {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-stock i {
  font-size: 0.5rem;
}

.product-stock.in-stock {
  color: var(--primary-light, #1E40AF);
}

.product-stock.out-of-stock {
  color: var(--red-main, #DC2626);
}

.product-stock.low-stock {
  color: var(--red-accent, #EF4444);
}

.product-sku {
  font-size: 0.7rem;
  color: #9ca3af;
}

.product-stock i {
  font-size: 0.5rem;
}

.product-sku {
  font-size: 0.7rem;
  color: var(--gray-400);
}

/* Add to Cart Button */
.add-to-cart-btn {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-500);
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  transition: all var(--transition-fast);
  margin-top: var(--spacing-sm);
}

.add-to-cart-btn:hover {
  background: var(--red-main);
  color: #0A2463;
  transform: translateY(-2px);
}

.add-to-cart-btn:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

/* ============ Product Card Variants ============ */

/* Horizontal Card */
.product-card.horizontal {
  display: flex;
  flex-direction: row;
}

.product-card.horizontal .product-card-image {
  width: 200px;
  height: auto;
  flex-shrink: 0;
}

.product-card.horizontal .product-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Compact Card */
.product-card.compact .product-card-image {
  height: 150px;
}

.product-card.compact .product-card-body {
  padding: var(--spacing-sm);
}

.product-card.compact .product-title {
  font-size: 0.85rem;
}

.product-card.compact .price-current {
  font-size: 1rem;
}

/* Featured Card */
.product-card.featured {
  grid-column: span 2;
}

.product-card.featured .product-card-image {
  height: 300px;
}

@media (max-width: 768px) {
  .product-card.featured {
    grid-column: span 1;
  }

  .product-card.featured .product-card-image {
    height: 200px;
  }
}

/* ============ Product List View ============ */
.products-list .product-card {
  display: flex;
  flex-direction: row;
}

.products-list .product-card-image {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.products-list .product-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.products-list .product-title {
  -webkit-line-clamp: 1;
  min-height: auto;
}

.products-list .product-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: var(--spacing-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.products-list .product-card-footer {
  border-top: none;
  padding-top: 0;
}

@media (max-width: 640px) {
  .products-list .product-card {
    flex-direction: column;
  }

  .products-list .product-card-image {
    width: 100%;
    height: 200px;
  }
}

/* ============ Loading Skeleton ============ */
.product-card.skeleton .product-card-image {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.product-card.skeleton .skeleton-text {
  height: 1em;
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}