/* ROOT */
.cart-dd-root {
  position: relative;
}

/* BUTTON */
.cart-dd-button {
  position: relative;
  padding: 0.5rem;
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cart-dd-button:hover {
  background: linear-gradient(to right, #fee2e2, #fff);
}

.cart-dd-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* BADGE */
.cart-dd-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: #dc2626;
  color: white;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  min-width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= MOBILE ================= */

.cart-dd-mobile {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-dd-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.cart-dd-mobile-box {
  position: relative;
  background: white;
  width: 92%;
  max-width: 24rem;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 0.75rem;
  padding: 1rem;
  z-index: 51;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* ================= DESKTOP ================= */

.cart-dd-desktop {
  position: absolute;
  right: 0;
  margin-top: 0.5rem;
  width: 24rem;
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  z-index: 40;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-height: 80vh;
  overflow-y: auto;
}

/* Hide desktop dropdown on mobile */
@media (max-width: 767px) {
  .cart-dd-desktop {
    display: none;
  }
}

/* Hide mobile modal on desktop */
@media (min-width: 768px) {
  .cart-dd-mobile {
    display: none;
  }
}

/* HEADER */
.cart-dd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.cart-dd-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
}

.cart-dd-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #6b7280;
}

.cart-dd-close:hover {
  color: #111827;
}

/* EMPTY */
.cart-dd-empty {
  text-align: center;
  color: #6b7280;
  padding: 1rem 0;
}

/* LIST */
.cart-dd-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ITEM */
.cart-dd-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.cart-dd-item:last-child {
  border-bottom: none;
}

.cart-dd-item-img {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 0.5rem;
}

.cart-dd-item-info {
  flex: 1;
  min-width: 0;
}

.cart-dd-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-dd-item-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.cart-dd-item-price {
  font-weight: 600;
  color: #111827;
  align-self: flex-end;
  white-space: nowrap;
}

/* ACTIONS */
.cart-dd-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cart-dd-btn-primary {
  flex: 1;
  background: #000;
  color: white;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s ease;
}

.cart-dd-btn-primary:hover {
  background: #111;
}

.cart-dd-btn-secondary {
  flex: 1;
  background: white;
  border: 1px solid #d1d5db;
  color: #111827;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.25s ease;
}

.cart-dd-btn-secondary:hover {
  background: #e5e7eb;
}
