/*======================================================================
# FAVORITOS.CSS - Sidebar de Favoritos
# Versão: 1.0 - Sidebar Moderno e Funcional
======================================================================*/

/*======================================================================
# OVERLAY - Bloqueia conteúdo de trás
======================================================================*/
.favorites-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 61, 79, 0.9);
  backdrop-filter: blur(10px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.favorites-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/*======================================================================
# SIDEBAR - 100% Mobile, 640px Desktop
======================================================================*/
.favorites-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #ffffff 0%, #fff5f8 100%);
  box-shadow: -8px 0 40px rgba(236, 72, 153, 0.3);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorites-sidebar.active {
  transform: translate3d(0, 0, 0);
}

@media (min-width: 769px) {
  .favorites-sidebar {
    width: 640px;
  }
}

/*======================================================================
# HEADER
======================================================================*/
.favorites-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  gap: 12px;
}

.favorites-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ec4899, #f472b6, #ec4899);
}

.favorites-header-left,
.favorites-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.favorites-header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.favorites-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.favorites-title i {
  font-size: 1.3rem;
}

.favorites-count-sidebar {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Botões do Header */
.favorites-header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  backdrop-filter: blur(4px);
}

.favorites-header-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorites-header-btn.btn-clear-favs {
  background: rgba(239, 68, 68, 0.3);
}

.favorites-header-btn.btn-clear-favs:hover {
  background: rgba(239, 68, 68, 0.5);
}

.favorites-header-btn.favorites-close:hover {
  transform: rotate(90deg) scale(1.05);
}

/*======================================================================
# CONTENT
======================================================================*/
.favorites-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--light-bg);
  -webkit-overflow-scrolling: touch;
}

.favorites-content::-webkit-scrollbar {
  width: 8px;
}

.favorites-content::-webkit-scrollbar-track {
  background: rgba(236, 72, 153, 0.05);
}

.favorites-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #ec4899, #db2777);
  border-radius: 10px;
}

/*======================================================================
# FAVORITOS VAZIO
======================================================================*/
.favorites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  min-height: 400px;
}

.favorites-empty i {
  font-size: 6rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #ec4899, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.6;
}

.favorites-empty h4 {
  font-size: 1.6rem;
  color: var(--text-color);
  margin-bottom: 12px;
  font-weight: 700;
}

.favorites-empty p {
  color: var(--light-text);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.btn-start-shopping {
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-start-shopping:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.5);
}

/*======================================================================
# ITENS DOS FAVORITOS
======================================================================*/
.favorites-items {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.favorite-item {
  background: white;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(236, 72, 153, 0.12);
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
}

.favorite-item:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.25);
  border-color: #ec4899;
}

.favorite-item-image {
  width: 100px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--light-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.favorite-item-image:hover {
  transform: scale(1.05);
}

.favorite-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.favorite-item-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.3s ease;
}

.favorite-item-name:hover {
  color: #ec4899;
}

.favorite-item-price {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ec4899, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: auto;
}

.favorite-item-stock {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.favorite-item-stock.in-stock {
  color: #10b981;
}

.favorite-item-stock.out-of-stock {
  color: #ef4444;
}

.favorite-item-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-add-to-cart-fav {
  background: linear-gradient(135deg, #ec4899, #db2777);
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.btn-add-to-cart-fav:hover:not(:disabled) {
  background: linear-gradient(135deg, #db2777, #be185d);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}

.btn-add-to-cart-fav:disabled {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-remove-favorite {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  flex-shrink: 0;
}

.btn-remove-favorite:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: scale(1.1) rotate(90deg);
}

/*======================================================================
# FOOTER
======================================================================*/
.favorites-footer {
  padding: 20px 24px;
  background: white;
  border-top: 3px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(236, 72, 153, 0.1);
  flex-shrink: 0;
}

.favorites-summary {
  background: var(--light-bg);
  padding: 18px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.favorites-total-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
}

.favorites-total-count {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ec4899, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/*======================================================================
# LOADING
======================================================================*/
.favorites-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  min-height: 400px;
}

.favorites-loading i {
  font-size: 4rem;
  background: linear-gradient(135deg, #ec4899, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  animation: spin 1.5s linear infinite;
}

.favorites-loading p {
  color: var(--light-text);
  font-size: 1.05rem;
  font-weight: 600;
}

/*======================================================================
# RESPONSIVE
======================================================================*/
@media (max-width: 768px) {
  .favorites-header {
    padding: 18px 20px;
  }
  
  .favorites-title {
    font-size: 1.1rem;
  }
  
  .favorites-header-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  
  .favorites-content {
    padding: 20px;
  }
  
  .favorite-item {
    padding: 14px;
    gap: 12px;
  }
  
  .favorite-item-image {
    width: 80px;
    height: 100px;
  }
  
  .favorites-footer {
    padding: 18px 20px;
  }
}

@media (max-width: 480px) {
  .favorites-header {
    padding: 16px 18px;
  }
  
  .favorites-title {
    font-size: 1rem;
  }
  
  .favorites-header-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  
  .favorites-count-sidebar {
    font-size: 0.75rem;
    padding: 2px 8px;
  }
  
  .favorites-content {
    padding: 16px 18px;
  }
  
  .favorite-item-image {
    width: 70px;
    height: 90px;
  }
  
  .favorite-item-actions {
    flex-direction: column;
  }
  
  .btn-add-to-cart-fav {
    width: 100%;
  }
  
  .btn-remove-favorite {
    width: 100%;
  }
}

/*======================================================================
# ANIMAÇÕES
======================================================================*/
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  10%, 30% { transform: scale(0.9); }
  20%, 40% { transform: scale(1.1); }
}

.favorites-title i {
  animation: heartBeat 1.5s ease-in-out infinite;
}