:root {
  --bg-start-color: #c4d6b0;
  --title-color: #f09b30;
  --author-name-color: #463422;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  padding: 0;
  margin: 0;
  font-family: Arial, sans-serif;
  padding-top: 70px;
  background-color: #fff;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-start-color);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
header nav a {
  color: var(--author-name-color);
  text-decoration: none;
  font-weight: bold;
  margin: 0 15px;
  text-transform: uppercase;
  font-size: 14px;
}
header nav a:hover {
  text-decoration: underline;
}
main {
  width: 100%;
}
/* offset for in-page anchors */
main > * {
  scroll-margin-top: 80px;
}
/* make images responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* Preview section */
#preview {
  width: 100%;
  min-height: 300px;
  background-color: var(--bg-start-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 20px;
  gap: 20px;
}
.preview_text {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}
.book_title {
  color: var(--title-color);
  text-transform: uppercase;
  font-size: 3rem;
  text-shadow: -4px 0px 4px #51573d;
  margin: 10px 0;
  font-weight: 100;
}
.author_name {
  color: var(--author-name-color);
  font-size: 1.2rem;
}
/* About Book */
.about_book {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.about_book_content {
  max-width: 650px;
  font-size: 1rem;
  line-height: 1.7em;
}
/* Preorder */
.preorder {
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
  padding: 0 20px;
  flex-wrap: wrap;
}
.product {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.order-btn {
  background-color: var(--author-name-color);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 10px;
  transition: background-color 0.3s;
}
.order-btn:hover {
  background-color: #6a4d31;
}
/* Excerpt */
.excerpt {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.excerpt_content {
  max-width: 600px;
  font-size: 1rem;
  line-height: 1.7em;
  text-align: left;
  border: 4px solid var(--bg-start-color);
  padding: 20px;
}
.excerpt_content h2 {
  text-align: center;
}
footer {
  text-align: center;
  padding: 20px;
}
/* Mobile adjustments */
@media (max-width: 768px) {
  header {
    height: 60px;
    padding: 0 10px;
  }
  body {
    padding-top: 60px;
  }
  header nav a {
    margin: 5px;
    font-size: 12px;
  }
  .book_title {
    font-size: 2rem;
  }
  .author_name {
    font-size: 1rem;
  }
  .about_book_content,
  .excerpt_content {
    font-size: 0.9rem;
  }
}
.social-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.social-links a {
  font-size: 1.6rem;
  color: var(--author-name-color);
  transition: color 0.2s;
}
.social-links a:hover,
.social-links a:focus {
  color: var(--bg-start-color);
  outline: none;
}
.social-links a:focus {
  outline: 2px dashed var(--bg-start-color);
  outline-offset: 4px;
}
#feedback {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Drawer Cart Styles */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  display: none;
}

.drawer-cart {
  position: fixed;
  top: 0;
  right: -100%; /* Start off-screen */
  width: 320px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  z-index: 1002;
  transition: right 0.4s ease-in-out;
  display: flex;
  flex-direction: column;
}

.drawer-cart.open {
  right: 0; /* Slide in */
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.drawer-header h3 {
  margin: 0;
  color: var(--author-name-color);
}

.close-drawer-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #888;
}

.drawer-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.drawer-product-details {
  text-align: center;
}

.drawer-product-details img {
  width: 100px;
  height: auto;
  margin: 0 auto 15px;
}

.drawer-product-details h4 {
  margin: 0 0 5px 0;
  color: var(--author-name-color);
  font-size: 1.1rem;
}

.drawer-product-details p {
  margin: 0 0 20px 0;
  font-size: 1rem;
  font-weight: bold;
}

.drawer-form-group {
  margin-bottom: 15px;
}

.drawer-form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

.drawer-form-group input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.drawer-purchase-button-container {
  margin-top: auto; /* Pushes the button to the bottom */
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

.drawer-purchase-button-container img {
  cursor: pointer;
  margin: 0 auto;
}

#global_loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
}

#global_loader .loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid var(--author-name-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.age_restriction {
  font-size: 0.95rem;
  color: #8b0000;
  font-weight: bold;
  margin-top: 14px;
  background-color: #ffeaea;
  padding: 4px 10px;
  border-radius: 8px;
}