/* ==========================================================================
   ai-product-card-generated.css
   Global CSS decorator for ai-product-card skeleton
   Design: Luminous botanical softness, premium editorial grace
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base Card
   -------------------------------------------------------------------------- */
.ai-card {
  background: var(--background);
  color: var(--foreground);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px 0 rgba(44, 44, 44, 0.06);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
  position: relative;
}

.ai-card:hover {
  box-shadow: 0 8px 36px 0 rgba(44, 44, 44, 0.13);
  transform: translateY(-3px);
}

.ai-card__inner {
  position: relative;
  width: 100%;
}

/* Front side */
.ai-card__front {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Image / Media Area
   -------------------------------------------------------------------------- */
.ai-card__media {
  aspect-ratio: 3 / 4;
  background: var(--accent);
}

/* Hover image swap — opacity transition only; layout is set by Tailwind */
.ai-card__img--hover {
  opacity: 0;
  transition: opacity 0.45s 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.45s ease;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.ai-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--striking);
  color: var(--striking-foreground);
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  line-height: 1.4;
  z-index: 2;
}

.ai-card__badge--new {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  line-height: 1.4;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Wishlist Button (hidden by default)
   -------------------------------------------------------------------------- */
.ai-card__wishlist {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(250, 250, 248, 0.82);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
  z-index: 3;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.ai-card__wishlist:hover {
  background: var(--striking);
  color: var(--striking-foreground);
  transform: scale(1.1);
}

.ai-card__wishlist svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

/* --------------------------------------------------------------------------
   Hover Action Overlay — Slide-Up Add to Cart
   -------------------------------------------------------------------------- */
.ai-card__overlay {
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  background: linear-gradient(to top, rgba(168, 197, 176, 0.95) 0%, rgba(168, 197, 176, 0.6) 100%);
  padding: 14px;
  z-index: 4;
}

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

/* Overlay CTA button */
.ai-card__overlay-btn {
  width: 100%;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 24px;
  padding: 11px 20px;
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.ai-card__overlay-btn:hover {
  background: var(--striking);
  color: var(--striking-foreground);
  box-shadow: 0 4px 18px rgba(212, 49, 122, 0.3);
  transform: scale(1.02);
}

.ai-card__overlay-btn:active {
  transform: scale(0.98);
}

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

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

/* Vendor (hidden by default) */
.ai-card__vendor {
  display: none;
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground);
  opacity: 0.55;
}

/* Product Title */
.ai-card__title {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--foreground);
  letter-spacing: 0.01em;
}

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

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

.ai-price__current {
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: 0.01em;
}

.ai-price__compare {
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--foreground);
  opacity: 0.45;
  text-decoration: line-through;
}

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

.ai-card__swatch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 12px;
  color: var(--foreground);
  cursor: pointer;
}

.ai-card__swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(44, 44, 44, 0.15);
  display: inline-block;
  transition: border-color 0.2s;
}

.ai-card__swatch:hover .ai-card__swatch-dot {
  border-color: var(--brand);
}

.ai-card__swatch-more {
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 12px;
  color: var(--foreground);
  opacity: 0.6;
}

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

.ai-card__stars {
  font-size: 13px;
  color: inherit;
}

.ai-card__reviews-count {
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 12px;
  color: var(--foreground);
  opacity: 0.55;
}

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

.ai-card__add-btn {
  width: 100%;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.ai-card__add-btn:hover {
  background: var(--striking);
  color: var(--striking-foreground);
  box-shadow: 0 4px 16px rgba(212, 49, 122, 0.28);
}

.ai-card__add-btn:active {
  transform: scale(0.98);
}

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

.ai-card__description {
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--foreground);
}

.ai-card__features {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ai-card__feature-item {
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  color: var(--foreground);
  line-height: 1.5;
}

.ai-card__back-link {
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-foreground);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: auto;
}

.ai-card__back-btn {
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

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

/* --------------------------------------------------------------------------
   Quick Add to Cart — Button State Styles
   -------------------------------------------------------------------------- */

/* Overlay button states */
ai-quick-add-cart[data-state="loading"] .ai-card__overlay-btn {
  opacity: 0.7;
  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 {
  animation: ai-card-shake 0.4s ease;
}

/* Info area button states */
ai-quick-add-cart[data-state="loading"] .ai-card__add-btn {
  opacity: 0.7;
  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;
}

/* Back button states */
ai-quick-add-cart[data-state="loading"] .ai-card__back-btn {
  opacity: 0.7;
  pointer-events: none;
}

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

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

@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); }
}

/* --------------------------------------------------------------------------
   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);
    gap: 20px;
  }
}

@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;
}

/* Arrow Buttons */
.ai-pl-prev,
.ai-pl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--background);
  color: var(--foreground);
  border: 1.5px solid rgba(44, 44, 44, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 10px rgba(44, 44, 44, 0.1);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

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

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

.ai-pl-prev:hover,
.ai-pl-next:hover {
  background: var(--brand);
  color: var(--brand-foreground);
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(168, 197, 176, 0.45);
}

.ai-pl-prev:active,
.ai-pl-next:active {
  transform: translateY(-50%) scale(0.95);
}

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

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

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 44, 44, 0.38);
  backdrop-filter: blur(3px);
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  background: var(--background);
  color: var(--foreground);
  border-radius: 20px;
  width: clamp(300px, 90vw, 700px);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(44, 44, 44, 0.18), 0 4px 16px rgba(44, 44, 44, 0.08);
  z-index: 1001;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

.qac-product-title {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.3;
  margin: 0;
  flex: 1;
  padding-right: 16px;
}

.qac-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--foreground);
  border: 1.5px solid rgba(44, 44, 44, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

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

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

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

.qac-product-media {
  width: 40%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--accent);
}

.qac-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.qac-product-info {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Footer */
.qac-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(168, 197, 176, 0.28);
  flex-shrink: 0;
}

/* Submit / Add-to-Cart Button */
.qac-submit {
  width: 100%;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 28px;
  padding: 14px 24px;
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, opacity 0.2s ease;
}

.qac-submit:hover:not(:disabled):not([data-loading]):not([data-success]):not([data-error]) {
  background: var(--striking);
  color: var(--striking-foreground);
  box-shadow: 0 6px 22px rgba(212, 49, 122, 0.32);
  transform: translateY(-1px);
}

.qac-submit:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

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

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

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

.qac-submit[data-success] {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: 0 4px 16px rgba(168, 197, 176, 0.4);
}

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

/* Responsive: stack modal on small screens */
@media (max-width: 600px) {
  .qac-modal {
    width: 94vw;
    max-height: 88vh;
    border-radius: 16px;
  }

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

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

  .qac-product-info {
    padding: 16px;
  }

  .qac-header {
    padding: 16px 18px 12px;
  }

  .qac-footer {
    padding: 12px 18px 16px;
  }
}