/* === CART GLASS PREMIUM === */
#cart-drawer {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#cart-drawer[data-state="open"] {
  display: flex !important;
}

#cart-drawer > div {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(25px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(200%) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 1.5rem !important;
  width: 100% !important;
  max-width: 500px !important;
  height: 100% !important;
  position: relative !important;
  overflow: hidden !important;
  transform: translateX(100%) !important;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#cart-drawer[data-state="open"] > div {
  transform: translateX(0) !important;
}

/* === GLASS EFFECT TOP BORDER === */
#cart-drawer > div::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  z-index: 1;
}

/* === HEADER SECTION === */
#cart-drawer .flex.items-center.justify-between.mb-4 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding-bottom: 1rem !important;
  margin-bottom: 1.5rem !important;
  position: relative !important;
}

#cart-drawer h4 {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  margin: 0 !important;
}

#cart-drawer button[onclick="closeCart()"] {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#cart-drawer button[onclick="closeCart()"]:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: rgba(255, 255, 255, 1) !important;
  transform: scale(1.05) rotate(90deg) !important;
}

/* === PRODUCTS LIST SECTION === */
#products-list {
  flex-grow: 1 !important;
  overflow-y: auto !important;
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
  padding-right: 0.5rem !important;
}

/* === SCROLLBAR PREMIUM === */
#products-list::-webkit-scrollbar {
  width: 6px;
}

#products-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#products-list::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
  transition: background 0.3s ease;
}

#products-list::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* === CART MENU ITEM PREMIUM === */
#cart-menu-item {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  padding: 1rem !important;
  margin-bottom: 1rem !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  color: #fff !important;
  position: relative !important;
  overflow: hidden !important;
}

#cart-menu-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

#cart-menu-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* === PRODUCT IMAGE === */
#cart-menu-item img {
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  width: 56px !important;
  height: 56px !important;
  object-fit: cover !important;
  transition: all 0.3s ease !important;
}

#cart-menu-item:hover img {
  border-color: rgba(99, 102, 241, 0.3) !important;
  transform: scale(1.05) !important;
}

/* === PRODUCT INFO === */
#cart-menu-item h5 {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

#cart-menu-item .text-muted-foreground {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}

/* === QUANTITY CONTROLS === */
#cart-menu-item button {
  background: rgba(99, 102, 241, 0.15) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  color: rgba(99, 102, 241, 1) !important;
  border-radius: 8px !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
}

#cart-menu-item button:hover {
  background: rgba(99, 102, 241, 0.25) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  color: #6366f1 !important;
  transform: scale(1.05) !important;
}

/* === QUANTITY INPUT === */
#cart-menu-item input {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  width: 48px !important;
  height: 32px !important;
  text-align: center !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  outline: none !important;
  transition: all 0.3s ease !important;
}

#cart-menu-item input:focus {
  border-color: rgba(99, 102, 241, 0.6) !important;
  background: rgba(99, 102, 241, 0.1) !important;
  transform: scale(1.05) !important;
}

/* === REMOVE BUTTON === */
#cart-menu-item .bg-red-500 {
  background: rgba(239, 68, 68, 0.15) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: rgba(239, 68, 68, 1) !important;
  border-radius: 8px !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#cart-menu-item .bg-red-500:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
  transform: scale(1.05) rotate(5deg) !important;
}

/* === LUCIDE ICONS === */
#cart-menu-item [data-lucide] {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 2.5 !important;
}

/* === PRICING SECTION === */
#cart-pricing {
  background: rgba(99, 102, 241, 0.15) !important;
  backdrop-filter: blur(15px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(15px) saturate(150%) !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  border-radius: 16px !important;
  padding: 1.25rem 1.5rem !important;
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 700 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 1.125rem !important;
  margin-bottom: 1rem !important;
  position: relative !important;
  overflow: hidden !important;
}

#cart-pricing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

#cart-pricing span {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  font-weight: 900 !important;
  font-size: 1.25rem !important;
}

/* === CHECKOUT BUTTON === */
a[href="/checkout"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.75rem !important;
  background: rgba(16, 185, 129, 0.15) !important;
  backdrop-filter: blur(15px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(15px) saturate(150%) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  border-radius: 16px !important;
  padding: 1rem 1.5rem !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  color: rgba(16, 185, 129, 1) !important;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  width: 100% !important;
  height: 48px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  position: relative !important;
  overflow: hidden !important;
}

a[href="/checkout"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

a[href="/checkout"]:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2) !important;
}

