/**
 * Custom TailwindCSS for affiliate product boxes
 */

/* Reset box to prevent interference with theme styles */
.apd-products-wrapper *,
.apd-products-wrapper *::before,
.apd-products-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Container for all products */
.apd-products-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Individual product box */
.apd-product {
  flex: 1 1 100%;
  position: relative;
  border: solid var(--apd-border-thickness, 1px) var(--apd-border-color, #e5e7eb);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Media query for tablets and up */
@media (min-width: 768px) {
  .apd-product {
    flex: 1 1 calc(50% - 0.75rem);
  }
}

/* Media query for desktop */
@media (min-width: 1024px) {
  .apd-product {
    flex: 1 1 0;
  }
}

/* Featured product style */
.apd-product-featured {
  border-color: var(--apd-featured-border-color, #10b981);
  border-width: 2px;
}

/* Product number */
.apd-product-number {
  position: absolute;
  top: -0.75rem;
  left: -0.75rem;
  background-color: var(--apd-numbering-color, #3b82f6);
  color: var(--apd-numbering-text-color, #ffffff);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
}

/* Product image */
.apd-product-image {
  text-align: center;
  margin-bottom: 0.5rem;
}

.apd-product-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
  display: inline-block;
}

/* Rating stars */
.apd-product-rating {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.apd-star {
  color: #d1d5db;
  font-size: 1.25rem;
}

.apd-star-filled {
  color: #f59e0b;
}

/* Product description text */
.apd-product-text {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
}

/* Plus points */
.apd-product-pluspoints {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.apd-pluspoint {
  display: flex;
  align-items: flex-start;
  font-size: 0.875rem;
  color: #374151;
}

.apd-checkmark {
  color: #10b981;
  margin-right: 0.5rem;
  font-weight: bold;
}

/* Price */
.apd-product-price {
  font-size: 1.25rem;
  font-weight: bold;
  color: #1f2937;
  margin-top: auto;
  margin-bottom: 0.5rem;
}

/* Button */
.apd-product-button {
  margin-top: 0.5rem;
}

.apd-product-button a {
  display: block;
  background-color: #3b82f6;
  color: #ffffff;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out;
}

.apd-product-button a:hover {
  background-color: #2563eb;
}