.cart-header-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-dark)
  );
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}
.cart-header-btn:hover {
  transform: translateY(-2px);
}
.cart-count {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--color-secondary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  min-width: 1.5rem;
  text-align: center;
}
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  transition:
    visibility 0.4s ease,
    opacity 0.4s ease;
}
.cart-modal.show {
  visibility: visible;
  opacity: 1;
}
.cart-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.cart-panel {
  position: relative;
  width: min(100%, 720px);
  max-height: min(90dvh, 760px);
  background: var(--color-surface);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  transition:
    transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.4s ease;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 212, 255, 0.1);
}
.cart-modal.show .cart-panel {
  transform: translateY(0) scale(1);
}
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.3rem;
  border-bottom: 1px solid var(--color-border);
  background: rgba(0, 212, 255, 0.05);
}
.cart-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}
.cart-title i {
  color: var(--color-primary);
}
.cart-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-full);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-close:hover {
  background: var(--color-secondary);
  color: #fff;
}
.cart-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  overscroll-behavior: contain;
}
.cart-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
}
.cart-empty i {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  opacity: 0.3;
}
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}
.cart-item:hover {
  background: rgba(0, 212, 255, 0.05);
  border-color: rgba(0, 212, 255, 0.3);
}
.cart-item-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.cart-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.cart-item-details {
  flex: 1;
  min-width: 0;
}
.cart-item-name {
  font-weight: 600;
  margin-bottom: 0.2rem;
  overflow-wrap: anywhere;
}
.cart-item-price {
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.quantity-btn {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quantity-display {
  min-width: 1.2rem;
  text-align: center;
  font-weight: 600;
}
.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--color-secondary);
  cursor: pointer;
}
.cart-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--color-border);
  background: rgba(0, 212, 255, 0.03);
}
.checkout-form {
  margin-bottom: 0.8rem;
}
.form-title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.form-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}
.form-input.full-width {
  grid-column: 1 / -1;
}
.coupon-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.coupon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
}
.btn-apply-coupon,
.btn-clear-coupon {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-apply-coupon {
  background: rgba(0, 212, 255, 0.12);
  color: var(--color-primary);
  border-color: rgba(0, 212, 255, 0.3);
}
.btn-apply-coupon:hover {
  background: rgba(0, 212, 255, 0.2);
}
.btn-clear-coupon {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}
.btn-clear-coupon:hover {
  background: rgba(255, 255, 255, 0.12);
}
.coupon-status {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-text-muted, #9fb3c8);
}
.coupon-status.is-success {
  color: var(--color-tertiary);
}
.coupon-status.is-error {
  color: var(--color-secondary);
}
.coupon-status.is-info {
  color: var(--color-primary);
}
.cart-summary {
  margin: 0.6rem 0 0.8rem;
}
.summary-row,
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0;
}
.summary-total {
  border-top: 1px solid var(--color-border);
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  font-weight: 700;
}
.summary-note {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(219, 234, 254, 0.72);
}
.cart-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-checkout {
  flex: 1;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-dark)
  );
  color: #fff;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-clear {
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
}
@media (max-width: 768px) {
  .cart-modal {
    padding: 0.5rem;
  }
  .cart-panel {
    width: 100%;
    max-height: calc(100dvh - 1rem);
    border-radius: 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .coupon-row {
    grid-template-columns: 1fr;
  }
  .cart-actions {
    flex-direction: column;
  }
  .btn-checkout,
  .btn-clear {
    width: 100%;
  }
}
