/* RESET */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

/* HEADER */
  header {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1;
  position: relative;
  padding: 20px;
  background-color: #f8f8f8;
  }

.logo {
  position: absolute;
  left: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #520b0b;
}

.head_links {
  display: flex;
  gap: 15px;
}
.head_links a {
  text-decoration: none;
  color: #520b0b;
  font-size: 24px;
  font-weight: bold;
  transition: 0.3s;
}

.head_links a:hover {
  color: #f39c12;
}

/* HERO */
.hero {
  width: 100%;
  height: 60vh;
  background: url("images/3.jpg") no-repeat center center/cover;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  padding: 20px;
}

.hero h1 {
  font-size: 28px;
  padding: 15px 20px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  max-width: 500px;
}

/* BOOKS */
.books {
  margin: 40px auto;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* ✅ أهم حاجة */
  padding: 0 15px;
}

.book-item {
  flex: 1 1 200px;
  max-width: 220px;
  text-align: center;
  transition: 0.3s;
}

.book-item:hover {
  transform: scale(1.05);
}

.book-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
}

.book-item h6 {
  margin-top: 10px;
  font-size: 16px;
  color: #520b0b;
}

/* BUTTON */
.add-to-cart {
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #520b0b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.3s;
}

.add-to-cart:hover {
  background-color: #f39c12;
}

/* BACK TO TOP */
#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #520b0b;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: none;
}

/* FOOTER */
.footer {
  background-color: #111827;
  color: #eee;
  padding: 40px 20px 20px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-section {
  flex: 1 1 200px;
}

.footer-section h2,
.footer-section h3 {
  margin-bottom: 15px;
  color: #ccc;
}

.footer-section p {
  font-size: 14px;
  color: #ccc;
}

.footer-section a {
  display: block;
  text-decoration: none;
  color: #ccc;
  margin-bottom: 8px;
  transition: 0.3s;
}

.footer-section a:hover {
  color: #f39c12;
  transform: translateX(5px);
}

/* SOCIAL */
.socials {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.socials a {
  width: 40px;
  height: 40px;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  color: white;
  font-size: 18px;
  transition: 0.3s;
}

/* Hover animation 🔥 */
.socials a:hover {
  transform: translateY(-5px) scale(1.1);
}

/* ألوان كل منصة */
.facebook:hover {
  background: #1877F2;
}

.instagram:hover {
  background: #E1306C;
}

.twitter:hover {
  background: black;
}

/* COPYRIGHT */
.copyright {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: #aaa;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .socials {
    justify-content: center;
  }
}

/* TABLET */
@media (max-width: 768px) {
  .hero {
    height: 50vh;
  }

  .hero h1 {
    font-size: 22px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* MOBILE */
@media (max-width: 480px) {
  .hero {
    height: 40vh;
  }

  .hero h1 {
    font-size: 16px;
  }

  .book-item {
    flex: 1 1 100%; /* كتاب واحد في الصف */
  }
}