/* ── Variables ── */
:root {
  --brand:      #062a42;
  --accent:     #00aaff;
  --accent2:    #0077cc;
  --danger:     #ff4d4d;
  --warn:       #ffaa00;
  --bg:         #f0f4f8;
  --card:       #ffffff;
  --border:     #e2e8f0;
  --text:       #1a2b3c;
  --muted:      #6b7f91;
  --radius:     14px;
  --shadow:     0 8px 32px rgba(6,42,66,.10);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Layout ── */
.page-wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding: 160px 20px 60px;
}

/* ── Cart Section ── */
.cart-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
}

h1 {
  font-family: "Playfair Display", serif;
  font-size: 2.4rem;
  color: var(--brand);
  text-align: center;
  margin-bottom: 36px;
  letter-spacing: -.5px;
}

/* ── Empty ── */
.empty-cart {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-cart svg {
  width: 72px; height: 72px;
  margin-bottom: 16px;
  opacity: .4;
}

/* ── Cart List ── */
.cart-list { margin-bottom: 0; }

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.cart-item:hover { background: rgba(0,170,255,.03); }

.cart-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.item-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .85rem;
  color: var(--muted);
}
.item-meta em { font-style: normal; font-weight: 500; color: var(--text); }

.item-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent2);
  margin-top: 4px;
}

/* ── Cart Controls ── */
.cart-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.qty-form {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px 8px;
}

.btn-qty {
  width: 28px; height: 28px;
  border: none;
  border-radius: 6px;
  background: var(--card);
  color: var(--brand);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  transition: background .2s, transform .1s;
}
.btn-qty:hover { background: var(--accent); color: #fff; transform: scale(1.1); }

.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: .95rem;
  color: var(--brand);
}

.btn-delete {
  background: transparent;
  border: 1px solid #ffcdd2;
  color: var(--danger);
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-delete:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── Total ── */
.cart-total {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 20px 0 28px;
  font-size: 1.15rem;
  color: var(--muted);
  font-weight: 500;
}
.cart-total strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand);
  font-family: "Playfair Display", serif;
}

/* ── Divider ── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 32px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Checkout Form ── */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.form-group input {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .97rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  width: 100%;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,170,255,.15);
  background: #fff;
}
.form-group input::placeholder { color: #aab4be; }

/* Input con botón random */
.input-with-action {
  position: relative;
  display: flex;
}
.input-with-action input {
  padding-right: 44px;
}
.btn-random {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
  width: 28px; height: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
  font-weight: 700;
}
.btn-random:hover { background: var(--accent2); transform: translateY(-50%) rotate(180deg); }

/* Demo Banner */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .85rem;
  color: #92400e;
}
.demo-banner svg { width: 18px; height: 18px; flex-shrink: 0; fill: #f59e0b; }

/* Botón principal */
.btn-order {
  padding: 16px 32px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background .25s, transform .15s, box-shadow .25s;
  box-shadow: 0 4px 16px rgba(6,42,66,.25);
  align-self: stretch;
  margin-top: 4px;
}
.btn-order:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,170,255,.3);
}
.btn-order:active { transform: translateY(0); }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6,42,66,.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 52px 48px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  animation: modalIn .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #00d4aa, #00aaff);
  color: #fff;
  font-size: 2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(0,170,255,.35);
}

.modal h2 {
  font-family: "Playfair Display", serif;
  color: var(--brand);
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.modal p { color: var(--muted); margin-bottom: 28px; line-height: 1.6; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 2;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .cart-section { padding: 28px 20px; }
  h1 { font-size: 1.8rem; }
  .cart-item { flex-direction: column; align-items: flex-start; }
  .cart-controls { flex-direction: row; width: 100%; justify-content: space-between; }
  .form-row.two-col { grid-template-columns: 1fr; }
}
/* ── Alert error ── */
.alert-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  border-radius: 10px;
  padding: 14px 18px;
  color: #c62828;
  font-size: .9rem;
  margin-bottom: 24px;
}
.alert-error svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Order confirmed ── */
.order-confirmed {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.confirmed-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #00d4aa, #00aaff);
  color: #fff;
  font-size: 2.2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,170,255,.35);
}
.order-confirmed h2 {
  font-family: "Playfair Display", serif;
  color: var(--brand);
  font-size: 1.8rem;
}
.order-confirmed p { color: var(--muted); line-height: 1.6; }