.wpai-product-cards {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.wpai-product-cards.single {
  grid-template-columns: 1fr;
}

.wpai-product-cards.multi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wpai-product-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 430px;
}

.wpai-product-cards.single .wpai-product-card {
  min-height: 500px;
}

.wpai-product-card-media {
  position: relative;
  height: 140px;
  background: #f8fafc;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.wpai-product-cards.single .wpai-product-card-media {
  height: 200px;
}

.wpai-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.wpai-product-nav,
.wpai-product-expand-btn {
  position: absolute;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 0;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  outline: none !important;
}

.wpai-product-expand-btn {
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
}

.wpai-product-nav.prev {
  left: 6px;
  top: calc(50% - 12px);
}

.wpai-product-nav.next {
  right: 6px;
  top: calc(50% - 12px);
}

.wpai-product-nav svg,
.wpai-product-expand-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  filter: none;
  transition: color 0.18s ease;
}

.wpai-icon-control:hover,
.wpai-icon-control:focus,
.wpai-icon-control:active {
  background: #111827 !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.wpai-product-card-body {
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 250px;
}

.wpai-product-title {
  margin: 0 0 6px;
  font-size: 14px;
  color: #111827;
  line-height: 1.3;
  min-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wpai-product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 24px;
}

.wpai-product-price {
  font-size: 15px;
  font-weight: 700;
  color: #160211;
}

.wpai-product-compare-price {
  font-size: 12px;
  color: #6b7280;
  text-decoration: line-through;
}

.wpai-product-desc {
  margin: 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.4;
  min-height: 95px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wpai-product-actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wpai-product-link {
  font-size: 12px;
  color: #374151;
  text-decoration: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 8px;
}

.wpai-add-to-cart-btn {
  border: none;
  border-radius: 8px;
  background: #160211;
  color: #ffffff;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  margin-left: auto;
}

.wpai-add-to-cart-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.wpai-product-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.wpai-product-modal.is-open {
  display: block;
}

.wpai-product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.wpai-product-modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 520px);
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
}

.wpai-product-modal-close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: none;
  background: transparent;
  color: #111827;
  cursor: pointer;
}

.wpai-product-modal-header {
  margin-right: 36px;
}

.wpai-product-modal-title {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
}

.wpai-product-modal-index {
  font-size: 12px;
  color: #6b7280;
}

.wpai-product-modal-stage {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 6px;
}

.wpai-product-modal-image {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 10px;
  background: #f3f4f6;
}

.wpai-product-modal-nav {
  border: none;
  border-radius: 0;
  height: 36px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.wpai-product-modal-nav svg {
  display: block;
  width: 24px;
  height: 24px;
}

@media (max-width: 420px) {
  .wpai-product-cards.multi {
    grid-template-columns: 1fr;
  }
}
