.light {
  --bg: #fff;
  --bg-alt: #f5f5f5;
  --text: #333;
  --text-muted: #666;
  --shadow: rgba(0, 0, 0, 0.1);
}

.dark {
  --bg: #2a2a2a;
  --bg-alt: #333;
  --text: #eee;
  --text-muted: #aaa;
  --shadow: rgba(0, 0, 0, 0.3);
}

.container,
.checkout {
  --accent: mediumseagreen;
  --accent-text: #fff;
  display: flex;
  flex-direction: column;
  font-family: sans-serif;
}

.carousel {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.product-wrapper {
  flex: 0 0 150px;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-card {
  background: var(--bg);
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.product-card.selected {
  outline: 2px solid var(--accent);
}

.product-image {
  width: 100%;
  height: 100px;
  object-fit: contain;
  background: var(--bg-alt);
  padding: 0.5rem;
  box-sizing: border-box;
  border-radius: 8px 8px 0 0;
}

.product-info {
  padding: 0.5rem;
}

.product-title {
  font-size: 0.75rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  font-size: 0.875rem;
  font-weight: bold;
  color: var(--accent);
  margin-top: 0.25rem;
}

.product-detail {
  margin: 0 1rem 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

.detail-title {
  font-weight: bold;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.detail-rating {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.detail-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.message {
  margin: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
  color: var(--text-muted);
  text-align: center;
}

.cart-indicator {
  padding: 0.5rem 1rem;
  align-self: flex-end;
  color: var(--accent-text);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 1rem;
}

.cart-indicator:disabled {
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: default;
}

.cart-button {
  padding: 0.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
}

.cart-button.in-cart {
  background: var(--bg-alt);
  color: var(--text-muted);
}

.checkout {
  gap: 1rem;
  padding: 1.25rem;
}

.checkout-title {
  font-weight: bold;
  font-size: 1rem;
  color: var(--text);
}

.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text);
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  color: var(--text);
  border-top: 1px solid var(--bg-alt);
  padding-top: 0.5rem;
}

.checkout-button {
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: bold;
}

.checkout-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.checkout-button.polling {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Success card */

.success-card {
  --success: #248a52;
  --success-bg: #edf8f2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1.25rem 1.25rem;
  background: var(--success-bg);
  border-radius: 12px;
}

.dark .success-card {
  --success: #4cd68a;
  --success-bg: #162e22;
}

.success-icon {
  color: var(--success);
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-header {
  text-align: center;
  margin-bottom: 0.25rem;
}

.success-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--success);
}

.success-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.success-divider {
  width: 100%;
  height: 1px;
  background: var(--success);
  opacity: 0.15;
}

.success-items {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.25rem 0;
}

.success-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--text);
}

.success-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 0.75rem;
}

.success-item-price {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.success-total {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--success);
}

.checkout-status {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 8px;
}

.checkout-status.expired {
  color: #b45309;
  background: #fef3c7;
}

.dark .checkout-status.expired {
  color: #fbbf24;
  background: #3a2a1a;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-text);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
