/* Shop Specific Styles */

/* Product Card Animations */
.shop-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-card:hover {
  transform: translateY(-2px);
}

/* Image Zoom Effect */
.product-image-zoom {
  overflow: hidden;
  position: relative;
}

.product-image-zoom img {
  transition: transform 0.5s ease;
}

.product-image-zoom:hover img {
  transform: scale(1.1);
}

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(102, 126, 234, 0.1);
  border-radius: 50%;
  border-top: 3px solid #667eea;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Price Strike-through Animation */
.price-strike {
  position: relative;
  display: inline-block;
}

.price-strike::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

/* Badge Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.shop-badge-danger {
  animation: pulse 2s infinite;
}

/* Line Clamp Utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom Scrollbar */
.shop-card::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar {
  height: 6px;
}

.shop-card::-webkit-scrollbar-track,
.overflow-x-auto::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.shop-card::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 10px;
}

.shop-card::-webkit-scrollbar-thumb:hover,
.overflow-x-auto::-webkit-scrollbar-thumb:hover {
  background: #5568d3;
}

/* Quantity Control Buttons */
.quantity-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  user-select: none;
}

.quantity-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Empty State */
.empty-state {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateX(400px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  max-width: 320px;
}

[dir="rtl"] .toast {
  right: auto;
  left: 20px;
  transform: translateX(-400px);
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  border-left: 4px solid #22c55e;
}

[dir="rtl"] .toast-success {
  border-left: none;
  border-right: 4px solid #22c55e;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

[dir="rtl"] .toast-error {
  border-left: none;
  border-right: 4px solid #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .shop-container {
    padding: 0 0.75rem;
  }
  
  .shop-card {
    padding: 1rem;
  }
  
  .toast {
    right: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
  }
}

/* Dark Theme Support */
[data-theme="dark"] .shop-card {
  background: #1f2937;
  color: #f9fafb;
}

[data-theme="dark"] .shop-card input,
[data-theme="dark"] .shop-card select,
[data-theme="dark"] .shop-card textarea {
  background: #111827;
  border-color: #374151;
  color: #f9fafb;
}

[data-theme="dark"] .shop-card input:focus,
[data-theme="dark"] .shop-card select:focus,
[data-theme="dark"] .shop-card textarea:focus {
  border-color: #667eea;
  background: #1f2937;
}

[data-theme="dark"] .border {
  border-color: #374151;
}

[data-theme="dark"] .bg-gray-50 {
  background: #111827;
}

[data-theme="dark"] .bg-gray-100 {
  background: #1f2937;
}

[data-theme="dark"] .text-gray-600 {
  color: #9ca3af;
}

[data-theme="dark"] .text-gray-700 {
  color: #d1d5db;
}

[data-theme="dark"] .text-gray-500 {
  color: #6b7280;
}
/* ===== FIX: Price/Discount light cards in DARK mode + red discount ===== */

/* اگر باکس قیمت از bg-*-50 استفاده کرده */
[data-theme="dark"] .bg-pink-50,
[data-theme="dark"] .bg-rose-50,
[data-theme="dark"] .bg-purple-50,
[data-theme="dark"] .bg-indigo-50,
[data-theme="dark"] .bg-violet-50,
[data-theme="dark"] .bg-fuchsia-50 {
  background-color: #111827 !important;
}

/* اگر باکس قیمت گرادیانی مثل from-... to-... دارد (Tailwind gradient vars) */
[data-theme="dark"] .from-pink-50,
[data-theme="dark"] .from-rose-50,
[data-theme="dark"] .from-purple-50,
[data-theme="dark"] .from-indigo-50,
[data-theme="dark"] .from-violet-50,
[data-theme="dark"] .from-fuchsia-50 {
  --tw-gradient-from: #111827 !important;
  --tw-gradient-to: rgba(17, 24, 39, 0) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

[data-theme="dark"] .to-pink-50,
[data-theme="dark"] .to-rose-50,
[data-theme="dark"] .to-purple-50,
[data-theme="dark"] .to-indigo-50,
[data-theme="dark"] .to-violet-50,
[data-theme="dark"] .to-fuchsia-50 {
  --tw-gradient-to: #1f2937 !important;
}

/* خوانایی متن‌های داخل باکس قیمت */
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-slate-900,
[data-theme="dark"] .text-black {
  color: #f9fafb !important;
}

[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-slate-500,
[data-theme="dark"] .text-slate-400 {
  color: #9ca3af !important;
}

/* ===== Discount styling: struck price + percent in RED (dark mode) ===== */
[data-theme="dark"] del,
[data-theme="dark"] s,
[data-theme="dark"] .line-through {
  color: #ef4444 !important;        /* red */
  opacity: 0.95;
  text-decoration-color: #ef4444 !important;
}

/* اگر درصد تخفیف با کلاس‌های رنگی Tailwind آمده باشد */
[data-theme="dark"] .text-red-500,
[data-theme="dark"] .text-red-600,
[data-theme="dark"] .text-rose-500,
[data-theme="dark"] .text-rose-600 {
  color: #ef4444 !important;
}

/* اگر درصد تخفیف به صورت badge/چیپ نمایش داده می‌شود */
[data-theme="dark"] .discount,
[data-theme="dark"] .discount-badge,
[data-theme="dark"] .badge-discount {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

/* RTL Support */
[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .shop-btn {
  text-align: center;
}

/* Print Styles */
@media print {
  .shop-card {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
  
  .shop-btn,
  button {
    display: none;
  }
}

/* Accessibility */
.shop-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Smooth Transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
/* =========================
   Wishlist Button – Pro UX
   Pulse + Shake + SVG Heart
   ========================= */

.wishlist-btn {
  background: transparent !important;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Heart icon */
.wishlist-icon {
  width: 22px;
  height: 22px;
  color: #9ca3af; /* gray */
  transition: transform 0.2s ease, color 0.2s ease, fill 0.2s ease;
}

/* ========== ACTIVE (Wishlisted) ========== */
.wishlist-btn.is-wishlisted .wishlist-icon {
  color: #ef4444;          /* red */
  fill: #ef4444;
  transform: scale(1.25);
}

/* ========== HOVER ========== */
.wishlist-btn:hover .wishlist-icon {
  transform: scale(1.15);
}

/* ========== PULSE ANIMATION ========== */
@keyframes heartPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1.25); }
}

.wishlist-btn.pulse .wishlist-icon {
  animation: heartPulse 0.35s ease;
}

/* ========== SHAKE ANIMATION ========== */
@keyframes heartShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.wishlist-btn.shake .wishlist-icon {
  animation: heartShake 0.25s ease;
}

/* ========== DARK MODE ========== */
[data-theme="dark"] .wishlist-btn {
  border-color: rgba(255,255,255,0.2);
}

[data-theme="dark"] .wishlist-icon {
  color: #e5e7eb; /* light */
}

[data-theme="dark"] .wishlist-btn.is-wishlisted .wishlist-icon {
  color: #f87171;
  fill: #f87171;
}
