/* ============================================================
   NEON READS — Cash on Delivery bookstore (demo)
   Dark + neon theme
   ============================================================ */

:root {
  --bg: #07060f;
  --bg-2: #0d0b1f;
  --panel: rgba(20, 17, 40, 0.72);
  --panel-solid: #14112a;
  --border: rgba(140, 120, 255, 0.18);
  --text: #ECEAFF;
  --muted: #9a93c4;
  --neon: #00f6ff;
  --neon-2: #b14bff;
  --neon-3: #ff3df0;
  --good: #21e6a4;
  --danger: #ff5a7a;
  --radius: 18px;
  --shadow-neon: 0 0 24px rgba(0, 246, 255, 0.35);
  --grad: linear-gradient(120deg, var(--neon), var(--neon-2) 55%, var(--neon-3));
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, #1a0f3a 0%, transparent 55%),
              radial-gradient(900px 600px at -10% 20%, #0a1f3a 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, .logo { font-family: "Sora", sans-serif; }

a { color: inherit; text-decoration: none; }

/* ---------- Animated background orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: float 18s ease-in-out infinite;
}
.orb-1 { width: 380px; height: 380px; background: var(--neon-2); top: -80px; left: -60px; }
.orb-2 { width: 320px; height: 320px; background: var(--neon); bottom: -60px; right: -40px; animation-delay: -6s; }
.orb-3 { width: 260px; height: 260px; background: var(--neon-3); top: 40%; left: 55%; animation-delay: -12s; opacity: 0.35; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 25px) scale(0.95); }
}

/* ---------- Layout helpers ---------- */
section { position: relative; z-index: 1; padding: 84px 24px; max-width: 1180px; margin: 0 auto; }

.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.5px;
}
.section-head p { color: var(--muted); margin-top: 10px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: rgba(7, 6, 15, 0.65);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 8px; }
.logo-mark { color: var(--neon); text-shadow: var(--shadow-neon); animation: pulse 2.4s ease-in-out infinite; }
.logo-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--muted); font-weight: 500; transition: color 0.25s, text-shadow 0.25s; }
.nav a:hover { color: var(--text); text-shadow: 0 0 12px var(--neon); }

.cart-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px; cursor: pointer;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.cart-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-neon); border-color: var(--neon); }
.cart-count {
  position: absolute; top: -7px; right: -7px;
  min-width: 21px; height: 21px; padding: 0 5px;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700; border-radius: 999px;
  background: var(--grad); color: #07060f;
  box-shadow: 0 0 14px var(--neon-3);
  transform: scale(0); transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.cart-count.show { transform: scale(1); }
.cart-count.bump { animation: bump 0.4s; }
@keyframes bump { 0%{transform:scale(1);} 40%{transform:scale(1.5);} 100%{transform:scale(1);} }

/* ---------- Hero ---------- */
.hero { padding-top: 70px; padding-bottom: 40px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-block; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  font-size: 0.78rem; color: var(--neon);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px;
  background: var(--panel);
}
.hero-title { font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: 1.02; margin: 22px 0 18px; letter-spacing: -1.5px; font-weight: 800; }
.glow-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative;
  filter: drop-shadow(0 0 18px rgba(177, 75, 255, 0.55));
}
.hero-sub { color: var(--muted); font-size: 1.12rem; max-width: 560px; margin: 0 auto; }
.hero-sub strong { color: var(--text); }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin: 32px 0 26px; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge {
  font-size: 0.85rem; color: var(--muted);
  background: var(--panel); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Sora", sans-serif; font-weight: 700; font-size: 0.95rem;
  padding: 13px 24px; border-radius: 14px; cursor: pointer; border: none;
  transition: transform 0.2s, box-shadow 0.25s, filter 0.25s; position: relative;
}
.btn-primary { background: var(--grad); color: #07060f; box-shadow: 0 8px 30px rgba(0, 246, 255, 0.25); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 10px 38px rgba(177, 75, 255, 0.45); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--neon); box-shadow: var(--shadow-neon); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ---------- Book grid ---------- */
.book-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.book-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(.2,.7,.3,1), box-shadow 0.3s, border-color 0.3s;
  position: relative; overflow: hidden;
}
.book-card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), rgba(0,246,255,0.14), transparent 70%);
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.book-card:hover { transform: translateY(-8px); border-color: var(--neon); box-shadow: 0 18px 50px rgba(0,0,0,0.5), var(--shadow-neon); }
.book-card:hover::before { opacity: 1; }

