/* ================= Global Reset ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.header { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; flex-wrap: wrap; background: #f4f4f4d4; position: relative; }
.header-left { flex: 1; }
.header-center { flex: 2; display: flex; justify-content: center; }
.header-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 30px; }

.logo-img { height: 70px; width: auto; }
.logo-title { display: flex; align-items: center; }

/* ===== SEARCH BAR ===== */
.search-box { position: relative; width: 100%; max-width: 350px; }
.search-input { width: 100%; padding: 8px 12px; padding-right: 35px; border: 2px solid #d4af37; border-radius: 6px; font-size: 1rem; outline: none; }
.search-input:focus { border-color: #060606; }
.search-icon { position: absolute; right: 15px; top: 55%; transform: translateY(-50%); cursor: pointer; }

/* ===== BUTTONS ===== */
.sell-btn { padding: 8px 14px; background: rgba(152,152,152,0.574); color: #060606; border-radius: 6px; font-size: 14px; font-weight: bold; text-decoration: none; transition: all 0.3s ease; }
.sell-btn:hover { background: #40d832b1; transform: scale(1.05); }
.sell-btn:active { transform: scale(0.95); }

/* ===== HAMBURGER TO CROSS (UPDATED) ===== */
.hamburger {
  font-size: 28px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 1101;
  transition: transform 0.3s ease;
}
.hamburger.active { transform: rotate(90deg); }

/* ===== MENU (Hamburger, UPDATED) ===== */
.menu {
  position: fixed;
  top: 0;
  right: -100%; /* hidden by default */
  width: 20%;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: right 0.4s ease;
  z-index: 1100;
}
.menu.active { right: 0; }

.menu a, .menu .dropdown-toggle {
  padding: 12px 20px;
  text-decoration: none;
  color: #000000;
  border-bottom: 1px solid #101010c6;
  font-size: 16px;
}
.menu a:hover, .menu .dropdown-toggle:hover { background: #a3a3a3cf; }

/* ===== OVERLAY (dark background) ===== */
.menu-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  overflow-y: auto;
  visibility: hidden;
  transition: opacity 0.4s ease;
  z-index: 1000;
}
.menu-overlay.active { opacity: 1; visibility: visible; }

/* ===== DROPDOWN INSIDE MENU ===== */
.menu .dropdown { position: relative; display: block; }
.menu .dropdown-toggle { display: block; padding: 12px 20px; color: #070707; text-decoration: none; border-bottom: 1px solid #101010c6; cursor: pointer; }
.menu .dropdown-toggle:hover { background: #a3a3a3cf; }
.menu .dropdown-menu {
  display: none;
  flex-direction: column;
  background: #fff;
  position: relative;
  border-top: 1px solid #ddd;
}
.menu .dropdown-menu a {
  padding: 10px 20px;
  text-decoration: none;
  color: #000000;
  border-bottom: 1px solid #101010c6;
  font-size: 14px;
}
.menu .dropdown-menu a:hover { background: #a3a3a3cf; }
.menu .dropdown.active .dropdown-menu { display: flex; }

/* ===== SHOW DROPDOWN ON HOVER (desktop) ===== */
@media (min-width: 769px) {
  .menu .dropdown { position: relative; }
  .menu .dropdown-menu {
    position: absolute;
    top: 100%; left: 0;
    min-width: 200px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  }
  .menu .dropdown:hover .dropdown-menu { display: flex; }
}

/* ===== MOBILE VIEW ===== */
.mobile-sell { display: none; text-align: center; width: 100%; margin-top: 10px; }
@media(max-width: 768px) {
  .header { flex-direction: row; }
  .header-right .sell-btn { display: none; }
  .mobile-sell { display: block; }
  .header-center { order: 4; width: 100%; margin-top: 10px; justify-content: center; }
  .search-input { width: 95%; }
  .search-icon { right: 22px; }
  .logo-img { height: 53px; }
  .logo-title { gap: 5px; }
  .menu { top: 60px; right: 10px; min-width: 160px; border-radius: 6px; }
  .menu a { padding: 10px 18px; font-size: 14px; }
}

/* ================= Section Headings ================= */
.section-heading {
  text-align: center;
  margin: 20px auto 10px;
  font-size: 26px;
  color: #000000;
}

#loading-message {
  margin-top: 10px;
}

/* ================= Books Grid ================= */
.book-section {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
  padding: 20px;
  justify-items: center;
}

.book-card {
  width: 100%;
  max-width: 180px;
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e0d4c5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-align: center;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-5px);
}

.book-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.book-card h3 {
  font-size: 15px;
  font-weight: bold;
  margin: 6px 0 4px;
  color: #111;
}

.book-card p {
  font-size: 14px;
  color: #090909;
}

/* ================= Footer ================= */
.footer {
  background-color: #1e1e1e;
  color: #f1f1f1;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-top: auto;
}

.footer h2,
.footer h3,
.footer h4 {
  color: #ffffff;
  margin-bottom: 15px;
}

.footer p {
  font-size: 14px;
  line-height: 1.6;
  color: #dddddd;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin: 8px 0;
}

.footer-section ul li a {
  color: #cfc614;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #ff6347;
}

/* Social Icons */
.social-icons {
  margin-top: 15px;
  display: flex;
  gap: 15px;
}

.social-icons a img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.social-icons a img:hover {
  transform: scale(1.1);
}

/* ================= Responsive ================= */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 0.8rem;
  }

  .search-input {
    width: 100%;
  }

  .footer {
    grid-template-columns: 1fr 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .book-section {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
  }

  .book-card {
    max-width: 150px;
    padding: 6px;
  }

  .book-card img {
    height: 150px;
  }

  .book-card h3 {
    font-size: 14px;
  }

  .book-card p {
    font-size: 13px;
  }

  .footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-icons {
    justify-content: center;
  }
}

@media(max-width: 768px) {
  .logo-img { height: 60px; }
  .logo-title { gap: 5px; }
  .menu a { padding: 10px 18px; font-size: 14px; }
}
/* Mobile menu scrollable */
@media(max-width: 768px) {
  .menu {
    top: 60px;
    right: -100%;
    min-width: 200px;
    border-radius: 6px;
    max-height: calc(100vh - 60px); /* screen height ke hisaab se */
    overflow-y: auto; /* scrollable menu */
  }
}
