/* BookNookStealz — shared stylesheet
   Colors: cream #FAF7F2 | navy #2C3E6B | gold #C9973A | green #3D6B4F
   Fonts: Playfair Display (headings) + Lato (body)
*/

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background: #FAF7F2;
  color: #2C2C2C;
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  color: #2C3E6B;
}

a { color: #C9973A; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2C3E6B;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 2px 8px rgba(44,62,107,0.2);
}

.topnav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #FAF7F2;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.topnav-brand:hover { text-decoration: none; color: #C9973A; }

.topnav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.topnav-links a {
  color: #D4C9B8;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}
.topnav-links a:hover { color: #C9973A; text-decoration: none; }

.topnav-links .tg-icon {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #C9973A;
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.topnav-links .tg-icon:hover { background: #b08330; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #2C3E6B 0%, #3D6B4F 100%);
  color: #FAF7F2;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #FAF7F2;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-tagline {
  font-size: 1.15rem;
  color: #C9D8B6;
  margin-bottom: 2rem;
  font-style: italic;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn-primary {
  background: #C9973A;
  color: #fff;
}
.btn-primary:hover { background: #b08330; color: #fff; }

.btn-outline {
  background: transparent;
  border: 2px solid #C9973A;
  color: #C9973A;
}
.btn-outline:hover { background: #C9973A; color: #fff; }

.btn-large {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

/* ── Section layout ───────────────────────────────────────────────────────── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ── Category cards (homepage) ────────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.category-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.75rem;
  box-shadow: 0 2px 12px rgba(44,62,107,0.08);
  text-align: center;
  border-top: 4px solid #C9973A;
  transition: box-shadow 0.2s, transform 0.2s;
}
.category-card:hover {
  box-shadow: 0 6px 24px rgba(44,62,107,0.14);
  transform: translateY(-3px);
}

.category-card .card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.category-card p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ── Book cards grid ──────────────────────────────────────────────────────── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.book-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(44,62,107,0.08);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.book-card:hover {
  box-shadow: 0 6px 20px rgba(44,62,107,0.14);
  transform: translateY(-3px);
}

.book-card .cover-wrap {
  background: #EDE8DF;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.book-card .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card .cover-placeholder {
  font-size: 3rem;
  color: #C9973A;
}

.book-card .book-info {
  padding: 0.85rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.book-card .book-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2C3E6B;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card .book-author {
  font-size: 0.78rem;
  color: #888;
  font-style: italic;
}

.book-card .price-badge {
  display: inline-block;
  background: #C9973A;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: auto;
  align-self: flex-start;
}

.book-card .btn {
  margin-top: 0.6rem;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  padding: 0.5rem;
}

/* ── Genre section ────────────────────────────────────────────────────────── */
.genre-section {
  margin-bottom: 3rem;
}

.genre-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #EDE8DF;
}

.genre-header h2 {
  font-size: 1.4rem;
}

/* ── Physical book deal cards ─────────────────────────────────────────────── */
.deal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.deal-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(44,62,107,0.08);
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.25rem;
  align-items: start;
  transition: box-shadow 0.2s;
}
.deal-card:hover {
  box-shadow: 0 4px 16px rgba(44,62,107,0.12);
}

.deal-card .deal-image {
  width: 100px;
  height: 130px;
  border-radius: 6px;
  overflow: hidden;
  background: #EDE8DF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.deal-card .deal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.deal-card .deal-image-placeholder {
  font-size: 2rem;
  color: #C9973A;
}

.deal-card .deal-body { flex: 1; }

.deal-card .deal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: #2C3E6B;
  margin-bottom: 0.3rem;
}

.deal-card .deal-desc {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-card .pricing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.deal-card .price-was {
  font-size: 0.9rem;
  color: #999;
  text-decoration: line-through;
}

.deal-card .price-now {
  font-size: 1.15rem;
  font-weight: 700;
  color: #3D6B4F;
}

.deal-card .discount-badge {
  background: #3D6B4F;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ── Book of the Day ──────────────────────────────────────────────────────── */
.botd-wrap {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(44,62,107,0.1);
}

.botd-cover {
  width: 100%;
  max-height: 400px;
  background: #EDE8DF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.botd-cover img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  padding: 1rem;
}

.botd-cover-placeholder {
  font-size: 5rem;
  padding: 3rem;
  color: #C9973A;
}

.botd-body {
  padding: 2rem;
  text-align: center;
}

.botd-title {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.botd-meta {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.botd-desc {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  color: #2C3E6B;
  margin-bottom: 0.5rem;
}

/* ── Page header (sub-pages) ──────────────────────────────────────────────── */
.page-header {
  background: #2C3E6B;
  color: #FAF7F2;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.page-header h1 {
  color: #FAF7F2;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.page-header p {
  color: #C9D8B6;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: #2C3E6B;
  color: #8899CC;
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.8;
}

.footer a { color: #C9973A; }
.footer a:hover { color: #e8b050; }

.footer .footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #FAF7F2;
  margin-bottom: 0.5rem;
}

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 3rem;
  color: #888;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #EDE8DF;
  border-top-color: #C9973A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .topnav-links {
    gap: 0.75rem;
  }
  .topnav-links a {
    font-size: 0.78rem;
  }
  .deal-card {
    grid-template-columns: 80px 1fr;
    gap: 0.75rem;
  }
  .deal-card .deal-image {
    width: 80px;
    height: 105px;
  }
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 480px) {
  .topnav-links .nav-text { display: none; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .category-grid { grid-template-columns: 1fr; }
  .botd-title { font-size: 1.5rem; }
}
