/**
 * Product Card Styles
 * Redesigned for better visual hierarchy and modern aesthetics.
 * Consolidated from shop.css and product-card.css
 * Includes product card carousel styles
 */

/* Main product card container */
.shop-product-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  height: 100%; /* Ensure cards in a row have same height */
  padding: 0; /* CRITICAL: Main card has no padding */
  /* Critical sizing properties that were missing */
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  position: relative;
}

.shop-product-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

/* Image container - ensures aspect ratio and full width of the card */
.shop-product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative; /* CRITICAL: Establishes positioning context for on-image badges */
  background-color: #f8f9fa; /* Fallback bg for images */
}

.shop-product-image img,
.shop-product-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block; /* Removes extra space below image */
  transition: transform 0.3s ease;
  cursor: zoom-in; /* Subtle zoom cursor indication */
  border-radius: 6px;
}

.shop-product-card:hover .shop-product-image img,
.shop-product-card:hover .shop-product-slide img {
  transform: scale(1.05);
}

/* Product Card Carousel Styles */
.shop-product-carousel {
  overflow: hidden;
  position: relative;
}

/* Stronger zoom effect for carousel images */
.shop-product-carousel:hover img {
  transform: scale(1.15);
  transition: transform 0.5s ease;
}

/* Carousel Controls */
.shop-product-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.shop-product-prev,
.shop-product-next {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  padding: 0;
  outline: none;
  pointer-events: auto;
  margin: 0 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.shop-product-prev:hover,
.shop-product-next:hover {
  background-color: rgba(255, 255, 255, 0.95);
}

/* Carousel Indicators */
.shop-product-indicators {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 5;
  pointer-events: auto;
}

.shop-product-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.shop-product-indicator:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

.shop-product-indicator.active {
  background-color: white;
}

/* Wrapper for all content below the image */
.shop-product-content-wrapper {
  padding: 0 15px 15px 15px; /* No top padding, LR and Bottom padding for content */
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Ensures this wrapper takes available vertical space */
  width: 100%; /* Ensures it takes full width of card padding box */
}

/* Badges on top of the image (Product Type, Pre-Sale) */
.shop-product-image .shop-product-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: row; /* Ensures badges are side-by-side */
  align-items: center; /* Vertically aligns items within the flex row */
  gap: 8px; /* Space between badges */
  z-index: 17;
}

.shop-product-image .shop-product-badges .shop-product-badge {
  background-color: rgb(245, 152, 125);
  color: #fff; /* White text for contrast with orange */
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  /* backdrop-filter: blur(2px); Removed */
}

/* Promotion badge styling */
.shop-product-image .shop-product-badges .shop-product-badge.promotion {
  background-color: #ff6b6b; /* Red background for promotion badge */
  color: #fff;
}

/* Tags below the image - Instant Access & Delivery Format */
.shop-product-tags-below-image {
  display: flex;
  flex-direction: row; /* Ensures horizontal layout */
  flex-wrap: wrap; /* Allow wrapping if space is tight */
  align-items: center; /* Ensures vertical alignment of items within the row */
  justify-items: space-between;
  gap: 6px; /* Space between badges */
  padding-top: 4px; /* Padding above the tags, inside the content wrapper */
  padding-bottom: 4px; /* Reduced bottom padding before title */
}

.shop-product-access,
.shop-product-format {
  font-size: 0.7em; /* Smaller text */
  padding: 3px 7px; /* Compact padding */
  border-radius: 4px;
  display: inline-flex; /* Align icon and text */
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.shop-product-access {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.shop-product-format {
  background-color: rgba(23, 162, 184, 0.1);
  color: #17a2b8;
  border: 1px solid rgba(23, 162, 184, 0.2);
}

.shop-access-icon,
.shop-format-badge-icon {
  font-size: 0.9em; /* Relative to parent's 0.7em */
}

/* Main content area: title, excerpt, actions */
.shop-product-info {
  /* This div is now mainly for semantic grouping if needed, specific padding is on content-wrapper */
  /* padding: 10px 15px 15px; /* Removed, handled by content-wrapper */
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allows this section to take remaining space */
  padding: 10px; /* Space between tags and title */
}

.shop-product-title {
  font-size: 1.05em; /* Slightly adjusted */
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #333;
  line-height: 1.3;
}

.shop-product-title a {
  text-decoration: none;
  color: inherit;
}

.shop-product-title a:hover {
  color: #0056b3; /* Darker blue on hover */
}

.shop-product-excerpt {
  font-size: 0.8em; /* Slightly smaller */
  color: #555; /* Slightly darker grey */
  margin-bottom: 12px;
  flex-grow: 1; /* Allows excerpt to push actions to bottom */
  line-height: 1.4;
}

/* Price and Buttons container */
.shop-product-price-actions {
  display: flex;
  justify-content: space-between; /* Price left, button right */
  align-items: center; /* Ensures vertical alignment of price and button */
  width: 100%; /* Ensures it spans the content wrapper */
  margin-top: 0; /* Pushes to the bottom of shop-product-info */
  padding-top: 0px; /* Space above price/button */
  border-top: 0px solid #f0f0f0; /* Separator line */
}

.shop-product-price {
  font-size: 1.05em; /* Adjusted size */
  font-weight: bold;
  color: #ff5a87;
  white-space: nowrap; /* Keep price and currency on one line */
}

/* Promotional price styling */
.shop-product-price .regular-price {
  color: #666;
  font-size: 0.9em;
  margin-right: 10px;
  /* Ensure visibility in all contexts */
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Ensure regular price is visible in featured sections with dark backgrounds */
.featured-product .shop-product-price .regular-price,
.featured-section .shop-product-price .regular-price {
  color: #aaa;
}

.shop-product-price .promotional-price {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 1.1em;
}

/* Single action button */
.shop-product-button {
  background-color: rgb(82, 197, 255); /* Changed to user-specified blue */
  color: white;
  padding: 7px 12px; /* Slightly smaller padding */
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.85em; /* Adjusted font size */
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: inline-flex; /* For icon alignment */
  align-items: center;
  gap: 5px; /* Space between icon and text */
  border: none;
  cursor: pointer;
  line-height: 1.3;
}

.shop-product-button:hover {
  transform: translateY(-1px);
}

.shop-product-button .shop-button-icon {
  display: inline-block;
  line-height: 0; /* Helps with vertical alignment of SVG/emoji */
}

.shop-product-button .shop-button-icon svg {
  width: 14px; /* Adjust icon size if needed */
  height: 14px;
  vertical-align: middle;
}

/* Additional product card styles from shop.css */

/* Card shine effect */
.shop-product-card::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.06) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.3s;
  z-index: 1;
}

.shop-product-card:hover::before {
  opacity: 1;
  animation: shop-card-shine 1.2s linear 1;
}

/* Animation for card shine effect */
@keyframes shop-card-shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(30deg);
  }
}

