/* ============================================================
   Digital Book Store — Main Stylesheet
   ============================================================ */

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

:root {
  --dark:    #0f0f1a;
  --dark2:   #1a1a2e;
  --accent:  #e94560;
  --accent2: #f5a623;
  --text:    #e0e0e0;
  --muted:   #888;
  --card-bg: #16213e;
  --radius:  12px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
}

/* -------- NAVBAR -------- */
.navbar {
  background: var(--dark2);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.navbar .brand span { color: var(--accent); }
.nav-badge {
  background: var(--accent);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* -------- HERO -------- */
.hero {
  background: linear-gradient(135deg, var(--dark2) 0%, #0d2137 100%);
  padding: 80px 40px;
  text-align: center;
  border-bottom: 1px solid #ffffff10;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 30px;
}
.hero-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge {
  background: #ffffff10;
  border: 1px solid #ffffff20;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text);
}
.badge .icon { margin-right: 4px; }

/* -------- SECTION TITLE -------- */
.section-title {
  text-align: center;
  padding: 50px 20px 30px;
  font-size: 1.8rem;
  font-weight: 800;
}
.section-title span { color: var(--accent); }

/* -------- BOOK GRID -------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  padding: 0 40px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

/* -------- BOOK CARD -------- */
.book-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #ffffff10;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(233,69,96,0.2);
}

.book-cover {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: linear-gradient(135deg, #1a1a3e, #0d2137);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  min-height: 200px;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover-placeholder {
  font-size: 4rem;
  width: 100%;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a3e 0%, #0d2137 100%);
}

.book-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.book-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent2);
  margin-bottom: 8px;
}
.book-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.3;
}
.book-author {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.book-desc {
  font-size: 0.88rem;
  color: #aaa;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 16px;
}
.book-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.book-meta span { display: flex; align-items: center; gap: 4px; }

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid #ffffff10;
  background: #0f1a2e;
}
.book-price {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
}
.book-price small {
  font-size: 0.7rem;
  color: var(--muted);
  display: block;
  font-weight: 400;
}

/* -------- BUTTONS -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s, transform 0.15s;
}
.btn:hover { opacity: 0.88; transform: scale(1.02); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

/* -------- MODAL -------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  border: 1px solid #ffffff15;
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  background: var(--dark2);
  padding: 20px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.2rem; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-body { padding: 24px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #ccc;
}
.form-group input {
  width: 100%;
  background: #0f1a2e;
  border: 1px solid #ffffff20;
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

.order-summary {
  background: #0f1a2e;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid #ffffff10;
}
.order-summary .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 4px 0;
  color: #aaa;
}
.order-summary .row.total {
  border-top: 1px solid #ffffff15;
  margin-top: 8px;
  padding-top: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.pay-method-tag {
  background: #0f1a2e;
  border: 1px solid #ffffff15;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.btn-pay {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 1.05rem;
}

/* -------- SUCCESS / ERROR PAGES -------- */
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  border: 1px solid #ffffff10;
}
.result-icon { font-size: 4rem; margin-bottom: 20px; }
.result-card h2 { font-size: 1.8rem; margin-bottom: 12px; }
.result-card p { color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.result-card .order-ref {
  background: #0f1a2e;
  border-radius: 8px;
  padding: 10px;
  font-family: monospace;
  font-size: 1rem;
  color: var(--accent2);
  margin: 16px 0;
}
.delivery-chips {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0;
  flex-wrap: wrap;
}
.chip {
  background: #0f1a2e;
  border: 1px solid #ffffff15;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip.success { border-color: #2ecc71; color: #2ecc71; }
.chip.pending { border-color: var(--accent2); color: var(--accent2); }

/* -------- FOOTER -------- */
footer {
  background: var(--dark2);
  border-top: 1px solid #ffffff10;
  padding: 30px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
footer a { color: var(--accent); text-decoration: none; }

/* -------- RESPONSIVE -------- */
@media (max-width: 600px) {
  .navbar { padding: 14px 16px; }
  .hero   { padding: 50px 16px; }
  .books-grid { padding: 0 16px 50px; gap: 18px; }
  .result-card { padding: 28px 18px; }
}
