* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

.container {
  width: 100%;
  min-height: 100vh;
  padding: 30px 20px;
}

.app-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0 0 8px 0;
}

.page-header p {
  margin: 0;
  color: #64748b;
}

.checkout-link,
.checkout-button,
.primary-button {
  display: inline-block;
  text-decoration: none;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 16px;
}

.checkout-link:hover,
.checkout-button:hover,
.primary-button:hover {
  background: #1d4ed8;
}

.products-section,
.cart-section,
.checkout-section,
.order-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 24px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.product-image {
  height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  margin-bottom: 14px;
}

.product-card h3 {
  margin: 0 0 6px 0;
}

.product-card p {
  margin: 6px 0;
  color: #475569;
}

.product-price {
  font-size: 20px;
  font-weight: bold;
  color: #0f172a;
}

.cart-header,
.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

#clearCartBtn,
.remove-btn,
.secondary-button {
  border: none;
  background: #ef4444;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

#clearCartBtn:hover,
.remove-btn:hover,
.secondary-button:hover {
  background: #dc2626;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  flex-wrap: wrap;
}

.cart-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-item-emoji {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.cart-item-info h4 {
  margin: 0 0 6px 0;
}

.cart-item-info p {
  margin: 0;
  color: #64748b;
}

.cart-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

.quantity-btn:hover {
  background: #cbd5e1;
}

.cart-summary {
  margin-top: 20px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.cart-summary p,
.order-summary p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.total-row {
  font-size: 20px;
  font-weight: bold;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.form-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.form-card h2 {
  margin-top: 0;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.order-summary {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  align-self: start;
}

.order-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #475569;
}

.success-message {
  text-align: center;
  padding: 40px 20px;
}

.success-message h2 {
  margin-top: 0;
}

.empty-message {
  text-align: center;
  color: #64748b;
  padding: 20px 0;
}

.hidden {
  display: none;
}

@media (max-width: 820px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 20px 14px;
  }

  .products-section,
  .cart-section,
  .checkout-section,
  .order-section,
  .form-card,
  .order-summary {
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cart-item {
    align-items: flex-start;
  }

  .cart-item-right {
    width: 100%;
    justify-content: space-between;
  }

  .checkout-link,
  .checkout-button,
  .primary-button,
  #clearCartBtn,
  .secondary-button {
    width: 100%;
    text-align: center;
  }
}