/* Inactive product indicator */
.shop-product-inactive-bar {
  background: #ffa726;
  color: #fff;
  font-weight: bold;
  text-align: center;
  border-radius: 4px 4px 0 0;
  padding: 4px 8px;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  font-size: 0.95em;
  z-index: 2;
}

/* Product highlight badge */
.shop-product-highlight {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #e65100;
  color: white;
  font-size: 0.85em;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 4px;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transform: rotate(5deg);
}

/* Instant access indicator */
.shop-product-instant-access {
  font-size: 0.85em;
  color: #4caf50;
  margin: 10px 0;
  font-weight: 500;
  text-align: center;
}

/* Product button styles */
.shop-product-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  transition: all 0.3s ease;
  margin: 0 5px;
  text-align: center;
  min-width: 100px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.shop-product-more {
  background: #f5f5f5;
  color: #2e99ce;
  border: 1px solid #2e99ce;
}

.shop-product-more:hover {
  background: #e3f2fd;
  color: #1e6a8e;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.shop-product-buy {
  background: #2e99ce;
  color: #fff;
  border: 1px solid #2e99ce;
}

.shop-product-buy:hover {
  background: #1e6a8e;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Animation for card shine effect */
@keyframes shop-card-shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(30deg);
  }
}

/* Responsive styles for product cards */
@media (max-width: 768px) {
  .shop-product-card {
    min-width: 250px;
    max-width: 250px;
    flex: 0 0 250px;
    padding: 1em;
  }

  .shop-product-title {
    font-size: 1.1em;
  }

  .shop-product-actions {
    flex-direction: column;
  }

  .shop-product-btn {
    margin: 5px 0;
  }

  .shop-product-description {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .shop-product-features li {
    margin-bottom: 5px;
  }
}

@media (max-width: 480px) {
  .shop-product-card {
    min-width: 250px;
    max-width: 350px;
    flex: 0 0 200px;
  }

  .shop-product-title {
    font-size: 1em;
  }

  .shop-product-price {
    font-size: 1.1em;
  }

  .shop-product-btn {
    padding: 8px 15px;
    font-size: 0.9em;
  }
}

/* Specific styling for emoji cart icon if not using SVG */
.shop-product-button .shop-button-icon:not(:has(svg)) {
  font-size: 1.1em; /* Make emoji slightly larger if it's text */
}

/* Product Features List */
.shop-product-features {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
}

.shop-product-features li {
  margin-bottom: 8px;
  padding-left: 25px;
  position: relative;
  font-size: 0.9em;
  line-height: 1.4;
}

.shop-product-features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #4caf50;
  font-weight: bold;
  font-size: 1.1em;
}

/* Product Actions */
.shop-product-actions {
  display: flex;
  gap: 0.7em;
  margin-top: auto;
  width: 100%;
  justify-content: space-between;
}

/* Product Button Styles */
.shop-product-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  transition: all 0.3s ease;
  margin: 0 5px;
  text-align: center;
  min-width: 100px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
}

.shop-product-more {
  background: #f5f5f5;
  color: #2e99ce;
  border: 1px solid #2e99ce;
}

.shop-product-more:hover {
  background: #e3f2fd;
  color: #1e6a8e;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.shop-product-buy {
  background: #2e99ce;
  color: #fff;
  border: 1px solid #2e99ce;
}

.shop-product-buy:hover {
  background: #1e6a8e;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Styles for when product requires login (MemberPress usually handles text) */
/* .shop-product-button.login-required-btn { ... } */

.shop-button-icon {
  margin-right: 8px;
}
