/* ========================================
   WISHLIST DRAWER - Slide-in Sidebar Wishlist
   Modern design matching cart drawer style
   ======================================== */

/* Wishlist Drawer Overlay */
.wishlist-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.35s ease;
  will-change: opacity;
  backdrop-filter: blur(2px);
}

.wishlist-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wishlist-drawer-overlay.dragging {
  transition: none !important;
}

/* Wishlist Drawer Container - Always on the left for all languages */
.wishlist-drawer {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  width: 400px !important;
  max-width: 85vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: #fff !important;
  z-index: 999999 !important;
  overflow: hidden !important;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15) !important;
  transform: translateX(-100%) !important;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  visibility: hidden !important;
  touch-action: pan-y;
  will-change: transform;
  display: flex !important;
  flex-direction: column;
  font-family: "Cairo", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Keep drawer on left for RTL too */
[dir="rtl"] .wishlist-drawer,
html[lang="ar"] .wishlist-drawer {
  left: 0 !important;
  right: auto !important;
  transform: translateX(-100%) !important;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15) !important;
}

/* Open state */
.wishlist-drawer.open,
[dir="rtl"] .wishlist-drawer.open,
html[lang="ar"] .wishlist-drawer.open {
  transform: translateX(0) !important;
  visibility: visible !important;
}

.wishlist-drawer.dragging {
  transition: none !important;
}

/* Wishlist Drawer Header - Pink/Red gradient for wishlist theme */
.wishlist-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.wishlist-drawer-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.wishlist-drawer-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wishlist-drawer-title svg {
  width: 24px;
  height: 24px;
}

.wishlist-drawer-count {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.wishlist-drawer-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.wishlist-drawer-close:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

.wishlist-drawer-close svg {
  width: 20px;
  height: 20px;
}

/* Wishlist Items Container */
.wishlist-drawer-items {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar */
.wishlist-drawer-items::-webkit-scrollbar {
  width: 6px;
}

.wishlist-drawer-items::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.wishlist-drawer-items::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e91e63 0%, #c2185b 100%);
  border-radius: 10px;
}

/* Loading State */
.wishlist-drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: #e91e63;
}

.wishlist-drawer-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(233, 30, 99, 0.2);
  border-top-color: #e91e63;
  border-radius: 50%;
  animation: wishlistSpinner 0.8s linear infinite;
}

@keyframes wishlistSpinner {
  to {
    transform: rotate(360deg);
  }
}

.wishlist-drawer-loading span {
  font-size: 14px;
  font-weight: 500;
  color: #888;
}

/* Fade in animation for content */
.wishlist-drawer-items.fade-in {
  animation: fadeInWishlistContent 0.3s ease forwards;
}

@keyframes fadeInWishlistContent {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Empty Wishlist State */
.wishlist-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
  height: 100%;
}

.wishlist-drawer-empty svg {
  width: 80px;
  height: 80px;
  color: #ddd;
  margin-bottom: 20px;
}

.wishlist-drawer-empty-text {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.wishlist-drawer-empty-subtext {
  font-size: 14px;
  color: #888;
  margin-bottom: 24px;
}

.wishlist-drawer-shop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.wishlist-drawer-shop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 30, 99, 0.3);
  color: #fff;
}

/* Wishlist Item */
.wishlist-drawer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  transition: background 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.wishlist-drawer-item:hover {
  background: #fafafa;
}

.wishlist-drawer-item:last-child {
  border-bottom: none;
}

.wishlist-drawer-item.removing {
  opacity: 0.5;
  pointer-events: none;
}

/* Item Link */
.wishlist-drawer-item-link {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.wishlist-drawer-item-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Item Image */
.wishlist-drawer-item-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}

.wishlist-drawer-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wishlist-drawer-item-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

.wishlist-drawer-item-image-placeholder svg {
  width: 32px;
  height: 32px;
  color: #ccc;
}

/* Item Details */
.wishlist-drawer-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wishlist-drawer-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wishlist-drawer-item-price {
  font-size: 15px;
  font-weight: 700;
  color: #e91e63;
}

/* Remove Button */
.wishlist-drawer-item-remove {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 50%;
}

[dir="rtl"] .wishlist-drawer-item-remove,
html[lang="ar"] .wishlist-drawer-item-remove {
  right: auto;
  left: 16px;
}

.wishlist-drawer-item-remove:hover {
  color: #fff;
  background: #ef4444;
  transform: translateY(-50%) scale(1.1);
}

.wishlist-drawer-item-remove svg {
  width: 16px;
  height: 16px;
}

/* Wishlist Footer */
.wishlist-drawer-footer {
  padding: 20px 24px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

/* Buttons */
.wishlist-drawer-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wishlist-drawer-view-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.wishlist-drawer-view-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
  color: #fff;
}

.wishlist-drawer-view-all-btn svg {
  transition: transform 0.3s ease;
}

[dir="rtl"] .wishlist-drawer-view-all-btn svg,
html[lang="ar"] .wishlist-drawer-view-all-btn svg {
  transform: rotate(180deg);
}

.wishlist-drawer-view-all-btn:hover svg {
  transform: translateX(4px);
}

[dir="rtl"] .wishlist-drawer-view-all-btn:hover svg,
html[lang="ar"] .wishlist-drawer-view-all-btn:hover svg {
  transform: translateX(-4px) rotate(180deg);
}

/* Body class when drawer is open */
body.wishlist-drawer-open {
  overflow: hidden;
}

/* Mobile Responsive - Tablets */
@media screen and (max-width: 768px) {
  .wishlist-drawer {
    width: 320px !important;
    max-width: 85vw !important;
  }
}

/* Mobile Responsive - Small screens */
@media screen and (max-width: 480px) {
  .wishlist-drawer {
    width: 280px !important;
    max-width: 80vw !important;
  }
  
  .wishlist-drawer-item {
    padding: 12px 16px;
    gap: 10px;
  }
  
  .wishlist-drawer-item-image {
    width: 60px;
    height: 60px;
  }
  
  .wishlist-drawer-item-name {
    font-size: 12px;
  }
  
  .wishlist-drawer-item-price {
    font-size: 13px;
  }
  
  .wishlist-drawer-header {
    padding: 14px 16px;
  }
  
  .wishlist-drawer-title {
    font-size: 16px;
  }
  
  .wishlist-drawer-count {
    font-size: 12px;
    padding: 3px 10px;
  }
  
  .wishlist-drawer-footer {
    padding: 14px 16px;
  }
  
  .wishlist-drawer-view-all-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* Animations */
@keyframes slideInWishlistItem {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wishlist-drawer-items.fade-in .wishlist-drawer-item {
  animation: slideInWishlistItem 0.3s ease forwards;
}

.wishlist-drawer-item:nth-child(1) { animation-delay: 0.05s; }
.wishlist-drawer-item:nth-child(2) { animation-delay: 0.1s; }
.wishlist-drawer-item:nth-child(3) { animation-delay: 0.15s; }
.wishlist-drawer-item:nth-child(4) { animation-delay: 0.2s; }
.wishlist-drawer-item:nth-child(5) { animation-delay: 0.25s; }

