/* ============================================================
   ai-product-card-generated.css
   Medical & Dental Supplies — Clinical Authority Theme
   ============================================================ */

/* ── Product List: Grid Layout ─────────────────────────────── */
.ai-pl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 750px) {
  .ai-pl-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .ai-pl-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* ── Product List: Carousel Layout ─────────────────────────── */
.ai-pl-carousel-wrap {
  position: relative;
}

.ai-pl-carousel {
  display: flex;
  overflow: hidden;
}

.ai-pl-carousel ai-product-card {
  flex-shrink: 0;
}

.ai-pl-prev,
.ai-pl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--background);
  color: var(--foreground);
  border: 1px solid #C0C5CE;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.ai-pl-prev {
  left: 4px;
}

.ai-pl-next {
  right: 4px;
}

.ai-pl-prev:hover,
.ai-pl-next:hover {
  background: var(--brand);
  color: var(--brand-foreground);
  border-color: var(--brand);
}

/* ── Card Root ──────────────────────────────────────────────── */
.ai-card {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid #C0C5CE;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ai-card:hover {
  box-shadow: 0 4px 24px rgba(11, 31, 58, 0.08);
  transform: translateY(-4px);
}

.ai-card__inner {
  position: relative;
}

/* ── Image Area ─────────────────────────────────────────────── */
.ai-card__media {
  aspect-ratio: 3 / 4;
}

/* ── Hover Image Swap ───────────────────────────────────────── */
.ai-card__img--hover {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.ai-card[data-has-hover-img]:hover .ai-card__img--hover {
  opacity: 1;
}

.ai-card[data-has-hover-img]:hover .ai-card__img {
  opacity: 0;
}

/* ── Badges ─────────────────────────────────────────────────── */
.ai-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  line-height: 1.4;
  z-index: 2;
}

.ai-card__badge--new {
  display: none;
}

/* ── Wishlist Button (hidden) ───────────────────────────────── */
.ai-card__wishlist {
  display: none;
}

/* ── Hover Overlay — Slide-Up Add to Cart ───────────────────── */
.ai-card__overlay {
  background: var(--brand);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  padding: 10px 12px;
}

.ai-card:hover .ai-card__overlay {
  transform: translateY(0);
}

.ai-card__overlay-btn {
  width: 100%;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 3px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.ai-card__overlay-btn:hover {
  background: var(--striking);
  color: var(--striking-foreground);
}

.ai-card__overlay-btn:active {
  opacity: 0.85;
}

/* ── Info Area ──────────────────────────────────────────────── */
.ai-card__info {
  padding: 14px 14px 16px;
  gap: 6px;
  background: var(--background);
  color: var(--foreground);
}

/* ── Info Link ──────────────────────────────────────────────── */
.ai-card__info-link {
  text-decoration: none;
  color: inherit;
}

.ai-card__info-link:hover {
  text-decoration: none;
  color: inherit;
}

/* ── Vendor (hidden) ────────────────────────────────────────── */
.ai-card__vendor {
  display: none;
}

/* ── Title ──────────────────────────────────────────────────── */
.ai-card__title {
  display: block;
  font-family: 'Inter', 'Lato', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* ── Price ──────────────────────────────────────────────────── */
.ai-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.ai-price__current {
  font-family: 'Inter', 'Lato', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
}

.ai-price__compare {
  font-family: 'Inter', 'Lato', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary-foreground);
  text-decoration: line-through;
}

/* ── Swatches (hidden) ──────────────────────────────────────── */
.ai-card__swatches {
  display: none;
}

/* ── Rating (hidden) ────────────────────────────────────────── */
.ai-card__rating {
  display: none;
}

/* ── Add-to-Cart in Info Area (hidden — using overlay) ──────── */
.ai-card__add-wrap {
  display: none;
}

/* ── Back Side (hidden — no flip effect) ───────────────────── */
.ai-card__back {
  display: none;
}

/* ── Overlay Add-to-Cart State Feedback ─────────────────────── */
ai-quick-add-cart[data-state="loading"] .ai-card__overlay-btn {
  opacity: 0.65;
  pointer-events: none;
}

ai-quick-add-cart[data-state="success"] .ai-card__overlay-btn {
  background: var(--cta);
  color: var(--cta-foreground);
  opacity: 1;
}

ai-quick-add-cart[data-state="error"] .ai-card__overlay-btn {
  background: var(--striking);
  color: var(--striking-foreground);
  animation: ai-card-shake 0.4s;
}

@keyframes ai-card-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Quick Add-to-Cart Modal (.qac-*) ───────────────────────── */
.qac-wrapper {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.qac-wrapper[data-open] {
  opacity: 1;
  pointer-events: auto;
}

.qac-wrapper:not([data-open]) {
  opacity: 0;
  pointer-events: none;
}

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.45);
  z-index: 9998;
}

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  background: var(--background);
  color: var(--foreground);
  border-radius: 6px;
  box-shadow: 0 16px 56px rgba(11, 31, 58, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #C0C5CE;
  background: var(--background);
  color: var(--foreground);
  flex-shrink: 0;
}

.qac-product-title {
  font-family: 'Inter', 'Lato', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: 0.01em;
  margin: 0;
  flex: 1;
  padding-right: 12px;
}

.qac-close {
  background: transparent;
  color: var(--foreground);
  border: 1px solid currentColor;
  border-radius: 3px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.qac-close:hover {
  background: var(--brand);
  color: var(--brand-foreground);
  border-color: var(--brand);
}

.qac-close:active {
  opacity: 0.8;
}

.qac-body {
  display: flex;
  flex-direction: row;
  overflow-y: auto;
  flex: 1;
}

.qac-product-media {
  flex: 0 0 40%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.qac-product-info {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: var(--background);
  color: var(--foreground);
}

.qac-footer {
  padding: 16px 20px;
  border-top: 1px solid #C0C5CE;
  background: var(--background);
  flex-shrink: 0;
}

.qac-submit {
  width: 100%;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 4px;
  padding: 13px 20px;
  font-family: 'Inter', 'Lato', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.qac-submit:hover:not(:disabled):not([data-loading]):not([data-success]):not([data-error]) {
  background: var(--striking);
  color: var(--striking-foreground);
}

.qac-submit:active {
  opacity: 0.85;
}

.qac-submit:disabled {
  background: #C0C5CE;
  color: var(--secondary-foreground);
  cursor: not-allowed;
  opacity: 0.65;
}

.qac-submit[data-sold-out] {
  background: var(--secondary);
  color: var(--secondary-foreground);
  cursor: not-allowed;
  opacity: 0.75;
}

.qac-submit[data-loading] {
  opacity: 0.65;
  pointer-events: none;
  cursor: not-allowed;
}

.qac-submit[data-success] {
  background: var(--cta);
  color: var(--cta-foreground);
  opacity: 1;
}

.qac-submit[data-error] {
  background: var(--striking);
  color: var(--striking-foreground);
}

/* ── Responsive: Mobile Modal ───────────────────────────────── */
@media (max-width: 749px) {
  .qac-modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 12px 12px 0 0;
  }

  .qac-wrapper:not([data-open]) .qac-modal {
    transform: translateY(100%);
  }

  .qac-wrapper[data-open] .qac-modal {
    transform: translateY(0);
  }

  .qac-body {
    flex-direction: column;
  }

  .qac-product-media {
    flex: 0 0 220px;
    width: 100%;
    height: 220px;
  }

  .ai-card__overlay-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
}