/* -----------------------------------------
   MATERIAL 3 BOOKSTORE THEME (FINAL VERSION)
   ----------------------------------------- */

:root {
  --surface: #fbfbfd;
  --subtle: #f0f2f7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;

  --accent: #1e88e5;       /* Material Blue */
  --accent-700: #1565c0;

  --radius: 12px;

  --shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  --shadow-strong: 0 12px 30px rgba(16, 24, 40, 0.10);

  --max-width: 1200px;
}

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  font-family: "Google Sans", "Segoe UI", Arial, sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* -----------------------------------------
   HEADER
   ----------------------------------------- */

.site-header {
  background: white;
  padding: 14px 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-row {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo { font-size: 22px; }

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-700);
}

/* -----------------------------------------
   HAMBURGER MENU
   ----------------------------------------- */

.hamburger {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  outline: none;
  color: var(--accent-700);
  cursor: pointer;
}

.hamburger:focus,
.hamburger:active {
  outline: none;
  border: none;
  background: none;
  box-shadow: none;
}

/* -----------------------------------------
   GENRE NAVIGATION
   ----------------------------------------- */

.genre-nav {
  margin-top: 12px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 6px;

  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.genre-nav::-webkit-scrollbar { display: none; }

.genre-nav a {
  display: inline-block;
  padding: 8px 14px;
  background: var(--subtle);
  color: var(--accent-700);
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: 0.2s ease;
}

.genre-nav a:hover {
  background: var(--accent);
  color: white;
}

/* Mobile expanded menu */
.genre-nav.open {
  display: flex;
  background: white;
  padding: 14px;
  border-radius: 12px;
  margin-top: 10px;
  box-shadow: var(--shadow-strong);
}

/* -----------------------------------------
   PAGE LAYOUT
   ----------------------------------------- */

.page-wrap {
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 0 16px;
}

/* SEARCH BAR */

.search-area {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.search-box {
  width: 100%;
  max-width: 620px;
  padding: 14px 16px;

  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);

  font-size: 15px;
  outline: none;
}

/* -----------------------------------------
   GENRE SECTION
   ----------------------------------------- */

.genre-section {
  margin: 28px 0;
}

.genre-title {
  font-size: 22px;
  color: var(--accent-700);
  font-weight: 600;
  margin-bottom: 14px;
}

/* -----------------------------------------
   BOOK GRID
   ----------------------------------------- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  align-items: start;
}

/* -----------------------------------------
   BOOK CARD
   ----------------------------------------- */

.book-tile {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;

  box-shadow: var(--shadow);
  transition: 0.22s ease;
  display: flex;
  flex-direction: column;
}

.book-tile:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

/* -----------------------------------------
   FIXED COVER HEIGHT (aligned cards!)
   ----------------------------------------- */

.cover-wrap {
  height: 180px;          /* <<< FIXED height */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f4f6fb);
}

/* AUTO-FIT IMAGE inside fixed box */
.book-cover {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;

  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cover-placeholder {
  width: 110px;
  height: 150px;
  border-radius: 8px;
  background: #e9edf5;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #7a8597;
  font-weight: 600;
}

/* -----------------------------------------
   CARD META
   ----------------------------------------- */

.book-meta {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-title-text {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -----------------------------------------
   BUTTON GRID
   ----------------------------------------- */

.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gbtn {
  padding: 10px;
  font-size: 13px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: 0.2s ease;
}

.gbtn:hover {
  background: var(--accent-700);
  transform: translateY(-2px);
}

/* full-width buttons */
.gbtn-full {
  grid-column: 1 / -1;
}

/* -----------------------------------------
   RATING
   ----------------------------------------- */

.rating-cell {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.rating-stars {
  display: flex;
  gap: 6px;
  font-size: 14px;
}

.star {
  cursor: pointer;
  color: #cbd5e1;
}

.star.active {
  color: #f1c40f;
}

/* -----------------------------------------
   MODALS
   ----------------------------------------- */

.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 20, 0.5);
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 300;
}

.modal-bg.show { display: flex; }

.modal {
  background: white;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-strong);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-text {
  color: var(--muted);
  white-space: pre-line;
  font-size: 14px;
}

.modal-close {
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* -----------------------------------------
   FLOATING BUTTON
   ----------------------------------------- */

.floating-btn {
  position: fixed;
  right: 26px;
  bottom: 26px;

  padding: 14px 24px;
  background: linear-gradient(180deg, var(--accent), var(--accent-700));
  border-radius: 999px;

  color: white;
  font-weight: 700;
  border: none;
  cursor: pointer;

  box-shadow: var(--shadow-strong);
  transition: 0.25s ease;
  z-index: 500;
}

.floating-btn:hover {
  transform: translateY(-4px);
}

/* -----------------------------------------
   RESPONSIVE
   ----------------------------------------- */

@media (max-width: 900px) {
  .hamburger { display: block; }
  .genre-nav { display: none; }
  .genre-nav.open { display: flex; }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .cover-wrap { height: 160px; }
}

@media (max-width: 520px) {
  .search-box { max-width: 100%; }

  .book-grid { gap: 14px; }
  .cover-wrap { height: 150px; }
}


/* ------------------------------
   FOOTER (Material 3 Style)
   ------------------------------ */

.site-footer {
  margin-top: 60px;
  padding: 28px 16px;
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 -4px 10px rgba(0,0,0,0.04);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-700);
}

.footer-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}
