:root {
  --shop-primary: #6366F1;
  --shop-primary-dark: #4F46E5;
  --shop-primary-light: #818CF8;
  --shop-secondary: #3B82F6;
  --shop-secondary-dark: #2563EB;
  --shop-secondary-light: #60A5FA;
  --shop-bg-main: #F8FAFC;
  --shop-bg-card: #FFFFFF;
  --shop-bg-alt: #F1F5F9;
  --shop-text-primary: #0F172A;
  --shop-text-secondary: #64748B;
  --shop-text-muted: #94A3B8;
  --shop-border-subtle: #E2E8F0;
  --shop-shadow-medium: 0 10px 30px -4px rgba(99, 102, 241, 0.12);
  --shop-badge-accent: #EEF2FF;
  --shop-badge-text: #4F46E5;
}

.custom-cart-modal .modal-dialog {
  max-width: 540px;
  width: 92%;
  margin: 1.75rem auto;
}

.custom-modal-content {
  background: var(--shop-bg-card);
  border: 1px solid var(--shop-border-subtle);
  border-radius: 20px;
  box-shadow: var(--shop-shadow-medium);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.custom-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--shop-border-subtle);
  background: var(--shop-bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--shop-badge-accent);
  color: var(--shop-badge-text);
  border-radius: 10px;
}

.custom-modal-header .modal-title {
  color: var(--shop-text-primary);
  font-size: 1.15rem;
  margin: 0;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--shop-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

.btn-close-modal:hover {
  color: var(--shop-text-primary);
}

.custom-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 200px);
  background: var(--shop-bg-main);
}

.cart-modal-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--shop-bg-card);
  border: 1px solid var(--shop-border-subtle);
  border-radius: 14px;
  margin-bottom: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-modal-item:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
}

.cart-modal-item-img-wrapper {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 10px;
  background: var(--shop-bg-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--shop-border-subtle);
}

.cart-modal-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.cart-modal-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--shop-text-primary);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-modal-item-price-unit {
  font-size: 0.8rem;
  color: var(--shop-text-secondary);
  margin-bottom: 0.5rem;
}

.cart-modal-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-modal-qty-control {
  display: inline-flex;
  align-items: center;
  background: var(--shop-bg-alt);
  border: 1px solid var(--shop-border-subtle);
  border-radius: 8px;
  padding: 2px 4px;
}

.btn-qty-decrease,
.btn-qty-increase {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shop-text-primary);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.btn-qty-decrease:hover,
.btn-qty-increase:hover {
  background: #E2E8F0;
}

.cart-modal-qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--shop-text-primary);
}

.btn-cart-remove {
  background: transparent;
  border: none;
  color: var(--shop-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.btn-cart-remove:hover {
  color: #EF4444;
}

.cart-modal-item-total {
  font-weight: 700;
  color: var(--shop-text-primary);
  font-size: 0.95rem;
  white-space: nowrap;
}

.cart-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}

.cart-empty-icon {
  color: var(--shop-text-muted);
  margin-bottom: 0.75rem;
}

.cart-empty-text {
  color: var(--shop-text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.custom-modal-footer {
  padding: 1.25rem 1.5rem;
  background: var(--shop-bg-card);
  border-top: 1px solid var(--shop-border-subtle);
}

.cart-total-row {
  font-size: 1.05rem;
}

.cart-subtotal-label {
  color: var(--shop-text-secondary);
  font-weight: 500;
}

.cart-subtotal-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--shop-primary-dark);
}

.btn-continue-shopping {
  background: var(--shop-bg-alt);
  color: var(--shop-text-primary);
  border: 1px solid var(--shop-border-subtle);
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.btn-continue-shopping:hover {
  background: #E2E8F0;
  color: var(--shop-text-primary);
}

.btn-go-to-cart {
  background: linear-gradient(135deg, var(--shop-primary), var(--shop-secondary));
  color: #FFFFFF !important;
  border: none;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-go-to-cart:hover {
  background: linear-gradient(135deg, var(--shop-primary-dark), var(--shop-secondary-dark));
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.shop-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-toast-item {
  background: #0F172A;
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-15px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.shop-toast-item.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.shop-toast-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-toast-content svg {
  color: #34D399;
}

@media (max-width: 576px) {
  .custom-cart-modal .modal-dialog {
    margin: 0.75rem auto;
    width: 95%;
  }
  .custom-modal-content {
    max-height: 92vh;
  }
  .custom-modal-body {
    max-height: calc(92vh - 210px);
    padding: 1rem;
  }
  .cart-modal-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  .cart-modal-item-img-wrapper {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }
}