/**
 * Frontend styles for WPBridge plugin
 * Product card badges and overlay positioning
 */

/* Import filter widget styles */
@import url("./filter-widget.css");

/* =========================================================================
   Product Card Badges - Base styles
   ========================================================================= */

.wpbridge-product-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wpbridge-product-card__badge {
  display: inline-block;
  padding: 4px 8px;
  background-color: #f0f0f0;
  color: #333;
  font-size: 0.85em;
  font-weight: 600;
  border-radius: 3px;
  white-space: nowrap;
}

/* =========================================================================
   Badge Types - Default colors
   ========================================================================= */

.wpbridge-product-card__badge--new {
  background-color: #4caf50;
  color: #ffffff;
}

.wpbridge-product-card__badge--sale {
  background-color: #ff6b6b;
  color: #ffffff;
}

.wpbridge-product-card__badge--lot {
  background-color: #2196f3;
  color: #ffffff;
}

.wpbridge-product-card__badge--limited-stock {
  background-color: #ff9800;
  color: #ffffff;
}

/* =========================================================================
   Badges - Inline positioning (default)
   ========================================================================= */

.wpbridge-product-card__badges--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

/* =========================================================================
   Badges - Image overlay positioning
   ========================================================================= */

.wpbridge-product-card__media {
  position: relative;
  overflow: hidden;
}

/* Base positioning for image overlays */
.wpbridge-product-card__badges--image-top-left,
.wpbridge-product-card__badges--image-top-right,
.wpbridge-product-card__badges--image-bottom-left,
.wpbridge-product-card__badges--image-bottom-right {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 10;
  pointer-events: auto;
}

/* Top Left */
.wpbridge-product-card__badges--image-top-left {
  top: var(--badges-offset-y, 8px);
  left: var(--badges-offset-x, 8px);
}

/* Top Right */
.wpbridge-product-card__badges--image-top-right {
  top: var(--badges-offset-y, 8px);
  right: var(--badges-offset-x, 8px);
}

/* Bottom Left */
.wpbridge-product-card__badges--image-bottom-left {
  bottom: var(--badges-offset-y, 8px);
  left: var(--badges-offset-x, 8px);
}

/* Bottom Right */
.wpbridge-product-card__badges--image-bottom-right {
  bottom: var(--badges-offset-y, 8px);
  right: var(--badges-offset-x, 8px);
}

/* =========================================================================
   Product Card - General
   ========================================================================= */

.wpbridge-product-card {
  display: flex;
  flex-direction: column;
}

.wpbridge-product-card--classic {
  /* Default classic layout */
}

.wpbridge-product-card--compact {
  /* Compact variant */
}

.wpbridge-product-card--overlay {
  position: relative;
  height: 100%;
}

.wpbridge-product-card--overlay .wpbridge-product-card__media {
  flex: 1;
  background-size: cover;
  background-position: center;
}

.wpbridge-product-card--overlay .wpbridge-product-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  z-index: 5;
}

.wpbridge-product-card--horizontal {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.wpbridge-product-card--horizontal .wpbridge-product-card__media {
  flex: 0 0 200px;
  min-height: 200px;
}

.wpbridge-product-card--horizontal .wpbridge-product-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   Product Card Body
   ========================================================================= */

.wpbridge-product-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  max-width: 300px;
}

.wpbridge-product-card__title {
  margin: 0;
  font-size: 1em;
  font-weight: 600;
}

.wpbridge-product-card__title a {
  text-decoration: none;
  color: inherit;
}

.wpbridge-product-card__title a:hover {
  text-decoration: underline;
}

.wpbridge-product-card__sku {
  margin: 0;
  font-size: 0.85em;
  color: #666;
}

.wpbridge-product-card__price {
  font-weight: 600;
}

.wpbridge-product-card__unit-price {
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
}

.wpbridge-product-card__actions {
  margin-top: 8px;
}

.wpbridge-product-card__atc {
  display: inline-block;
  padding: 8px 16px;
  background-color: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.wpbridge-product-card__atc:hover {
  background-color: #111;
}

.wpbridge-price-restricted,
.wpbridge-cart-restricted {
  color: #999;
  font-size: 0.9em;
}

.wpbridge-product-card__price-row--sale {
  display: flex;
  justify-content: space-between;
}

.wpbridge-sp-hero__image img {
  height: 100%;
}

.woocommerce-product-gallery__trigger {
  position: absolute;
  z-index: 1;
  right: 5px;
  top: 5px;
}

.wpbridge-price-wrapper {
  display: flex;
  flex-direction: column;
}

.wpb-product-search-results-theme
  .wpbridge-product-card
  .wpbridge-price-row--sale {
  display: flex;
}

.wpbridge-category-product-slider__slide .wpbridge-product-card__media {
  width: max-content;
}