a[href="/checkout"] [data-lucide] {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2 !important;
}

/* === EMPTY CART STATE === */
#cart-drawer .my-auto {
  color: rgba(255, 255, 255, 0.7) !important;
  text-align: center !important;
}

#cart-drawer .my-auto [data-lucide] {
  color: rgba(99, 102, 241, 0.8) !important;
  width: 64px !important;
  height: 64px !important;
  margin-bottom: 1.5rem !important;
  stroke-width: 1.5 !important;
}

#cart-drawer .my-auto h4 {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  margin-bottom: 0.75rem !important;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

#cart-drawer .my-auto p {
  font-size: 1rem !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.7) !important;
  line-height: 1.5 !important;
  max-width: 300px !important;
  margin: 0 auto !important;
}

/* === SHIMMER EFFECT === */
#cart-menu-item::after {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.03),
    transparent
  );
  transform: translateX(-100%) translateY(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
  z-index: 2;
}

#cart-menu-item:hover::after {
  transform: translateX(0) translateY(0);
}

/* === LOADING ANIMATION === */
@keyframes cartSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#cart-menu-item {
  animation: cartSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
  #cart-drawer > div {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem !important;
  }

  #cart-drawer h4 {
    font-size: 1.125rem !important;
  }

  #cart-pricing {
    font-size: 1rem !important;
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
  }

  #cart-pricing span {
    font-size: 1.125rem !important;
  }

  a[href="/checkout"] {
    height: 44px !important;
    font-size: 0.875rem !important;
    padding: 0.875rem 1rem !important;
  }

  a[href="/checkout"] [data-lucide] {
    width: 16px !important;
    height: 16px !important;
  }

  #cart-menu-item {
    padding: 0.875rem !important;
    margin-bottom: 0.75rem !important;
  }

  #cart-menu-item img {
    width: 48px !important;
    height: 48px !important;
  }

  #cart-menu-item button {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.8rem !important;
  }

  #cart-menu-item input {
    width: 36px !important;
    height: 28px !important;
    font-size: 0.8rem !important;
  }

  #cart-menu-item .bg-red-500 {
    width: 28px !important;
    height: 28px !important;
  }

  #cart-menu-item [data-lucide] {
    width: 14px !important;
    height: 14px !important;
  }

  #cart-drawer .my-auto [data-lucide] {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 1rem !important;
  }

  #cart-drawer .my-auto h4 {
    font-size: 1.25rem !important;
  }

  #cart-drawer .my-auto p {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  #cart-drawer > div {
    padding: 0.875rem !important;
  }

  #cart-drawer .flex.items-center.justify-between.mb-4 {
    padding-bottom: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  #cart-menu-item {
    padding: 0.75rem !important;
  }

  #cart-menu-item img {
    width: 44px !important;
    height: 44px !important;
  }

  #cart-pricing {
    padding: 0.875rem 1rem !important;
    font-size: 0.95rem !important;
  }

  a[href="/checkout"] {
    height: 40px !important;
    font-size: 0.8rem !important;
    padding: 0.75rem 0.875rem !important;
  }
}

/* === BACKDROP ANIMATION === */
#cart-drawer {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cart-drawer[data-state="open"] {
  opacity: 1 !important;
  visibility: visible !important;
}

/* === PERFORMANCE OPTIMIZATIONS === */
#cart-drawer,
#cart-menu-item,
#cart-pricing,
a[href="/checkout"] {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* === FALLBACK FOR BROWSERS WITHOUT BACKDROP FILTER === */
@supports not (backdrop-filter: blur(1px)) {
  #cart-drawer > div {
    background: rgba(20, 20, 30, 0.95) !important;
  }
  
  #cart-menu-item {
    background: rgba(255, 255, 255, 0.15) !important;
  }
  
  #cart-pricing {
    background: rgba(99, 102, 241, 0.25) !important;
  }
  
  a[href="/checkout"] {
    background: rgba(16, 185, 129, 0.25) !important;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  #cart-drawer,
  #cart-drawer > div,
  #cart-menu-item,
  #cart-pricing,
  a[href="/checkout"] {
    transition: none !important;
    animation: none !important;
  }
}
