/* Favorites Overlay Styles */
.favorites-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.favorites-overlay.open {
  transform: translateY(0);
}

.fav-header {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  z-index: 10;
}

.fav-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--accent);
  margin: 0;
}

.fav-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-close:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(90deg);
}

.fav-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 100px; /* Space for bottom nav */
}

/* Empty State */
.fav-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  gap: 24px;
  text-align: center;
  display: none; /* Hidden by default */
}

.fav-empty-state i {
  font-size: 64px;
  opacity: 0.2;
}

.fav-empty-state p {
  font-size: 18px;
  margin: 0;
}

/* Improved CTA Button */
.cta-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #800020 100%);
  color: #fff;
  border: none;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(165, 42, 42, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: pulse-glow 2s infinite;
}

.cta-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: 0.5s;
}

.cta-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px rgba(165, 42, 42, 0.4);
}

.cta-primary:hover::before {
  left: 100%;
}

.cta-primary:active {
  transform: translateY(1px) scale(0.98);
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(165, 42, 42, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(165, 42, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(165, 42, 42, 0); }
}

/* Favorite Item Card */
.fav-item {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.4s ease backwards;
  flex-shrink: 0;
}

.fav-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.fav-item.pinned {
  border: 2px solid var(--accent);
  background: linear-gradient(to right, #fff, #fffbfb);
}

.fav-item.pinned::before {
  content: "\f08d"; /* fa-thumbtack */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 4px 8px;
  border-bottom-right-radius: 8px;
  font-size: 12px;
  z-index: 2;
}

.fav-img {
  width: 100px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.fav-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fav-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fav-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.2;
}

.fav-region {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.fav-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 16px;
}

.fav-item.partner-product {
  border-color: #8B5A2B;
  box-shadow: 0 18px 36px rgba(64, 34, 12, 0.28);
}
.fav-item.partner-product .fav-price {
  color: #8B5A2B;
}
.fav-partner-label {
  font-size: 12px;
  font-weight: 600;
  color: #8B5A2B;
}

.fav-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.fav-btn {
  border: none;
  background: #f0f0f0;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-btn:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

.fav-btn.delete:hover {
  background: #ffebee;
  color: #d32f2f;
}

.fav-btn.pin:hover {
  background: #e3f2fd;
  color: #1976d2;
}

.fav-btn.cart-btn {
  background: var(--accent);
  color: #fff;
  width: auto;
  padding: 0 16px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 13px;
  flex: 1;
}

.fav-btn.cart-btn:hover {
  background: #5a1520;
}

.fav-item.partner-product {
  border-color: #8B5A2B;
  box-shadow: 0 18px 36px rgba(64, 34, 12, 0.28);
}
.fav-item.partner-product .fav-price {
  color: #8B5A2B;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  .favorites-overlay {
    width: 400px;
    left: auto;
    right: 0;
    border-left: 1px solid rgba(0,0,0,0.1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transform: translateX(100%);
  }
  
  .favorites-overlay.open {
    transform: translateX(0);
  }
}

/* PDO Fav Button */
.pdo-fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.pdo-fav-btn:hover {
  transform: scale(1.1);
}

.pdo-fav-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.pdo-fav-btn.active i {
  color: #fff;
}
