/* Catalog page styles */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5em;
  padding: 1em;
}

.book-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  padding-bottom: 1em;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.book-card img {
  display: block;
  margin: 0 auto;
  width: 200px;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
}

.book-card h3 {
  font-size: 1.2em;
  margin: 0.5em 1em 0;
  color: black;
}

.book-card p {
  margin: 0.3em 1em 0.3em;
  color: #555;
  font-size: 0.95em;
}

.book-card .price {
  font-weight: 600;
  color: #ff6600;
  margin: 0.5em 1em;
  font-size: 1em;
}

.book-card .subcategory {
  font-size: 0.85em;
  color: #888;
  margin: 0 1em 0.3em;
}

.book-card .description {
  font-size: 0.9em;
  color: #666;
  margin: 0.5em 1em;
  line-height: 1.3em;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-title {
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  font-size: 2.5em;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1em;
  position: relative;
  z-index: 2;
}

.catalog-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 1rem 0.75rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #222;
}

.see-all-link {
  color: #1e88e5;
  font-size: 0.95rem;
  text-decoration: none;
}

.see-all-link:hover {
  text-decoration: underline;
}

.section-meta {
  font-size: 0.9rem;
  color: #777;
  margin: 0.5em 1em 0;
}

.no-data {
  grid-column: 1 / -1;
  padding: 1.5rem;
  background: #fafafa;
  text-align: center;
  border: 1px solid #eee;
  border-radius: 10px;
  color: #555;
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
}

.search-group input[type="search"] {
  min-width: 220px;
  border: none;
  outline: none;
  font-size: 0.95rem;
  background: transparent;
}

.search-group input[type="search"]::placeholder {
  color: #7a7a8c;
}

.filter-group label {
  font-size: 0.95rem;
  color: #333;
  white-space: nowrap;
}

.filter-group select,
.filter-group input[type="checkbox"] {
  cursor: pointer;
}

.filter-inline {
  align-items: center;
}

#modal-img {
  width: 200px;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
}

#modal-see-more-btn:hover {
  text-decoration: underline;
}

.catalog-title::after {
  content: "";
  display: block;
  width: 3.8em;
  height: 4px;
  background-color: black;
  margin: 0.5em auto 0;
  border-radius: 2px;
}

@media (max-width: 480px) {
  .book-card img {
    height: 180px;
  }
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  overflow: auto;
}

.modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 10px;
  max-width: 800px;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.modal-body {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.modal-body img {
  width: 200px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.details p {
  margin: 0;
  font-size: 15px;
}

/* Moved inline catalog page styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink: #1a1a2e;
  --ink2: #2d2d44;
  --paper: #faf8f4;
  --warm: #f5f0e8;
  --accent: #c0392b;
  --accent2: #e74c3c;
  --gold: #d4a017;
  --muted: #7a7a8c;
  --border: #e8e4dc;
  --white: #ffffff;
  --card-shadow: 0 2px 12px rgba(26, 26, 46, 0.08);
  --card-shadow-hover: 0 8px 32px rgba(26, 26, 46, 0.14);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 2rem;
  background: #e67e22;
  border-bottom: 2px solid #d35400;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.logo-b {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Playfair Display', serif;
  cursor: pointer;
}

.logo-b span {
  color: #fff3e0;
}

header nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

header nav .nav-link {
  color: #fff;
  font-weight: 500;
  transition: color 0.3s;
  font-size: 14px;
}

header nav .nav-link:hover {
  color: #fff3e0;
  text-decoration: underline;
}

main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 60vh;
}

.catalog-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--ink);
  margin: 2rem 0 1.5rem 0;
  text-align: left;
  padding-top: 1rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
  padding-bottom: 0;
}

.book-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  animation: bookFadeIn 0.45s ease forwards;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: transparent;
}

.book-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
}

.book-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin: 8px 12px 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card p {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 12px 6px;
}

.book-card .price {
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

.book-card .availability {
  font-size: 11px;
  margin-bottom: 8px;
}

.book-card .subcategory {
  font-size: 11px;
}

@keyframes bookFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
}

.pagination-btn {
  border: 1px solid #e67e22;
  background: #fff;
  color: #e67e22;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  min-width: 44px;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(230, 126, 34, 0.1);
}

.pagination-btn.active {
  background: #e67e22;
  color: #fff;
  border-color: #d35400;
}

.pagination-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-content {
  background-color: var(--white);
  max-width: 600px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: 160px 1fr;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 520px) {
  .modal-content {
    grid-template-columns: 1fr;
  }
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--muted);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.08);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 201;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.16);
  color: var(--ink);
}

.modal-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  width: 100%;
  position: relative;
}

@media (max-width: 520px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

#modal-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
}

.details {
  padding: 28px;
  flex: 1;
}

.details h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.3;
}

.details p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 10px;
}

.details strong {
  color: var(--ink);
  font-weight: 600;
}

footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.6);
  margin-top: 3rem;
  text-align: center;
  padding: 2rem;
}

.bubble-chat-head {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #e67e22;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255,255,255,0.2);
  transition: all 0.2s ease;
  z-index: 1000;
  cursor: pointer;
  text-decoration: none;
  color: white;
  animation: gentlePulse 2s infinite ease-in-out;
}

.bubble-chat-head:hover {
  transform: scale(1.08);
  background: #d35400;
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4), 0 0 0 4px rgba(255,255,240,0.3);
}

.bubble-chat-head i {
  font-size: 28px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

@keyframes gentlePulse {
  0% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 0 0 0px rgba(230,126,34,0.5);
  }
  70% {
    box-shadow: 0 6px 16px rgba(0,0,0,0.25), 0 0 0 8px rgba(230,126,34,0);
  }
  100% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 0 0 0px rgba(230,126,34,0);
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
    flex-direction: column;
    gap: 0.8rem;
  }
  .logo-container {
    justify-content: center;
  }
  header nav {
    width: 100%;
    justify-content: center;
    gap: 1rem;
  }
  main {
    padding: 0 16px;
  }
  .catalog-title {
    font-size: 1.5rem;
  }
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bubble-chat-head {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
  .bubble-chat-head i {
    font-size: 24px;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
  }
  .logo-b {
    font-size: 1.2rem;
  }
}

