/* ====================================
   CART & CHECKOUT STYLESHEET
==================================== */
:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --border: #334155;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 60px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  padding: 16px 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.brand i { color: var(--primary); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--text-main); }

/* Main Grid */
.cart-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 24px;
}

.cart-container h1 {
  font-size: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* Cards & Sections */
.cart-card, .summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.cart-card h2, .summary-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Items List */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-dark);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.cart-item-img {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
}

.cart-item-details {
  flex: 1;
}

.cart-item-details h4 {
  font-size: 14px;
  font-weight: 600;
}

.cart-item-price {
  font-size: 13px;
  color: var(--text-muted);
}

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

.qty-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover { background: var(--border); }

.remove-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

/* Form Styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}

textarea { height: 80px; resize: vertical; }

/* Summary & Promo */
.promo-box {
  margin-bottom: 16px;
}

.promo-input-group {
  display: flex;
  gap: 8px;
}

.promo-input-group input {
  flex: 1;
  text-transform: uppercase;
}

.promo-input-group button {
  background: var(--border);
  color: var(--text-main);
  border: none;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.promo-input-group button:hover { background: #475569; }

.promo-status {
  font-size: 12px;
  margin-top: 6px;
}

.promo-status.success { color: var(--success); }
.promo-status.error { color: var(--danger); }

.summary-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.summary-row span:last-child { color: var(--text-main); font-weight: 500; }

.discount-row span { color: var(--success) !important; }

.total-row {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.checkout-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  transition: background 0.2s;
}

.checkout-btn:hover { background: var(--primary-hover); }

.secure-text {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Success Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: 16px;
  max-width: 480px;
  text-align: center;
}

.modal-icon {
  font-size: 48px;
  color: var(--success);
  margin-bottom: 12px;
}

.modal-card h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.modal-card .highlight-text {
  background: var(--bg-dark);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.modal-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

@media (max-width: 850px) {
  .cart-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}