/* ======================================================================= */
/* LIKES CART CSS - Enhanced & Mobile Optimized                           */
/* ======================================================================= */

/* ======================================================================= */
/* CART MODAL CONTAINER                                                   */
/* ======================================================================= */
.likes-cart-modal {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  will-change: right;
  /* Performance Hint */
}

.likes-cart-modal.show {
  right: 0;
}

.likes-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  will-change: opacity;
}

.likes-cart-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ======================================================================= */
/* CART HEADER                                                            */
/* ======================================================================= */
.likes-cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(199, 125, 255, 0.1), rgba(255, 107, 157, 0.05));
  position: relative;
}

.likes-cart-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.likes-cart-title svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 4px rgba(199, 125, 255, 0.3));
}

.likes-cart-subtitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.likes-cart-count {
  color: var(--text);
  font-weight: 600;
}

.likes-cart-total {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.likes-cart-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  /* Größer für Touch */
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  font-size: 1.5rem;
}

.likes-cart-close:hover,
.likes-cart-close:active {
  background: var(--primary);
  color: white;
  transform: rotate(90deg) scale(1.1);
  border-color: var(--primary);
}

/* ======================================================================= */
/* CART CONTENT AREA                                                      */
/* ======================================================================= */
.likes-cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  position: relative;
  -webkit-overflow-scrolling: touch;
  /* Flüssiges Scrollen iOS */
  overscroll-behavior: contain;
  /* Stop scroll chaining */
}

.likes-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.likes-cart-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.likes-cart-empty-text {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.likes-cart-empty-subtext {
  font-size: 0.9rem;
}

/* ======================================================================= */
/* CATEGORY SECTIONS                                                      */
/* ======================================================================= */
.likes-category-section {
  margin-bottom: 2rem;
  animation: fadeInUp 0.5s ease-out;
}

.likes-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.likes-category-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.likes-category-header:hover::before {
  opacity: 1;
}

.likes-category-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  z-index: 1;
}

.likes-category-name {
  color: white;
  font-weight: 600;
  font-size: 1rem;
  text-transform: capitalize;
  z-index: 1;
  flex: 1;
}

.likes-category-count {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1;
}

/* ======================================================================= */
/* PRODUCT ITEMS                                                          */
/* ======================================================================= */
.likes-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 0.5rem;
}

.likes-product-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.likes-product-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(199, 125, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.likes-product-item:hover,
.likes-product-item:active {
  background: rgba(199, 125, 255, 0.1);
  border-color: var(--primary);
  transform: translateX(5px);
}

.likes-product-item:hover::before {
  left: 100%;
}

.likes-product-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-light);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.likes-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.likes-product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.likes-product-brand {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.likes-product-price {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 700;
}

/* Remove Button - Mobile Optimized */
.likes-product-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  /* Größeres Touch Ziel */
  height: 32px;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

/* Desktop: Nur bei Hover sichtbar */
@media (hover: hover) {
  .likes-product-remove {
    opacity: 0;
    transform: scale(0.8);
  }

  .likes-product-item:hover .likes-product-remove {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile: Immer sichtbar aber dezent */
@media (hover: none) {
  .likes-product-remove {
    opacity: 1;
    background: rgba(20, 20, 20, 0.6);
    /* Kontrast auf Mobile */
    transform: scale(1);
  }
}

.likes-product-remove:hover,
.likes-product-remove:active {
  background: var(--error);
  border-color: var(--error);
  transform: scale(1.1);
}

.likes-product-remove svg {
  width: 16px;
  height: 16px;
  color: var(--error);
  pointer-events: none;
}

.likes-product-remove:hover svg,
.likes-product-remove:active svg {
  color: white;
}

/* ======================================================================= */
/* CART FOOTER ACTIONS                                                    */
/* ======================================================================= */
.likes-cart-footer {
  padding: 1.5rem;
  border-top: 2px solid var(--border);
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(10px);
}

.likes-cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(199, 125, 255, 0.1), rgba(255, 107, 157, 0.05));
  border-radius: 12px;
  border: 1px solid rgba(199, 125, 255, 0.2);
}

.likes-summary-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.likes-summary-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.likes-cart-actions {
  display: flex;
  gap: 1rem;
}

.likes-cart-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  font-size: 0.95rem;
}

.likes-cart-btn svg {
  width: 18px;
  height: 18px;
}

.likes-cart-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 6px 20px rgba(199, 125, 255, 0.3);
}

.likes-cart-btn.primary:hover,
.likes-cart-btn.primary:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(199, 125, 255, 0.5);
}

.likes-cart-btn.primary.cooldown {
  background: var(--text-secondary);
  cursor: wait;
  box-shadow: none;
  transform: none;
}

.likes-cart-btn.secondary {
  background: linear-gradient(135deg, #5865f2, #7289da);
  color: white;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.3);
  opacity: 0.5;
  cursor: not-allowed;
}

.likes-cart-btn.secondary.active {
  opacity: 1;
  cursor: pointer;
}

.likes-cart-btn.secondary.active:hover,
.likes-cart-btn.secondary.active:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.5);
}

/* ======================================================================= */
/* ANIMATIONS                                                             */
/* ======================================================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

/* ======================================================================= */
/* RESPONSIVE DESIGN & MOBILE OPTIMIZATION                                */
/* ======================================================================= */
@media (max-width: 768px) {
  .likes-cart-modal {
    width: 100%;
    max-width: 420px;
  }
}

/* ECHTE MOBILE OPTIMIERUNG (Handys) */
@media (max-width: 480px) {
  .likes-cart-modal {
    width: 100%;
    /* Volle Breite */
    max-width: 100%;
    right: -100%;
    /* Startet komplett außerhalb */
  }

  .likes-cart-modal.show {
    right: 0;
  }

  /* Header kompakter */
  .likes-cart-header {
    padding: 1rem 1.2rem;
  }

  .likes-cart-title {
    font-size: 1.3rem;
  }

  /* Footer mit Safe Area Support (für iPhone Home Bar) */
  .likes-cart-footer {
    padding: 1.2rem;
    padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
  }

  .likes-cart-content {
    padding: 0.8rem;
  }

  .likes-product-item {
    padding: 0.6rem;
  }

  /* Buttons untereinander statt nebeneinander für bessere Erreichbarkeit */
  .likes-cart-actions {
    flex-direction: column;
    gap: 0.8rem;
  }

  .likes-cart-btn {
    padding: 1.1rem;
    /* Höhere Buttons für Touch */
  }

  /* Animation beim Hover entfernen auf Mobile */
  .likes-product-item:hover {
    transform: none;
  }
}