/* ============================================================
   ai-product-card-generated.css
   Fashion — Minimalist Editorial / Monochromatic Luxury
   Global CSS decorator for ai-product-card skeleton
   ============================================================ */

/* ── Color role mapping ─────────────────────────────────────
   --brand-color     : #1A1A1A  (Ink Black)
   --secondary-color : #F5F5F5  (Soft Ivory)
   --accent-color    : #B8936A  (Warm Champagne – emphasis)
   --striking-color  : #C8A882  (Warm Champagne – CTA / decorative)
   --text-color      : #1A1A1A
   --bg-color        : #FFFFFF
   ─────────────────────────────────────────────────────────── */

/* ============================================================
   1. CARD – Base Structure
   ============================================================ */

.ai-card {
  background-color: var(--bg-color);
  overflow: hidden;
  border-radius: 0;
  border: 1px solid color-mix(in srgb, var(--brand-color) 8%, transparent);
  transition: border-color 0.3s ease;
  position: relative;
}

.ai-card:hover {
  border-color: color-mix(in srgb, var(--brand-color) 22%, transparent);
}

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

/* ============================================================
   2. CARD – Image / Media Area
   ============================================================ */

.ai-card__media {
  aspect-ratio: 3 / 4;
  background-color: var(--secondary-color);
}

/* Main image transition for swap */
.ai-card__img {
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.35s ease;
}

.ai-card:hover .ai-card__img {
  transform: scale(1.04);
}

/* Hover image – hidden by default, no Tailwind redeclaration */
.ai-card__img--hover {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.ai-card:hover .ai-card__img--hover {
  opacity: 1;
}

/* Only hide main image when a second image actually exists */
.ai-card[data-has-hover-img]:hover .ai-card__img {
  opacity: 0;
}

/* ============================================================
   3. CARD – Badges
   ============================================================ */

/* Discount badge – visible by default */
.ai-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background-color: var(--brand-color);
  color: var(--text-color);
  font-family: 'Lato', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 0;
  pointer-events: none;
}

/* New badge – hidden by default; revealed here for fashion context */
.ai-card__badge--new {
  display: inline-flex;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  font-family: 'Lato', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  pointer-events: none;
}

/* ============================================================
   4. CARD – Wishlist Button
   ============================================================ */

/* Show wishlist – suitable for lifestyle / fashion brands */
.ai-card__wishlist {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  background-color: var(--bg-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

/* Shift wishlist left when "New" badge is also visible */
.ai-card__badge--new ~ .ai-card__wishlist {
  right: 10px;
}

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

.ai-card__wishlist:hover {
  background-color: var(--secondary-color);
}

.ai-card__wishlist svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-color);
  fill: none;
  transition: stroke 0.2s ease, fill 0.2s ease;
}

.ai-card__wishlist:hover svg,
.ai-card__wishlist[aria-pressed="true"] svg {
  stroke: var(--striking-color);
  fill: color-mix(in srgb, var(--striking-color) 15%, transparent);
}

/* ============================================================
   5. CARD – Overlay (Hover Slide-up Add-to-Cart)
   ============================================================ */

.ai-card__overlay {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background-color: color-mix(in srgb, var(--bg-color) 96%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--brand-color) 10%, transparent);
  padding: 10px 12px;
}

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

/* Overlay Add-to-Cart button */
.ai-card__overlay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  background-color: var(--brand-color);
  color: var(--text-color);
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

/* ============================================================
   6. CARD – Info Area
   ============================================================ */

.ai-card__info {
  padding: 14px 14px 16px;
  gap: 6px;
  background-color: var(--bg-color);
}

/* Info link – remove default underline */
.ai-card__info-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Vendor name – hidden by default (single-brand store) */
.ai-card__vendor {
  display: none;
}

/* Product title */
.ai-card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-color);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

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

/* ============================================================
   7. CARD – Price
   ============================================================ */

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

.ai-price__current {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.02em;
}

.ai-price__compare {
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: color-mix(in srgb, var(--text-color) 45%, transparent);
  text-decoration: line-through;
}

/* Sale state — accent the sale price */
.ai-price--sale .ai-price__current {
  color: var(--accent-color);
}

/* ============================================================
   8. CARD – Swatches (Shown for fashion/apparel)
   ============================================================ */

.ai-card__swatches {
  display: flex;
  margin-top: 2px;
}

.ai-card__swatch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.ai-card__swatch-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--brand-color) 15%, transparent);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ai-card__swatch:hover .ai-card__swatch-dot {
  border-color: var(--accent-color);
  transform: scale(1.15);
}

.ai-card__swatch[aria-selected="true"] .ai-card__swatch-dot,
.ai-card__swatch.active .ai-card__swatch-dot {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 3px var(--brand-color);
}

.ai-card__swatch-more {
  font-family: 'Lato', sans-serif;
  font-size: 11px;
  color: color-mix(in srgb, var(--text-color) 55%, transparent);
  align-self: center;
  margin-left: 2px;
}

/* ============================================================
   9. CARD – Rating (Hidden by default; re-enable here)
   ============================================================ */

