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

:root {
  --bg: #fafaf6;
  --green: #5f7e5f;
  --green-dark: #46603f;
  --text: #2a2a2a;
  --muted: #8a8a85;
  --line: #ececea;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.phone {
  width: 100%;
  max-width: 430px;
  background: var(--bg);
  position: relative;
  min-height: 100vh;
  padding-bottom: 90px;
}

.content { padding: 8px 22px; }

/* Page Head with banner background */
.page-head {
  margin-left: -22px;
  margin-right: -22px;
  padding: 32px 22px 28px;
  background-image: url('public/header-illustration.png');
  background-size: cover;
  background-position: right center;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.head-text h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--text);
}
.head-text p { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Search Row */
.search-row { display: flex; gap: 10px; margin-top: 14px; }
.search-box {
  flex: 1;
  background: #fff;
  border-radius: 30px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
}
.search-ico-svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  flex-shrink: 0;
}
.search-box input {
  border: none; outline: none; flex: 1;
  font-size: 13px; background: transparent;
}
.filter-ico-svg {
  width: 20px;
  height: 20px;
  stroke: var(--green);
}
.filter-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s;
}
.filter-btn:hover {
  transform: scale(1.05);
}

/* Featured Book Banner using Background Image */
.featured {
  margin-top: 18px;
  background-image: linear-gradient(to right, #ffffff 0%, #ffffff 32%, rgba(255, 255, 255, 0.8) 42%, rgba(255, 255, 255, 0) 50%), url('public/book-featured.jpg');
  background-size: contain;
  background-position: right center;
  background-repeat: no-repeat;
  background-color: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  height: 210px; /* Precise height to fit and match book-featured cover image ratio */
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}
.featured-text {
  width: 46%; /* Reduced to give more room for the image */
}
.badge { font-size: 10px; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; }
.featured h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; /* Slightly smaller font to fit within the reduced width */
  font-weight: 600;
  line-height: 1.2;
  margin: 6px 0;
  color: var(--text);
}
.featured p { font-size: 10px; color: var(--muted); line-height: 1.4; margin-bottom: 10px; }
.price {
  font-size: 18px; /* Slightly smaller */
  font-weight: 600;
  color: var(--green);
  margin-bottom: 12px;
}
.buy-btn {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 24px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.buy-btn:hover {
  background: var(--green-dark);
}
.buy-arrow {
  width: 16px;
  height: 16px;
  stroke: var(--green);
  background: #fff;
  border-radius: 50%;
  padding: 2px;
}

/* Dots Carousel */
.dots { display: flex; gap: 6px; justify-content: center; margin: 16px 0 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #d6d2c4; cursor: pointer; transition: width 0.2s, background 0.2s; }
.dot.active { background: var(--green); width: 16px; border-radius: 4px; }

/* Sections */
.section { margin-top: 24px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-head h3 { font-size: 12px; letter-spacing: 1.5px; font-weight: 600; color: var(--text); }
.see-all { color: var(--muted); font-size: 12px; cursor: pointer; }

/* Ebook Grid (Horizontal Scroll) */
.book-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 14px;
  margin-left: -22px;
  margin-right: -22px;
  padding-left: 22px;
  padding-right: 22px;
}
.book-grid::-webkit-scrollbar { display: none; }
.book-card {
  flex: 0 0 120px;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
  display: flex;
  flex-direction: column;
}
.cover-wrapper {
  width: 100px;
  height: 140px; /* Explicit size to synchronize all book cards cover height */
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fav {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  z-index: 2;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: background 0.2s, color 0.2s;
}
.fav-svg {
  width: 100%;
  height: 100%;
  stroke: var(--muted);
}
.fav.active {
  background: #fff;
}
.fav.active .fav-svg {
  stroke: #c05050;
  fill: #c05050;
}
.book-card h4 {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-card p {
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
}

/* Categories */
.cats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.cat {
  border-radius: 16px;
  padding: 12px 4px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
  transition: transform 0.2s;
}
.cat:hover {
  transform: translateY(-2px);
}
.cat-ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  padding: 8px;
}
.cat-svg {
  width: 100%;
  height: 100%;
}
.cat small {
  font-size: 9px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
  display: block;
}

/* Category colors */
.ca1 { background: #eef4ee; }
.ca1 .cat-ico { color: #5f7e5f; }
.ca2 { background: #ebf3f7; }
.ca2 .cat-ico { color: #4b7fa0; }
.ca3 { background: #faf2ea; }
.ca3 .cat-ico { color: #c07a50; }
.ca4 { background: #eef4ee; }
.ca4 .cat-ico { color: #5f7e5f; }
.ca5 { background: #faf2ea; }
.ca5 .cat-ico { color: #c07a50; }

/* CTA Bottom Card */
.cta-card {
  margin-top: 24px;
  background: #f4f6f3;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}
.cta-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex-shrink: 0;
  color: var(--green);
}
.cta-svg {
  width: 100%;
  height: 100%;
}
.cta-body {
  flex: 1;
}
.cta-body h4 { font-size: 13px; font-weight: 600; margin-bottom: 3px; color: var(--text); }
.cta-body p { font-size: 10px; color: var(--muted); line-height: 1.4; }
.cta-btn {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.cta-btn:hover {
  background: var(--green-dark);
}

.bottom-spacer { height: 20px; }

/* Bottom navigation bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  padding: 10px 0 16px;
  border-top: 1px solid var(--line);
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  text-decoration: none;
}
.nav-item small { font-size: 10px; }
.nav-item.active { color: var(--green); font-weight: 600; }

.nav-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}
.nav-item.active .nav-icon path {
  fill: currentColor;
}
