/* ai-product-card-generated.css — Visual Novel / Atmospheric Dark 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%);
  z-index: 2;
  background: var(--accent);
  color: var(--accent-foreground);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s;
}

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

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

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

/* ─── Card Base ───────────────────────────────────────────────────────── */
.ai-card {
  background: var(--background);
  color: var(--foreground);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(201, 184, 232, 0.18);
  box-shadow: 0 4px 24px rgba(123, 79, 166, 0.15), 0 1px 4px rgba(26, 26, 46, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.ai-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 36px rgba(123, 79, 166, 0.28), 0 2px 8px rgba(242, 167, 187, 0.12);
}

.ai-card__inner {
  position: relative;
}

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

/* Hover image swap */
.ai-card__img--hover {
  opacity: 0;
  transition: opacity 0.4s 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(--striking);
  color: var(--striking-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 20px;
  z-index: 2;
  pointer-events: none;
}

.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(26, 26, 46, 0.92) 0%, rgba(26, 26, 46, 0.0) 100%);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  padding: 12px;
}

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

.ai-card__overlay-btn {
  width: 100%;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.ai-card__overlay-btn:hover {
  background: var(--striking);
  color: var(--striking-foreground);
  box-shadow: 0 0 12px rgba(242, 167, 187, 0.4);
}

.ai-card__overlay-btn:active {
  background: var(--accent);
  color: var(--accent-foreground);
}

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

.ai-card__info-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-card__info-link:hover {
  color: var(--foreground);
}

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

/* Title */
.ai-card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 750px) {
  .ai-card__title {
    font-size: 15px;
  }
}

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

.ai-price__current {
  font-size: 15px;
  font-weight: 700;
  color: var(--striking-foreground);
  background: var(--striking);
  padding: 1px 7px;
  border-radius: 4px;
}

.ai-price__compare {
  font-size: 12px;
  font-weight: 400;
  text-decoration: line-through;
  color: var(--foreground);
  opacity: 0.5;
}

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

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

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

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

/* ─── Quick Add-to-Cart button states ────────────────────────────────── */
ai-quick-add-cart[data-state="loading"] .ai-card__overlay-btn {
  opacity: 0.6;
  pointer-events: none;
}

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: var(--accent);
  color: var(--accent-foreground);
  animation: qac-shake 0.4s ease;
}

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

/* ─── Quick Add-to-Cart Modal (.qac-*) ────────────────────────────────── */
.qac-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.72);
  backdrop-filter: blur(3px);
}

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  background: var(--background);
  color: var(--foreground);
  border-radius: 14px;
  border: 1px solid rgba(201, 184, 232, 0.2);
  box-shadow: 0 16px 60px rgba(123, 79, 166, 0.3), 0 4px 16px rgba(26, 26, 46, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

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

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

.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(201, 184, 232, 0.15);
  background: var(--background);
  color: var(--foreground);
}

.qac-product-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.qac-close {
  background: transparent;
  color: var(--foreground);
  border: 1px solid rgba(201, 184, 232, 0.25);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

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

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

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

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

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

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

.qac-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(201, 184, 232, 0.15);
  background: var(--background);
  color: var(--foreground);
}

.qac-submit {
  width: 100%;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s, box-shadow 0.2s;
}

.qac-submit:hover:not(:disabled) {
  background: var(--striking);
  color: var(--striking-foreground);
  box-shadow: 0 0 16px rgba(242, 167, 187, 0.35);
}

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

.qac-submit:active:not(:disabled) {
  background: var(--accent);
  color: var(--accent-foreground);
}

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

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

.qac-submit[data-loading] {
  opacity: 0.65;
  pointer-events: none;
  background: var(--brand);
  color: var(--brand-foreground);
}

.qac-submit[data-success] {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: 0 0 16px rgba(201, 184, 232, 0.3);
}

.qac-submit[data-error] {
  background: var(--accent);
  color: var(--accent-foreground);
  animation: qac-shake 0.4s ease;
}

/* ─── Responsive: modal on small screens ─────────────────────────────── */
@media (max-width: 600px) {
  .qac-modal {
    width: 98vw;
    max-height: 92vh;
    border-radius: 10px;
  }

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

  .qac-product-media {
    width: 100%;
    max-height: 200px;
  }
}