:root {
  --bg:#0f1724; --card:#081328; --accent:#783be1; --muted:#c2c6c1; 
  --glass: rgba(255,255,255,0.03);
  --success:#10b981; --danger:#ef4444;
  --maxw:1200px; --radius:12px;
  font-family: Inter, ui-sans-serif, system-ui;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #071025 0%, #071727 100%);
  color: #e6eef8;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 20px; }
header {
  background: var(--card);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-size: 20px; font-weight: 600; }
nav ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
nav a { color: #faf9f9; text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--accent); }

.search-bar { margin: 16px 0; display: flex; gap: 10px; }
.search-bar input {
  flex: 1; padding: 10px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.05); color: white;
}
.search-bar button {
  padding: 10px 14px; border: none; border-radius: 8px;
  background: var(--accent); color: white; cursor: pointer;
}

.layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
@media (max-width:900px) { .layout { grid-template-columns: 1fr; } .cart { order: 2; } }

.products { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 18px; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: var(--radius); padding: 14px;
}
.cover {
  height: 160px; border-radius: 8px; background-size: cover;
  background-position: center; margin-bottom: 12px;
}
.book-title { font-weight: 600; margin: 0 0 6px 0; }
.author { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.price-row { display: flex; justify-content: space-between; align-items: center; }
button.add {
  background: var(--accent); border: none; padding: 8px 12px;
  border-radius: 8px; color: white; cursor: pointer;
}

.cart {
  background: var(--card); padding: 14px; border-radius: var(--radius);
  height: fit-content;
}
.cart h3 { margin: 0 0 12px 0; }
.cart-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 420px; overflow: auto; padding-right: 6px;
}
.cart-item { display: flex; gap: 10px; align-items: center; }
.thumb { width: 58px; height: 72px; background-size: cover; border-radius: 6px; }
.ci-meta { flex: 1; }
.ci-meta h4 { margin: 0; font-size: 14px; }
.qty { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.qty button {
  width: 28px; height: 28px; border-radius: 6px;
  border: none; background: var(--glass); color: var(--muted); cursor: pointer;
}
.remove { background: transparent; border: none; color: var(--danger); cursor: pointer; }

.summary {
  border-top: 1px dashed rgba(255,255,255,0.03);
  padding-top: 12px; margin-top: 12px;
}
.row { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); }
.total { font-weight: 700; font-size: 18px; }
.checkout {
  width: 100%; padding: 10px; border-radius: 10px;
  border: none; background: linear-gradient(90deg, var(--accent), #5b21b6);
  color: white; font-weight: 600; cursor: pointer;
}
footer { margin-top: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* Payment modal */
.modal {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%; background: rgba(0,0,0,0.8);
  justify-content: center; align-items: center; z-index: 200;
}
.modal-content {
  background: #222; padding: 30px 20px; border-radius: 12px;
  width: 350px; text-align: center; color: #f5f5f5; position: relative;
}
.modal-content h2 { margin-bottom: 20px; }
.modal-content select, .modal-content button {
  width: 100%; padding: 12px; margin-top: 10px; border-radius: 8px;
  border: 1px solid #444; font-size: 16px; background: #1c1c1c; color: #f5f5f5;
}
.modal-content button { background: var(--accent); color: #fff; border: none; cursor: pointer; }
.modal-content button:hover { background: #5a31b0; }
.close {
  position: absolute; top: 10px; right: 15px;
  background: red; color: #fff; border: none; padding: 5px 10px;
  border-radius: 50%; font-weight: bold; cursor: pointer;
}
