*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --bg-main: #0d1117;
  --bg-surface: #f6f6f6;
  --bg-panel: #ffffff;

  --text-main: #222222;
  --text-muted: #666666;

  --border-subtle: #b0bec5;
  --border-strong: #666666;

  --accent-primary: #10b981;
  --accent-primary-hover: #0fa371;

  --accent-highlight: #f0c419;
}

body {
  background-color: var(--bg-main);
  font-family: Arial, sans-serif;
  line-height: 1.5;
}

.page {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
  padding-bottom: 2rem;
}

.title {
  color: var(--text-muted);
  text-align: center;
  margin: 2rem 0 1.5rem;
}

.dessert-card-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.dessert-card {
  background-color: var(--bg-surface);
  padding: 1rem;
  text-align: center;
  border-radius: 1rem;
  border: 2px solid var(--border-strong);
}

.dessert-card h2 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.dessert-price {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.product-category {
  margin: 0.5rem 0 1rem;
  color: var(--text-muted);
}

.btn {
  display: block;
  cursor: pointer;
  min-width: 100px;

  color: var(--text-main);
  background: linear-gradient(var(--accent-primary), var(--accent-primary-hover));

  border: 2px solid var(--accent-primary-hover);
  border-radius: 0.5rem;

  padding: 0.4rem 0.75rem;

  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: all 0.15s ease;
}

.btn:hover {
  background: linear-gradient(var(--accent-primary-hover), var(--accent-primary));

  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-highlight);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cart-controls {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.add-to-cart-btn {
  margin: 30px auto 10px;
}

.cart {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;

  background-color: var(--bg-panel);
  color: var(--text-main);

  width: min(100%, 360px);
  min-width: 300px;
  max-height: 500px;
  border-radius: 0.75rem;
  border: 3px solid var(--border-subtle);

  padding: 0.75rem;

  margin-left: -0.75rem;
  margin-right: -0.75rem;

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);

  font-size: 1.2rem;
  overflow-y: auto;
  z-index: 10;

  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.cart-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.cart-header {
  margin-bottom: 0.75rem;
}

.cart-title,
.cart-header {
  text-align: center;
}

.cart-items {
  margin-bottom: 0.75rem;
}

.cart-summary {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 3px solid var(--border-strong);
  text-align: left;
}

.cart-summary p {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

.cart-summary p:last-child {
  font-weight: 700;
  font-size: 1.05rem;

  background-color: var(--accent-highlight);
  border-radius: 0.4rem;

  padding: 0.3rem 0.4rem;

  margin-left: -0.4rem;
  margin-right: -0.4rem;
}

.cart-summary span {
  font-weight: 600;
}

.empty-cart {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.cart-btn {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;

  background-color: var(--accent-highlight);
  color: var(--text-main);

  font-size: 0.75rem;
  font-weight: 700;

  padding: 0.15rem 0.4rem;
  border-radius: 999px;

  min-width: 18px;
  text-align: center;

  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transform: scale(1);
  transition: transform 0.15s ease;
}

.cart-badge:not(.hidden) {
  transform: scale(1.1);
}

.hidden {
  display: none;
}

.cart-closed {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;

  margin: 0.5rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.product-info {
  display: flex;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.product-price {
  font-weight: 600;
  white-space: nowrap;
  margin-left: 0.75rem;
}

.product-name {
  overflow-wrap: anywhere;
  text-align: left;
}

.product-count {
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: 600;
}

.product:last-child {
  border-bottom: none;
}

@media (min-width: 768px) {
  .dessert-card-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .dessert-card-container {
    grid-template-columns: repeat(3, 1fr);
  }
}
