@import '../../css/master.css';

/*
  Items module: shared card + action button styles
  Used by: index.php, shop-grid-ls.php, items/view_item.php (suggested grid)
*/

/* Product meta + title links */
.product-title a {
  color: var(--lux-text);
  text-decoration: none;
}

.product-title a:hover {
  color: var(--lux-accent);
  text-decoration: none;
}

.product-meta {
  text-decoration: none;
  color: var(--lux-muted);
}

.product-meta:hover {
  color: var(--lux-accent);
}

/* Discount pill used in product cards */
.discount-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  background: var(--brand-primary-lighter);
  color: var(--brand-primary);
  letter-spacing: var(--letter-spacing-wide);
}

/* Trending products card body tweaks */
.product-body-modern {
  min-height: 160px;
}

/* Product card polish (baseline is visible everywhere) */
.product-card {
  border-color: var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: var(--transition-default);
  will-change: transform;
  border-radius: var(--radius-card-top);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  /* border-color: var(--border-default); */
}

/* Prevent 1px hairline at rounded corners (mobile/iOS) */
.product-card .product-image-container {
  border-top-left-radius: var(--radius-card-top-left);
  border-top-right-radius: var(--radius-card-top-right);
  transform: translateZ(0);
}

.product-image-container {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Premium CTA row: centered + max/pro sizing */
.product-card .product-actions {
  margin-top: .25rem;
  display: flex;
  justify-content: center;
}

.product-card .product-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-lg);
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.product-card .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  height: var(--button-height-lg);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  letter-spacing: var(--letter-spacing-wide);
  text-decoration: none !important;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-default);
  line-height: 1.2;
  width: 100%;
  color: var(--text-primary);
  background: var(--surface-default);
}

.product-card .action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.product-card .action-btn:active { transform: translateY(0px); }

.product-card .action-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--brand-primary);
  outline-offset: var(--focus-ring-offset);
  box-shadow: 0 0 0 4px var(--focus-ring-color);
}

.product-card .action-details {
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-primary) !important;
  background: var(--surface-default);
  border-color: var(--brand-primary);
}

.product-card .action-details:hover {
  border-color: var(--text-primary);
  color: var(--brand-primary) !important;
}

.product-card .action-buy {
  color: #fff !important;
  background: var(--brand-primary);
  border-color: transparent;
}

.product-card .action-buy:hover { 
  background: var(--brand-primary-hover);
  filter: brightness(1.03); 
}

@media (hover: none) {
  .product-card .action-btn:hover {
    transform: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    filter: none;
  }
}

/* =============================
   Discount Badge Styling
   ============================= */
.discount-badge-product {
  position: absolute;
  top: var(--spacing-md);
  left: 0;
  background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-hover) 100%);
  color: var(--text-inverse);
  padding: var(--spacing-md) var(--spacing-lg);
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 0 100%);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-wide);
  box-shadow: var(--shadow-md);
}

/* =============================
   Price Elements Styling
   ============================= */
.price {
  display: inline-flex;
  align-items: center;
}

.price-compare {
  color: var(--color-danger);
  font-size: var(--font-size-base);
}

.price-main {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
}

.price-base {
  color: var(--color-success);
  font-size: var(--font-size-base);
}

/* =============================
   Carousel Styling
   ============================= */
.carousel-container {
  height: 250px;
  overflow: hidden;
  border-radius: var(--radius-card-top);
}

.carousel-image {
  height: 250px;
  object-fit: cover;
}
