/* === components.css — Yalla Books reusable components === */

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--color-ink);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active { transform: scale(0.98); }

.btn-primary  { background: var(--color-ink);     color: #fff; }
.btn-primary:hover  { background: #000020; color: #fff; }

.btn-secondary { background: var(--color-primary); color: #fff; }
.btn-secondary:hover { background: var(--color-primary-hover); color: #fff; }

.btn-ghost { background: var(--color-surface); color: var(--color-ink); }
.btn-ghost:hover { background: var(--color-surface-alt); }

.btn-block { display: block; width: 100%; }

/* Icon-only add-to-cart circle */
.btn-add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-bg);
  border: 1px solid var(--color-ink);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  line-height: 1;
  transition: background 0.15s;
}
.btn-add:hover { background: var(--color-primary); border-color: var(--color-primary); }

/* ── Inputs ─────────────────────────────────────────────── */
.input-pill {
  background: var(--color-surface);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-ink);
  outline: none;
  transition: box-shadow 0.15s;
}
.input-pill:focus {
  box-shadow: 0 0 0 2px var(--color-primary);
}
.input-pill::placeholder { color: var(--color-muted); }

/* ── Book card ──────────────────────────────────────────── */
.book {
  background: var(--color-surface);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-md);
  padding: 10px;
  position: relative;
  transition: transform 0.2s;
}
.book:hover { transform: translateY(-2px); }

.book-cover {
  aspect-ratio: 3/4;
  border: 1px solid var(--color-ink);
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Cover accent colors — rotate across grid */
.bc-peach  { background: var(--color-peach);  }
.bc-mint   { background: var(--color-mint);   }
.bc-butter { background: var(--color-butter); }
.bc-sky    { background: var(--color-sky);    }
.bc-blush  { background: var(--color-blush);  }

.book-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 2px;
  min-height: 36px;
}
html[lang="en"] .book-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 14px;
  min-height: 34px;
}

.book-author {
  font-size: 11px;
  color: var(--color-muted);
  margin: 0 0 8px;
  font-family: 'DM Sans', system-ui, sans-serif;
}
html[lang="ar"] .book-author { font-family: var(--font-body-ar); }

.book-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.book-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary);
  font-family: 'DM Sans', system-ui, sans-serif;
}
html[lang="ar"] .book-price { font-family: var(--font-body-ar); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  background: var(--color-ink);
  color: var(--color-butter);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.4;
}
.badge.new { background: var(--color-primary); color: #fff; }

/* ── Book grid ──────────────────────────────────────────── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

/* ── Section header ─────────────────────────────────────── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0;
}
html[lang="en"] .section-title { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; }

.dot-mark { color: var(--color-primary); }

.section-more {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.5px;
  text-decoration: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  white-space: nowrap;
}
html[lang="en"] .section-more { text-transform: uppercase; }

/* ── Pills / tags ───────────────────────────────────────── */
.pill {
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--color-ink);
  display: inline-block;
}
.pill-ink    { background: var(--color-ink);    color: var(--color-butter); }
.pill-orange { background: var(--color-primary); color: #fff; border-color: var(--color-ink); }
.pill-butter { background: var(--color-butter); color: var(--color-ink); }

/* ── Responsive book grid ───────────────────────────────── */
@media (max-width: 900px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Status pills (public) ──────────────────────────────── */
.pill--green  { background: #d4f0d4; border-color: #2e7d5b; color: #1a5c3a; }
.pill--red    { background: #ffd9cc; border-color: #b83535; color: #8b1a1a; }
.pill--amber  { background: #fff3cc; border-color: #b87a2e; color: #7a4f00; }
.pill--blue   { background: #cce8ff; border-color: #1a5fa8; color: #0d3d7a; }

/* ── Account page ───────────────────────────────────────── */
.account-wrap {
  max-width: 780px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}
.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-ink);
}
.account-name { font-size: 1.75rem; font-weight: 800; margin-bottom: .3rem; }
.account-meta { color: var(--color-muted); font-size: .9rem; }
.account-meta-sep { margin: 0 .4rem; }

.account-section {
  background: #fff;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.account-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.account-section-title { font-size: 1rem; font-weight: 700; }

/* ── Orders list ────────────────────────────────────────── */
.orders-list { display: flex; flex-direction: column; gap: .75rem; }
.order-card {
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.1rem;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-ink);
  gap: 1rem;
}
.order-number { font-weight: 800; font-size: .95rem; margin-inline-end: .75rem; }
.order-date   { color: var(--color-muted); font-size: .82rem; }
.order-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.order-total { font-size: .9rem; }
.order-total strong { font-size: 1rem; margin-inline-start: .4rem; }
.order-pills { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Order detail ───────────────────────────────────────── */
.order-detail-header { margin-bottom: 1.5rem; }
.order-items-list { display: flex; flex-direction: column; gap: .875rem; margin-bottom: 1.25rem; }
.order-item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.order-totals {
  border-top: 1px solid var(--color-ink);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.order-total-row {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
}
.order-total-row--grand {
  font-weight: 800;
  font-size: 1.05rem;
  padding-top: .5rem;
  border-top: 1px solid var(--color-ink);
  margin-top: .25rem;
}
.instapay-box {
  background: var(--color-cream);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