/* Rating is hidden for this minimal editorial style */
.ai-card__rating {
  display: none;
}

/* ============================================================
   10. CARD – Add-to-Cart Inside Info Area (Hidden — using overlay)
   ============================================================ */

.ai-card__add-wrap {
  display: none;
}

/* ============================================================
   11. CARD – Back Side (Disabled — no flip effect)
   ============================================================ */

.ai-card__back {
  display: none;
}

/* ============================================================
   12. CARD – Add-to-Cart Button State Feedback (Overlay)
   ============================================================ */

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-color: var(--accent-color);
  color: var(--text-color);
  pointer-events: none;
}

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

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

/* ============================================================
   13. QUICK ADD-TO-CART MODAL (.qac-*)
   ============================================================ */

/* Wrapper – appended to document.body */
.qac-wrapper[data-variant-mode="modal"] {
  /* Initial / exit state */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.qac-wrapper[data-variant-mode="modal"][data-open] {
  opacity: 1;
  pointer-events: auto;
}

/* Overlay */
.qac-overlay {
  position: fixed;
  inset: 0;
  background-color: color-mix(in srgb, var(--brand-color) 45%, transparent);
  z-index: 9998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Modal container */
.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  z-index: 9999;
  width: min(720px, 92vw);
  max-height: 90vh;
  background-color: var(--bg-color);
  border: 1px solid color-mix(in srgb, var(--brand-color) 12%, transparent);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.3s ease;
}

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

/* Header */
.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--brand-color) 10%, transparent);
  flex-shrink: 0;
}

.qac-product-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--text-color);
  letter-spacing: 0.01em;
  margin: 0;
}

.qac-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.qac-close:hover {
  opacity: 1;
  color: var(--accent-color);
}

.qac-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

/* Body – side-by-side layout */
.qac-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Product image – ~40% */
.qac-product-media {
  width: 40%;
  flex-shrink: 0;
  background-color: var(--secondary-color);
  overflow: hidden;
}

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

/* Options area */
.qac-product-info {
  flex: 1;
  padding: 24px 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Footer */
.qac-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid color-mix(in srgb, var(--brand-color) 10%, transparent);
  flex-shrink: 0;
  background-color: var(--bg-color);
}

/* Submit / Add-to-Cart button */
.qac-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  background-color: var(--brand-color);
  color: var(--text-color);
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--brand-color);
  cursor: pointer;
  transition: background-color 0.25s ease,
              border-color 0.25s ease,
              color 0.25s ease,
              opacity 0.2s ease;
}

.qac-submit:hover:not(:disabled):not([data-loading]):not([data-success]):not([data-sold-out]) {
  background-color: var(--striking-color);
  border-color: var(--striking-color);
  color: var(--text-color);
}

.qac-submit:active:not(:disabled) {
  opacity: 0.85;
}

/* Disabled – before variant selection is complete */
.qac-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background-color: color-mix(in srgb, var(--brand-color) 50%, transparent);
  border-color: color-mix(in srgb, var(--brand-color) 50%, transparent);
  color: var(--text-color);
}

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

/* Success state */
.qac-submit[data-success] {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--text-color);
  pointer-events: none;
}

/* Error state */
.qac-submit[data-error] {
  background-color: var(--brand-color);
  border-color: var(--brand-color);
  color: var(--text-color);
  animation: qac-shake 0.4s ease;
}

/* Sold-out state */
.qac-submit[data-sold-out] {
  background-color: var(--secondary-color);
  border-color: color-mix(in srgb, var(--brand-color) 20%, transparent);
  color: color-mix(in srgb, var(--text-color) 50%, transparent);
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Modal responsive (mobile: stacked layout) ───────────── */
@media (max-width: 600px) {
  .qac-modal {
    width: 100vw;
    max-height: 92vh;
    top: auto;
    left: 0;
    bottom: 0;
    transform: translateY(30px);
    border-radius: 12px 12px 0 0;
  }

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

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

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

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

/* ============================================================
   14. PRODUCT LIST LAYOUT
   ============================================================ */

/* Grid – mobile first (2 columns) */
.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;
  }
}

/* Carousel – required layout */
.ai-pl-carousel {
  display: flex;
  overflow: hidden;
}

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

/* Carousel wrapper */
.ai-pl-carousel-wrap {
  position: relative;
}

/* Prev / Next arrow buttons */
.ai-pl-prev,
.ai-pl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--bg-color);
  border: 1px solid color-mix(in srgb, var(--brand-color) 20%, transparent);
  cursor: pointer;
  transition: background-color 0.25s ease,
              border-color 0.25s ease,
              color 0.25s ease;
  color: var(--text-color);
}

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

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

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

.ai-pl-prev svg,
.ai-pl-next svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

/* ── Responsive arrow fallback on mobile ─────────────────── */
@media (max-width: 749px) {
  .ai-pl-prev {
    left: 4px;
  }
  .ai-pl-next {
    right: 4px;
  }
}

/* ============================================================
   15. TYPOGRAPHY IMPORTS
   (Playfair Display + Lato via Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;600;700&family=Playfair+Display:wght@400;500&display=swap');