.cover {
  aspect-ratio: 3 / 4; border-radius: 12px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 16px;
  box-shadow: inset 0 -60px 60px rgba(0,0,0,0.45);
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.6s;
}
.book-card:hover .cover::after { transform: translateX(120%); }
.cover .spine { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: rgba(0,0,0,0.35); }
.cover .ctitle { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.05rem; line-height: 1.1; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.6); z-index: 1; }
.cover .cauthor { font-size: 0.74rem; color: rgba(255,255,255,0.82); margin-top: 4px; z-index: 1; }

.book-info { padding-top: 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.book-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1rem; }
.book-author { color: var(--muted); font-size: 0.82rem; }
.book-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.stars { color: var(--neon); font-size: 0.8rem; letter-spacing: 1px; }
.tag { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--neon-3); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }

.book-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.price { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.2rem; }
.add-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--panel-solid); color: var(--text); border: 1px solid var(--border);
  font-weight: 700; font-size: 0.85rem; padding: 9px 14px; border-radius: 11px;
  transition: transform 0.2s, background 0.25s, color 0.2s, box-shadow 0.2s;
}
.add-btn:hover { background: var(--grad); color: #07060f; transform: translateY(-2px); box-shadow: var(--shadow-neon); }
.add-btn:active { transform: scale(0.94); }

/* ---------- How it works ---------- */
.steps { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; position: relative;
  transition: transform 0.3s, border-color 0.3s;
}
.step:hover { transform: translateY(-6px); border-color: var(--neon-2); }
.step-num {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad); color: #07060f; font-family: "Sora"; font-weight: 800; font-size: 1.2rem;
  margin-bottom: 16px; box-shadow: 0 0 22px rgba(177,75,255,0.45);
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--border); margin-top: 40px; padding: 48px 24px 28px; background: rgba(7,6,15,0.6); }
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-note { color: var(--muted); font-size: 0.88rem; margin-top: 10px; max-width: 280px; }
.footer-cols { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 0.9rem; }
.copyright { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 32px; }

