/* ============================================================
   ai-product-card-generated.css
   Tech Accessories – Deep-space minimal, electric-accent dark UI
   ============================================================ */

/* ── Card Root ─────────────────────────────────────────────── */
.ai-card {
  background: var(--background);
  color: var(--foreground);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(120, 87, 255, 0.18);
  box-shadow: 0 2px 16px 0 rgba(9, 9, 15, 0.55);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
}

.ai-card:hover {
  box-shadow: 0 4px 32px 0 rgba(120, 87, 255, 0.28);
  transform: translateY(-2px);
}

/* ── Inner / Front / Back ───────────────────────────────────── */
.ai-card__inner {
  position: relative;
}

.ai-card__front {
  /* default visible */
}

.ai-card__back {
  display: none;
}

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

/* 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;
}

.ai-card__img {
  transition: opacity 0.35s ease;
}

/* ── Badges ─────────────────────────────────────────────────── */
.ai-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--striking);
  color: var(--striking-foreground);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  z-index: 2;
  line-height: 1.4;
}

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

/* ── Wishlist ────────────────────────────────────────────────── */
.ai-card__wishlist {
  display: none;
}

/* ── Overlay (hover slide-up add-to-cart) ───────────────────── */
.ai-card__overlay {
  background: linear-gradient(to top, rgba(9, 9, 15, 0.92) 0%, rgba(9, 9, 15, 0.0) 100%);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
  padding: 12px;
}

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

/* Overlay button */
.ai-card__overlay-btn {
  background: var(--cta);
  color: var(--cta-foreground);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  padding: 10px 20px;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.ai-card__overlay-btn:hover {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: 0 0 14px 2px rgba(120, 87, 255, 0.5);
  transform: translateY(-2px);
}

.ai-card__overlay-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.ai-card__overlay-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

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

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

/* Vendor */
.ai-card__vendor {
  display: none;
}

/* Title */
.ai-card__title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--foreground);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.ai-price__current {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--striking-foreground, var(--foreground));
  letter-spacing: 0.02em;
}

.ai-price__compare {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--foreground);
  opacity: 0.45;
  text-decoration: line-through;
}

/* Swatches */
.ai-card__swatches {
  display: none;
}

/* Rating */
.ai-card__rating {
  display: none;
}

/* Add-to-cart wrap inside info area (hidden; using overlay instead) */
.ai-card__add-wrap {
  display: none;
}

/* ── Add-to-Cart State Styles ───────────────────────────────── */

/* Overlay button states */
ai-quick-add-cart[data-state="loading"] .ai-card__overlay-btn {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

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

ai-quick-add-cart[data-state="error"] .ai-card__overlay-btn {
  background: #c0392b;
  color: #fff;
  animation: ai-card-shake 0.4s ease;
}

/* Info area button states (fallback if ever shown) */
ai-quick-add-cart[data-state="loading"] .ai-card__add-btn {
  opacity: 0.6;
  pointer-events: none;
}

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

ai-quick-add-cart[data-state="error"] .ai-card__add-btn {
  animation: ai-card-shake 0.4s ease;
}

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

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

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

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

/* ── Product List – Carousel ────────────────────────────────── */
.ai-pl-carousel {
  display: flex;
  overflow: hidden;
}

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

.ai-pl-carousel-wrap {
  position: relative;
}

.ai-pl-prev,
.ai-pl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: var(--accent-foreground);
  border: 1px solid rgba(120, 87, 255, 0.35);
  border-radius: 2px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.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);
  box-shadow: 0 0 12px 2px rgba(120, 87, 255, 0.45);
}

.ai-pl-prev:focus-visible,
.ai-pl-next:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── Quick Add-to-Cart Modal (.qac-*) ───────────────────────── */

.qac-wrapper[data-variant-mode="modal"] {
  /* root container */
}

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 15, 0.75);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.qac-wrapper[data-open] .qac-overlay {
  opacity: 1;
}

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

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  width: min(700px, 94vw);
  max-height: 90vh;
  background: var(--background);
  color: var(--foreground);
  border-radius: 4px;
  border: 1px solid rgba(120, 87, 255, 0.25);
  box-shadow: 0 8px 48px 0 rgba(9, 9, 15, 0.8);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.qac-wrapper[data-open] .qac-modal {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.qac-wrapper:not([data-open]) .qac-modal {
  opacity: 0;
  transform: translate(-50%, -46%);
  pointer-events: none;
}

/* Header */
.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.qac-product-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--foreground);
  margin: 0;
}

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

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

.qac-close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.qac-close:active {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* Body */
.qac-body {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
}

.qac-product-media {
  width: 40%;
  flex-shrink: 0;
  overflow: hidden;
  background: #0d0d18;
}

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

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

/* Footer */
.qac-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.qac-submit {
  background: var(--cta);
  color: var(--cta-foreground);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  padding: 13px 24px;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.qac-submit:hover:not(:disabled) {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: 0 0 18px 3px rgba(120, 87, 255, 0.5);
  transform: translateY(-2px);
}

.qac-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.qac-submit:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.qac-submit:disabled {
  background: rgba(120, 87, 255, 0.25);
  color: var(--foreground);
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

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

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

.qac-submit[data-success] {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: 0 0 14px 2px rgba(120, 87, 255, 0.45);
}

.qac-submit[data-error] {
  background: #c0392b;
  color: #fff;
  animation: ai-card-shake 0.4s ease;
}

/* ── Responsive: mobile adjustments ────────────────────────── */
@media (max-width: 599px) {
  .qac-body {
    flex-direction: column;
  }

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

  .qac-modal {
    max-height: 95vh;
  }
}