/* ai-product-card-generated.css — Obsidian-black luxury noir */
/* Phase 2 Color Contract: tokens are injected via ai-color-tokens.liquid in theme.liquid */

/* =====================================================================
   BASE CARD
   ===================================================================== */
.ai-card {
  background: var(--background);
  color: var(--foreground);
  border-radius: 4px;
  overflow: hidden;
  border: 0.5px solid var(--brand);
  position: relative;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.ai-card:hover {
  box-shadow: 0 0 24px 4px color-mix(in srgb, var(--brand) 35%, transparent);
  transform: translateY(-3px);
}

.ai-card__inner {
  position: relative;
}

.ai-card__front {
  /* front face — normal document flow */
}

/* =====================================================================
   IMAGE AREA
   ===================================================================== */
.ai-card__media {
  aspect-ratio: 3 / 4;
  /* relative + overflow-hidden preset by Tailwind */
}

/* Hover image swap */
.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;
}

/* =====================================================================
   BADGE
   ===================================================================== */
.ai-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  z-index: 3;
  font-family: 'Inter', 'Neue Haas Grotesk', sans-serif;
}

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

/* =====================================================================
   WISHLIST
   ===================================================================== */
.ai-card__wishlist {
  display: none;
}

/* =====================================================================
   OVERLAY — Hover slide-up Add-to-Cart
   ===================================================================== */
.ai-card__overlay {
  /* absolute inset-x-0 bottom-0 preset by Tailwind */
  background: var(--brand);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
  padding: 0;
}

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

.ai-card__overlay-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  color: var(--brand-foreground);
  border: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: 'Inter', 'Neue Haas Grotesk', sans-serif;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease, background 0.2s ease;
}

/* Gold shimmer sweep on hover */
.ai-card__overlay-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--brand-foreground) 25%, transparent),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.ai-card:hover .ai-card__overlay-btn::before {
  left: 150%;
}

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

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

/* =====================================================================
   INFORMATION AREA — hide add-wrap (we use overlay instead)
   ===================================================================== */
.ai-card__info {
  padding: 14px 14px 16px;
  gap: 6px;
  background: var(--background);
}

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

.ai-card__vendor {
  display: none;
}

.ai-card__title {
  font-family: 'Cormorant Garamond', 'Didot', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.02em;
}

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

.ai-price__current {
  font-family: 'Inter', 'Neue Haas Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-foreground);
  /* uses --brand-foreground as a readable foreground on --background surface
     pairing: text is styled with the brand accent tone via foreground token */
}

/* Override: use striking foreground when a compare price is present (sale) */
.ai-price:has(.ai-price__compare) .ai-price__current {
  color: var(--striking-foreground);
}

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

/* =====================================================================
   SWATCHES — hidden
   ===================================================================== */
.ai-card__swatches {
  display: none;
}

/* =====================================================================
   RATING — hidden
   ===================================================================== */
.ai-card__rating {
  display: none;
}

/* =====================================================================
   ADD-WRAP — hidden (using overlay instead)
   ===================================================================== */
.ai-card__add-wrap {
  display: none;
}

/* =====================================================================
   BACK SIDE — hidden (no flip effect used)
   ===================================================================== */
.ai-card__back {
  display: none;
}

/* =====================================================================
   ADD-TO-CART BUTTON STATE STYLES
   ===================================================================== */
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(--striking);
  color: var(--striking-foreground);
}

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

@keyframes qac-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
   ===================================================================== */
.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
   ===================================================================== */
.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%);
  z-index: 5;
  background: var(--brand);
  color: var(--brand-foreground);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--brand) 40%, transparent);
}

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

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

.ai-pl-prev:hover,
.ai-pl-next:hover,
.ai-pl-prev:focus,
.ai-pl-next:focus {
  background: var(--striking);
  color: var(--striking-foreground);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--striking) 50%, transparent);
  outline: none;
}

.ai-pl-prev:active,
.ai-pl-next:active {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* =====================================================================
   QUICK ADD-TO-CART MODAL (.qac-*)
   ===================================================================== */
.qac-wrapper[data-variant-mode="modal"] {
  /* root container appended to document.body */
}

/* Overlay */
.qac-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Modal container */
.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.97);
  width: min(700px, 92vw);
  max-height: 90vh;
  background: var(--background);
  color: var(--foreground);
  border: 0.5px solid var(--brand);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-shadow: 0 0 60px color-mix(in srgb, var(--brand) 20%, transparent);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

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

/* Header */
.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--brand);
  background: var(--background);
  flex-shrink: 0;
}

.qac-product-title {
  font-family: 'Cormorant Garamond', 'Didot', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: 0.03em;
  margin: 0;
}

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

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

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

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

/* Image side ~40% */
.qac-product-media {
  flex: 0 0 40%;
  max-width: 40%;
  overflow: hidden;
  background: var(--secondary);
}

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

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

/* Footer */
.qac-footer {
  padding: 16px 20px;
  border-top: 0.5px solid var(--brand);
  background: var(--background);
  flex-shrink: 0;
}

/* Submit button */
.qac-submit {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 3px;
  font-family: 'Inter', 'Neue Haas Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}

/* Gold shimmer sweep */
.qac-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--cta-foreground) 20%, transparent),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.qac-submit:not(:disabled):hover::before {
  left: 150%;
}

.qac-submit:not(:disabled):hover,
.qac-submit:not(:disabled):focus {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--brand) 45%, transparent);
  outline: none;
}

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

/* Disabled state */
.qac-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--background);
  color: var(--foreground);
  box-shadow: none;
}

/* Sold out */
.qac-submit[data-sold-out] {
  background: var(--background);
  color: var(--foreground);
  opacity: 0.5;
  cursor: not-allowed;
  border: 0.5px solid var(--brand);
}

/* Loading state */
.qac-submit[data-loading] {
  opacity: 0.65;
  pointer-events: none;
  background: var(--cta);
  color: var(--cta-foreground);
}

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

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

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 749px) {
  .qac-modal {
    width: min(96vw, 480px);
    max-height: 92vh;
  }

  .qac-body {
    flex-direction: column;
    overflow-y: auto;
  }

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

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

  .ai-card__title {
    font-size: 13px;
  }

  .ai-price__current {
    font-size: 13px;
  }

  .ai-card__info {
    padding: 10px 10px 12px;
    gap: 4px;
  }

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

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