.purchase-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:auto;
  padding-top:12px;
}
.purchase-row .price{
  margin:0;
  white-space:nowrap;
}
.cart-button{
  display:inline-block;
  padding:10px 13px;
  border-radius:7px;
  background:#087f83;
  color:#fff!important;
  font-size:13px;
  font-weight:700;
  text-decoration:none;
  text-align:center;
  transition:background .2s;
}
.cart-button:hover{background:#065e62}
@media(max-width:480px){
  .purchase-row{gap:6px}
  .cart-button{padding:9px 7px;font-size:11px}
}

/* Smaller Add to Cart buttons */
.cart-button{
  padding:7px 10px;
  font-size:12px;
  border-radius:6px;
}
@media(max-width:480px){
  .cart-button{
    padding:6px 7px;
    font-size:10px;
  }
}

/* Align prices and buttons across each book row */
.book {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book .purchase-row {
  margin-top: auto;
  padding-top: 16px;
  width: 100%;
  align-items: center;
}

.book .purchase-row .price {
  margin: 0;
}


/* Align cart buttons with right edge of book covers */
.book .purchase-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.book .cart-button {
  margin-left: auto;
  flex-shrink: 0;
}

/* Increase vertical spacing between book rows */
#browse .grid,
#featuredBooks {
  row-gap: 1.5em;
}


/* Compact text beneath book covers */
.book h3 {
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 3px;
}

.book .category {
  font-size: 11px;
  margin-bottom: 0;
}

.book .purchase-row .price {
  font-size: 12px;
}

/* Align prices and buttons at bottom */
.book .purchase-row {
  margin-top: auto;
  padding-top: 5px;
}

/* Increase vertical spacing between book rows */
#browse .grid,
#featuredBooks {
  row-gap: 48px;
}


/* Left-align book titles with covers */
.book h3 {
  text-align: left;
  margin-left: 0;
  padding-left: 0;
  width: 100%;
}


/* Barnes & Noble-inspired compact book layout */
.book {
  display: flex;
  flex-direction: column;
  height: auto;
  align-items: stretch;
}

.book h3 {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  text-align: left;
  margin: 10px 0 4px;
  padding: 0;
}

.book .category {
  font-size: 11px;
  line-height: 1.4;
  margin: 0 0 6px;
}

.book .purchase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  padding-top: 0;
  gap: 8px;
}

.book .purchase-row .price {
  font-size: 12px;
  font-weight: 600;
}

.book .cart-button {
  margin-left: auto;
  padding: 6px 9px;
  font-size: 11px;
}

/* More breathing room between rows */
#browse .grid {
  row-gap: 60px;
}

#featuredBooks {
  row-gap: 45px;
}


/* Quick Add overlay */
.book {
  position: relative;
}

.book .cart-button {
  position: absolute;
  top: 268px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 15px;
  background: #087f83;
  color: white;
  font-size: 12px;
  white-space: nowrap;
  z-index: 2;
}

.book .purchase-row {
  justify-content: flex-start;
}

@media (hover:hover) {
  .book .cart-button {
    opacity: 0;
    transition: opacity .2s;
  }
  .book:hover .cart-button {
    opacity: 1;
  }
}

@media (hover:none) {
  .book .cart-button {
    opacity: 1;
  }
}

.book .book-format {
  font-size: 11px;
  font-weight: 600;
  margin: 2px 0 3px;
  text-align: left;
  width: 100%;
}


/* Match cover and book information alignment */
.book > img {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.book h3,
.book .category,
.book .book-format,
.book .purchase-row {
  margin-left: 0 !important;
  padding-left: 0 !important;
  text-align: left;
}

/* Keep Quick Add centered over the cover */
.book .cart-button {
  left: min(102.5px, 50%);
}


/* Align Browse All Books to far right */
.category-heading-row {
  display: flex !important;
  width: 100% !important;
  align-items: center;
}

.category-heading-row #browse-all-link {
  margin-left: auto !important;
  text-align: right;
}


/* Keep Browse All Books link clickable */
.category-heading-row {
  position: relative;
  z-index: 10;
}

.category-heading-row #browse-all-link {
  position: relative;
  z-index: 11;
  pointer-events: auto;
  cursor: pointer;
}