/* ---------- Cart drawer ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(3, 2, 10, 0.6);
  backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.overlay.show { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed; top: 0; right: 0; z-index: 90; height: 100%; width: min(420px, 92vw);
  background: var(--bg-2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform 0.4s cubic-bezier(.4,0,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.cart-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 1.25rem; }
.icon-btn { background: transparent; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; width: 34px; height: 34px; border-radius: 9px; transition: color 0.2s, background 0.2s; }
.icon-btn:hover { color: var(--text); background: var(--panel); }

.cart-items { flex: 1; overflow-y: auto; padding: 14px 22px; display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 10px;
  animation: slideIn 0.35s ease both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.ci-cover { width: 52px; height: 68px; border-radius: 8px; }
.ci-info { min-width: 0; }
.ci-title { font-family: "Sora"; font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-author { color: var(--muted); font-size: 0.76rem; }
.ci-price { color: var(--neon); font-weight: 700; font-size: 0.85rem; margin-top: 2px; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.qty { display: flex; align-items: center; gap: 8px; background: var(--panel-solid); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.qty button { width: 24px; height: 24px; border: none; background: transparent; color: var(--text); font-size: 1rem; cursor: pointer; border-radius: 6px; transition: background 0.2s; }
.qty button:hover { background: var(--grad); color: #07060f; }
.qty span { min-width: 18px; text-align: center; font-weight: 700; font-size: 0.85rem; }
.ci-remove { background: transparent; border: none; color: var(--muted); font-size: 0.72rem; cursor: pointer; transition: color 0.2s; }
.ci-remove:hover { color: var(--danger); }

.cart-empty { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 6px; padding: 30px; }
.cart-empty span { font-size: 0.85rem; color: var(--neon-2); }
.cart-drawer.empty .cart-empty { display: flex; }
.cart-drawer.empty .cart-items { display: none; }

.drawer-foot { border-top: 1px solid var(--border); padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 9px; }
.totals-row { display: flex; justify-content: space-between; font-size: 0.95rem; }
.totals-row.muted { color: var(--muted); }
.totals-row.muted span:last-child { color: var(--good); font-weight: 700; }
.totals-row.total { font-family: "Sora"; font-weight: 800; font-size: 1.2rem; margin-top: 4px; }
.totals-row.total span:last-child { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.drawer-foot .btn { margin-top: 8px; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 2, 10, 0.72); backdrop-filter: blur(6px);
}
.modal.show { display: flex; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 22px;
  padding: 30px; width: min(520px, 96vw); position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(177,75,255,0.15);
  animation: popUp 0.35s cubic-bezier(.34,1.56,.64,1);
  max-height: 92vh; overflow-y: auto;
}
@keyframes popUp { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-close { position: absolute; top: 16px; right: 16px; }
.modal-title { font-size: 1.6rem; letter-spacing: -0.5px; }
.modal-sub { color: var(--muted); margin-top: 8px; margin-bottom: 22px; }
.modal-sub strong { color: var(--neon); }

/* ---------- COD form ---------- */
.cod-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.optional { color: var(--muted); font-weight: 400; }
input, textarea {
  font-family: "Space Grotesk", sans-serif; font-size: 0.95rem;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
input::placeholder, textarea::placeholder { color: #5e588a; }
input:focus, textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px rgba(0,246,255,0.15); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,90,122,0.15); }
.error { color: var(--danger); font-size: 0.78rem; min-height: 0; opacity: 0; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s; }
.field.invalid .error { opacity: 1; transform: translateY(0); }
.field.shake { animation: shake 0.35s; }
@keyframes shake { 0%,100%{transform:translateX(0);} 20%,60%{transform:translateX(-6px);} 40%,80%{transform:translateX(6px);} }

.pay-summary {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1px dashed var(--neon-2); border-radius: 14px; padding: 14px 16px;
}
.pay-summary span { color: var(--muted); font-size: 0.9rem; }
.pay-summary strong { font-family: "Sora"; font-size: 1.3rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.form-hint { text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: -4px; }

/* ---------- Success ---------- */
.success-card { text-align: center; }
.check-wrap { display: grid; place-items: center; margin-bottom: 8px; }
.check { width: 96px; height: 96px; }
.check-circle { stroke: var(--good); stroke-width: 3; stroke-dasharray: 152; stroke-dashoffset: 152; animation: drawCircle 0.6s ease forwards; }
.check-mark { stroke: var(--good); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: drawMark 0.4s 0.5s ease forwards; }
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawMark { to { stroke-dashoffset: 0; } }
.order-recap { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 18px 0; text-align: left; font-size: 0.9rem; }
.order-recap .recap-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.order-recap .recap-row strong { color: var(--text); }
.order-recap .recap-total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; font-family: "Sora"; font-weight: 800; font-size: 1.05rem; color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: var(--panel-solid); border: 1px solid var(--neon); color: var(--text);
  padding: 13px 20px; border-radius: 13px; z-index: 120; font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--shadow-neon); transition: transform 0.4s cubic-bezier(.34,1.56,.64,1); white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@keyframes pulse { 0%,100%{ text-shadow: 0 0 8px var(--neon); } 50%{ text-shadow: 0 0 22px var(--neon), 0 0 36px var(--neon-2); } }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav { display: none; }
  section { padding: 60px 18px; }
  .field-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
