/*
 * Front‑end stylesheet for the BHP Books Amazon Showcase.
 *
 * This file provides a clean grid layout for book items and styles
 * the hover overlay containing the “Buy on Amazon” and “Quick View”
 * actions. The overall look is inspired by the Salient e‑commerce
 * product cards: actions appear on hover as a smooth slide/fade
 * transition. A minimal modal is also styled to present book
 * details when the quick view is triggered.
 */

/* Reset some defaults for buttons and links inside the plugin */
.bhp-books-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
  background-color: #000;
  padding: 30px 0;
}

/* Each book card */
.bhp-book-item {
  position: relative;
  width: calc(33.333% - 30px);
  margin: 15px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Subtle shadow on hover */
.bhp-book-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Thumbnail image */
.bhp-book-thumb {
  position: relative;
  width: 100%;
  padding-top: 150%; /* 2:3 aspect ratio */
  overflow: hidden;
  background: #f7f7f7;
}

.bhp-book-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Title below the image */
.bhp-book-title {
  padding: 16px 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #111;
  text-align: center;
  min-height: 52px;
}

/* Actions overlay that appears on hover */
.bhp-book-actions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 3;
  align-items: center;
  width: 80%;
}

.bhp-book-item:hover .bhp-book-actions {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Style for action buttons */
.bhp-book-actions .button {
  display: block;
  width: 100%;
  text-align: center;
  background-color: #000;
  color: #fff;
  border: none;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 30px;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}

.bhp-book-actions .button:hover,
.bhp-book-actions .button:focus {
  background-color: #333;
  outline: none;
}

/* Modal overlay and content */
.bhp-book-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 40px 20px;
  box-sizing: border-box;
}

.bhp-book-modal-content {
  background: #fff;
  max-width: 960px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  border-radius: 8px;
  position: relative;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.3s ease both;
}

/* Close button */
.bhp-book-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.bhp-book-modal-close:hover {
  color: #333;
}

/* Modal content layout */
.bhp-book-modal-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-start;
}

.bhp-book-modal-images {
  flex: 0 0 40%;
  max-width: 40%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bhp-book-modal-images img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.bhp-book-modal-summary {
  flex: 0 0 50%;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bhp-book-modal-summary h2 {
  margin-top: 0;
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin-bottom: 20px;
}

.bhp-book-modal-summary .bhp-modal-description {
  margin-bottom: 40px;
  line-height: 1.6;
  color: #444;
  font-size: 16px;
}

.bhp-book-modal-summary .bhp-modal-buy .button {
  display: inline-block;
  background-color: #000;
  color: #fff;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 40px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.bhp-book-modal-summary .bhp-modal-buy .button:hover {
  background-color: #333;
}

/* Responsive breakpoints */
@media (max-width: 992px) {
  .bhp-book-item {
    width: calc(50% - 30px);
  }
  .bhp-book-modal-images {
    flex: 0 0 45%;
    max-width: 45%;
  }
  .bhp-book-modal-summary {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 600px) {
  .bhp-book-item {
    width: calc(100% - 30px);
  }
  .bhp-book-modal-inner {
    flex-direction: column;
  }
  .bhp-book-modal-images,
  .bhp-book-modal-summary {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .bhp-book-modal-summary {
    margin-top: 20px;
  }
  .bhp-book-modal-content {
    padding: 20px;
  }
}

@keyframes fadeInUp {
  from {
    transform: translate3d(0, 40px, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}