* {
  box-sizing: border-box;
  /* looked it up, this is a solution to the box problem*/
}

/* Theme */
body {
  font-family: "Bricolage Grotesque", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  font-variation-settings: "wdth" 100;

  background-color: #fceaf0;
  color: black;
  margin: 0;
}

/* Make sure all inputs and buttons inherit the new font */
input,
button {
  font-family: "Bricolage Grotesque", sans-serif;
  font-optical-sizing: auto;
}


/* Header branding*/

header {
  background-color: transparent;
  color: #333;
  text-align: center;
  padding: 40px 20px 0px 20px;

  /* The edge-to-edge border lines */
  border-top: 2px solid #d8a7b1;
  border-bottom: 2px solid #d8a7b1;
  background-color: #fceaf0;
}

/* BRAND TITLE BORDER CONTAINER */
.brand-container {
  margin: 0 auto 25px auto;
  padding: 20px 30px;
  max-width: fit-content;
  /* Makes the border hug the text perfectly */
  border: 2px solid #d8a7b1;
  /* The matching pink border */
  border-radius: 15px;
}

/* Strictly keeping Nova Cut for the Brand Title */
.nova-cut-regular {
  font-family: "Nova Cut", system-ui;
  font-weight: 400;
  font-style: normal;
}

.brand-title {
  font-size: 40px;
  margin: 0;
  color: #4a4a4a;
}

.brand-subtitle {
  font-size: 16px;
  margin: 8px 0 0 0;
  color: #777;
  font-weight: 400;
}

/* SEARCH BAR IN HEADER */
.header-search {
  margin-bottom: 25px;
}

.header-search input {
  width: 100%;
  max-width: 500px;
  padding: 12px 20px 12px 40px;
  border-radius: 30px;
  border: 1px solid white;
  font-size: 15px;
  outline: none;
  box-shadow: 0 4px 10px rgba(216, 167, 177, 0.2);
}

/* NAVIGATION IN HEADER */
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding-bottom: 25px;
}

nav li {
  margin: 0 15px;
}

nav a {
  color: #555;
  text-decoration: none;
  transition: 0.3s;
  font-size: 16px;
  font-weight: 500;
}

nav a:hover {
  color: #d8a7b1;
}

nav a.active {
  color: #d8a7b1;
  font-weight: 700;
}

/* FEATURED BOOKS HOMEPAGE SECTION */
.section {
  text-align: center;
  padding: 20px;
  margin: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* GRID */
#featured-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  padding: 20px;
}

.featured-book {
  background: white;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(216, 167, 177, 0.2);
  transition: 0.3s;
  cursor: pointer;
}

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

.featured-book img {
  width: 120px;
  border-radius: 5px;
}

.rating {
  color: #f39c12;
}



/* ACTIVE CATEGORY SECTION */
.active-category-header {
  text-align: center;
  padding: 25px 20px;
  margin: 30px auto 20px auto;
  max-width: 600px;
  background-color: transparent;
  border: 2px solid #d8a7b1;
  border-radius: 15px;
}



.active-category-header h2 {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  color: #333;
}

.active-category-header p {
  font-size: 16px;
  color: #666;
  margin-top: 10px;
  margin-bottom: 0;
}

/* Controls Bar (Filter) */
.controls-bar {
  display: flex;
  justify-content: center;
  padding: 15px;
}

.filterBtn {
  padding: 8px 12px;
  border-radius: 5px;
  outline: none;
  background-color: white;
  color: #333;
  border: 1px solid #d8a7b1;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(216, 167, 177, 0.2);
}

.filterBtn:hover,
.filterBtn.active-filter {
  background-color: #d8a7b1;
  color: white;
}




/* BOOK GRID */
.books {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  padding: 20px 80px 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.bookSection {
  padding: 15px;
  margin: 0;
  border-radius: 10px;
  background-color: white;
  transition: 0.3s;
  text-align: left;
  box-shadow: 0 4px 10px rgba(216, 167, 177, 0.15);
}

.bookSection:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(216, 167, 177, 0.4);
}


/* IMAGE + OVERLAY */

.img-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 5px;
}

.img-container img {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: 0.3s ease;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: 0.3s ease;
  color: white;
  text-align: center;
  padding: 15px;
  box-sizing: border-box;
}

.img-container:hover .overlay {
  opacity: 1;
}

.img-container:hover img {
  transform: scale(1.05);
}

.overlay p {
  margin: 4px 0;
  font-size: 13px;
}

