/* MERCIFUL CRUNCHY — Cart & Checkout Page Styles */

/* Cart Container */
#cart-container {
  background: var(--card);
  padding: 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

#cart-container p {
  color: var(--muted);
  font-size: 0.95rem;
}

#cart-container a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

#cart-container a:hover {
  text-decoration: underline;
}

/* Cart Items */
.cart-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-bottom: 1px solid #f3e9e0;
  background: #fafaf9;
  margin-bottom: 8px;
  border-radius: 8px;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.cart-item > div:nth-child(2) {
  flex: 1;
}

.cart-item strong {
  display: block;
  margin-bottom: 4px;
  color: #1f2937;
}

.cart-item .muted {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 8px;
}

.cart-item > div:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--accent);
  min-width: 80px;
}

/* Quantity Controls in Cart */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-controls button {
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-weight: bold;
  transition: all 150ms ease;
  font-size: 0.9rem;
}

.qty-controls button:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.qty-controls span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

/* Checkout Section */
.checkout {
  margin-top: 20px;
  background: var(--card);
  padding: 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.checkout h2 {
  margin-top: 0;
  color: #1f2937;
  font-size: 1.5rem;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 12px;
}

.checkout label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
}

.checkout input,
.checkout textarea {
  margin-bottom: 12px;
}

/* Grid for form fields */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-2 label:nth-child(odd) {
  grid-column: 1;
}

/* Order Summary */
.order-summary {
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px  solid var(--accent); 
  border-right: 4px  solid var(--accent);
  margin-top: 12px;
}

.order-summary p {
  margin: 0;
  color: #374151;
  font-size: 0.95rem;
}

/* Payment Method Selection */
fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  background: #fafaf9;
}

fieldset legend {
  padding: 0 8px;
  font-weight: 700;
  color: #1f2937;
}

fieldset label {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
}

fieldset label:last-child {
  margin-bottom: 0;
}

fieldset input[type="radio"] {
  margin-right: 8px;
  cursor: pointer;
  width: auto;
}

fieldset span {
  flex: 1;
}

/* Form Actions */
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.form-actions button {
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 200ms ease;
}

.form-actions .btn-primary {
  background: var(--accent);
  color: white;
  margin-top: 0;
}

.form-actions .btn-primary:hover {
  background: #b8600d;
  transform: translateY(-2px);
}

.form-actions .btn.buy {
  background: var(--accent);
  color: white;
}

.form-actions .btn.buy:hover {
  background: #b8600d;
  transform: translateY(-2px);
}

/* Order Result */
#order-result {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  display: none;
}

#order-result.visible {
  display: block;
}

#order-result strong {
  color: var(--accent);
}

#order-result em {
  font-weight: 700;
  color: #1f2937;
}

/* Empty Cart Message */
.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.empty-cart p {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.empty-cart a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .checkout {
    padding: 12px;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item img {
    width: 60px;
    height: 50px;
  }

  .cart-item > div:last-child {
    width: 100%;
    margin-top: 8px;
    text-align: left;
  }
}
