body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  color: #333;
}

header {
  text-align: center;
  background: linear-gradient(90deg, #7c1604, #042257);
  color: white;
  padding: 30px 0;
}

header h1 {
  margin: 0;
}

header p {
  margin-top: 10px;
}

nav {
  display: flex;
  justify-content: center;
  background-color: #7c1604;
  font-size: 18px;
  font-weight: bolder;
}

nav a {
  color: white;
  text-decoration: none;
  margin: 0 20px;
  padding: 10px 15px;
}

nav a:hover {
  background-color: #9e290e;;
  border-radius: 5px; /* Smooth corners for the hover effect */
}

.search-sort-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  gap: 15px; /* Space between search bar & sorting dropdown */
}

#searchBar {
  width: 50%;
  padding: 10px;
  font-size: 18px;
  border: 2px solid #555;
  border-radius: 5px;
}

#sortOptions {
  padding: 10px;
  font-size: 18px;
  border: 2px solid #555;
  border-radius: 5px;
  cursor: pointer;
}


nav a:active {
  transform: scale(0.98); /* Slight shrink when clicking */
}

h1, h2 {
  text-align: center;
  color: #7c1604;
}

.book-section {
  margin: 30px 0;
  padding: 20px;
  text-align: center;
}

.book-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px;
}

.book {
  width: 200px;
  text-align: center;
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 500px;
}

.book img {
  width: 100%;
  border-radius: 4px;
  transition: transform 0.3s;
  margin-bottom: 10px;
}

.book img:hover {
  transform: scale(1.1); /* Slightly enlarge image on hover */
}

/* Specific rule for Bhagavad Gita image */
.book img[alt="Bhagavad Gita"] {
  height: 60%; /* Adjust the width as needed */
}

.book img[alt="India Before Independence"] {
  height: 60%; /* Adjust the width as needed */
}

.book img[alt="Ramayan"] {
  height: 60%; /* Adjust the width as needed */
}

.book img[alt="My First Science Book"] {
  height: 60%; /* Adjust the width as needed */
}

.book-title {
  font-weight: bolder;
  margin-top: 10px;
  font-size: 1.2rem;
  margin: 10px 0 5px;
}

.book-author {
  color: black;
  font-size: 1rem;
  margin-bottom: 1px;
}

.book-price {
  color: #333;
  font-weight: bold;
  margin-top: 10px;
  font-size: 1rem;
  margin-bottom: 10px;
}

.book a {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #7c1604;;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
}

.book a:hover {
  background-color: #7c1604;;
}

.btn {
  display: inline-block;
  padding: 10px 15px;
  background-color: #7c1604;;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s, transform 0.3s;
  align-self: center;
  margin-top: auto;
}

.btn:hover {
  background-color: #7c1604;;
  transform: scale(1.05); /* Slightly enlarge button on hover */
}


#cart-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color:maroon;
  border-radius: 10%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
} 

#cart-icon img {
  width: 30px;
  height: 30px;
}

footer {
  text-align: center;
  background: #333;
  color: white;
  padding: 10px 0;
  margin-top: 40px;
}

.footer-note {
  background-color: #7c1604;
  color: white;
  padding: 10px;
  font-size: 1rem;
  font-weight: bold;
}

.footer-note p {
  margin: 10px 0;
}

.footer-note a {
  margin: 0 10px;
  text-decoration: none;
  color: inherit;
}

.footer-note img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

a img{
  border-radius: 50%;
}

#cart-icon{
  position: fixed;
  bottom: 20px;
  right: 20px; 
  width: 60px; 
  height: 60px; 
  background-color: lightseagreen; 
  border-radius: 50%; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
  cursor: pointer;
}

#cart-icon img{
  width: 35px;
  height: 35px;
  border-radius: 10px;
}

#cart-count{
  position: absolute; 
  top: -10px; 
  right: -10px; 
  background-color: maroon; 
  color: white; 
  border-radius: 50%; 
  width: 20px; 
  height: 20px; 
  display: flex; 
  justify-content: center; 
  align-items: center;

}

/* ============================= */
/* 📱 Mobile Responsive Styling  */
/* ============================= */

/* Tablets and smaller screens */
@media (max-width: 768px) {
  header {
    padding: 20px 10px;
  }

  nav {
    flex-direction: column;
    align-items: center;
    font-size: 16px;
  }

  nav a {
    margin: 8px 0;
    padding: 8px 12px;
    display: block;
  }

  .search-sort-container {
    flex-direction: column;
    gap: 10px;
  }

  #searchBar {
    width: 90%;
    font-size: 16px;
  }

  #sortOptions {
    width: 60%;
    font-size: 16px;
  }

  .book-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .book {
    width: 90%;
    height: auto; /* let height adjust naturally */
  }

  .book img {
    height: auto !important;
    max-height: 300px; /* prevents huge images */
  }

  .book-title {
    font-size: 1rem;
  }

  .book-author,
  .book-price {
    font-size: 0.9rem;
  }

  #cart-icon {
    width: 50px;
    height: 50px;
  }

  #cart-icon img {
    width: 25px;
    height: 25px;
  }

  footer,
  .footer-note {
    font-size: 0.9rem;
    padding: 8px;
  }
}

/* Very small screens (phones <480px) */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.4rem;
  }

  header p {
    font-size: 0.9rem;
  }

  nav a {
    font-size: 14px;
    padding: 6px 10px;
  }

  h1, h2 {
    font-size: 1.2rem;
  }

  .book-title {
    font-size: 0.95rem;
  }

  .book-author,
  .book-price {
    font-size: 0.85rem;
  }

  .btn {
    width: 100%;
    max-width: 200px;
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  #cart-icon {
    width: 45px;
    height: 45px;
  }

  #cart-icon img {
    width: 22px;
    height: 22px;
  }

  #cart-count {
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
  }
}