.overlay button {
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid white;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  transition: 0.2s;
}

.overlay button:hover {
  background: white;
  color: black;
}


/* STAR RATINGS */
.stars {
  color: #f39c12;
  font-size: 15px;
  letter-spacing: 2px;
  font-family: Arial, sans-serif;
}

.star-empty {
  color: #d1d5db;
}

.star-half {
  background: linear-gradient(90deg, #f39c12 50%, #d1d5db 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}


/* GLOBAL ELEMENTS */
.book-title {
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.5;
}


.checkout-btn {
  position: fixed;
  right: 30px;
  bottom: 30px;
  background-color: #333;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: 0.3s;
}

.checkout-btn:hover {
  background-color: #d8a7b1;
}

.cart-btn {
  position: fixed;
  right: 30px;
  bottom: 85px;
  background-color: #f4a6b0;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: 0.3s;
}

.cart-btn:hover {
  background-color: #d8a7b1;
}

.active-cart {
  background-color: #d8a7b1;
}

.wishlist-btn {
  position: fixed;
  right: 30px;
  bottom: 85px;
  background-color: #f4a6b0;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: 0.3s;
}

.wishlist-btn:hover {
  background-color: #d8a7b1;
}

.active-wishlist {
  background-color: #d8a7b1;
}



/* Checkout specific elements */
.checkout-header {
  display: flex;
  flex-wrap: wrap;
  /* Allows them to stack on smaller screens */
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}


.checkout-container {
  background: white;
  padding: 30px;
  border-radius: 15px;
  border: 1px solid #d8a7b1;
  min-width: 300px;
  flex: 1;
  max-width: 500px;
}

.checkoutFields {
  padding: 30px;
  border-radius: 15px;
  border: 1px solid #d8a7b1;
  min-width: 300px;
  flex: 1;
  max-width: 500px;
  
}

.checkoutFields p {
 margin-top: 15px;    
  margin-bottom: 2px;  
  font-weight: bold;
  color: #555;
  font-size: 14px;
  text-align: left;   
  max-width: 250px;    
  margin-left: auto;   
  margin-right: auto;
}

.checkout-item {
  margin: 5px 5px;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding: 5px 0;
}


.cardInfo {
  display: flex;
  justify-content: center;
  gap: 15px;
  max-width: 300px; 
  margin: 10px auto;
}

.cardInfo input {
  margin: 0;
  width: auto;
}

#nameField,
#userEmail,
#userAddress,
#postalCode,
#cardNum,
#expiry,
#cvv {
width: 100%;
  max-width: 250px;
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid #d8a7b1;
  font-size: 15px;
  outline: none;
  box-shadow: 0 4px 10px rgba(216, 167, 177, 0.2);
  margin: 0 auto 5px auto; 
  display: block;
}

#expiry,
#cvv {
width: 100%;
  max-width: 200px;
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid #d8a7b1; 
  font-size: 15px;
  outline: none;
  box-shadow: 0 4px 10px rgba(216, 167, 177, 0.2);
  margin: 0 ; 
  display: block;
}

#checkOutBtn {
  display: block;     
  margin: 20px auto; 
  width: 100%;        
  max-width: 200px;
  padding: 8px 12px;
  border-radius: 5px;
  outline: none;
  background-color: white;
  color: #333;
  border: 1px solid #d8a7b1;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(216, 167, 177, 0.2);
}

#checkOutBtn:hover,
#filterBtn.active-filter {
  background-color: #d8a7b1;
  color: white;
}

footer {
  text-align: center;
  padding: 20px;
  background-color: transparent;
  color: #555;
  border-top: 1px solid #d8a7b1;
}

@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
  }

  .books {
    padding: 20px;
  }

  .active-category-header {
    margin: 30px 20px 20px 20px;
  }

  .checkout-header {
    margin: 30px 20px 20px 20px;
    display: flex;
  }

  .brand-container {
    padding: 15px;
  }
}

/* wishlist page specific elements */
.wishlist-container {
  max-width: 600px;
  margin: 50px auto;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(216, 167, 177, 0.15);
  text-align: center;
}

.wishlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding: 10px 0;
}

.remove-btn {
  background-color: #d8a7b1;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
}

.back-btn {
  background-color: #ffffff;
  color: #333;
  padding: 10px 15px;
  border: 1px solid #d8a7b1;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 20px;
  font-weight: 600;
}

.back-btn:hover {
  background-color: #d8a7b1;
  color: white;
}