/* ============================================================
   ai-product-card-generated.css
   Design: Warm Minimalist / Home & Decor
   ============================================================ */

/* ------------------------------------------------------------
   1. Base Card
   ------------------------------------------------------------ */
.ai-card {
  background: var(--background);
  color: var(--foreground);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(46, 40, 37, 0.08);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ai-card:hover {
  box-shadow: 0 6px 24px rgba(46, 40, 37, 0.14);
  transform: translateY(-2px);
}

.ai-card__inner {
  /* no transforms needed for non-flip layout */
}

/* ------------------------------------------------------------
   2. Image Area
   ------------------------------------------------------------ */
.ai-card__media {
  aspect-ratio: 3 / 4;
}

/* Hover image cross-fade */
.ai-card__img--hover {
  opacity: 0;
  transition: opacity 0.3s 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.3s ease;
}

/* ------------------------------------------------------------
   3. Badges
   ------------------------------------------------------------ */
.ai-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.4;
  z-index: 2;
}

/* New badge — hidden by default, show when present */
.ai-card__badge--new {
  display: none;
}

.ai-card__badge--new[style],
.ai-card__badge--new:not([style=""]) {
  display: inline-block;
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.4;
  z-index: 2;
}

/* ------------------------------------------------------------
   4. Wishlist — hidden by default
   ------------------------------------------------------------ */
.ai-card__wishlist {
  display: none;
}

/* ------------------------------------------------------------
   5. Overlay (slide-up add-to-cart)
   ------------------------------------------------------------ */
.ai-card__overlay {
  transform: translateY(100%);
  transition: transform 0.3s ease;
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: 10px;
}

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

.ai-card__overlay-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

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

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

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

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

/* Vendor — hidden by default */
.ai-card__vendor {
  display: none;
}

.ai-card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--foreground);
  margin: 0;
}

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

.ai-price__current {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
}

.ai-price__compare {
  font-size: 13px;
  color: var(--secondary-foreground);
  text-decoration: line-through;
  opacity: 0.7;
}

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

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

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

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

/* ------------------------------------------------------------
   8. Add-to-Cart Button State Styles
   ------------------------------------------------------------ */
ai-quick-add-cart[data-state="loading"] .ai-card__overlay-btn {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

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

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

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

/* ------------------------------------------------------------
   9. Product List – Grid Mode
   ------------------------------------------------------------ */
.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;
  }
}

/* ------------------------------------------------------------
   10. Product List – Carousel Mode
   ------------------------------------------------------------ */
.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%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 10;
  transition: background 0.2s ease, color 0.2s 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: var(--brand);
}

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

/* ------------------------------------------------------------
   11. Quick Add-to-Cart Modal (.qac-*)
   ------------------------------------------------------------ */
.qac-wrapper[data-variant-mode="modal"] {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qac-wrapper[data-variant-mode="modal"][data-open] {
  opacity: 1;
  visibility: visible;
}

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46, 40, 37, 0.4);
  z-index: 1000;
}

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(700px, 92vw);
  max-height: 90vh;
  background: var(--background);
  color: var(--foreground);
  border-radius: 12px;
  overflow: hidden;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(46, 40, 37, 0.18);
}

.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--secondary);
  background: var(--background);
  color: var(--foreground);
}

.qac-product-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
  line-height: 1.4;
}

.qac-close {
  background: transparent;
  color: var(--foreground);
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 20px;
  transition: background 0.2s ease, color 0.2s ease;
}

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

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

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

.qac-product-media {
  flex: 0 0 40%;
  background: var(--secondary);
}

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

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

.qac-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--secondary);
  background: var(--background);
}

.qac-submit {
  display: block;
  width: 100%;
  padding: 13px 20px;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.qac-submit:hover {
  background: var(--striking);
  color: var(--striking-foreground);
}

.qac-submit:active {
  opacity: 0.88;
}

.qac-submit:disabled,
.qac-submit[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--secondary);
  color: var(--secondary-foreground);
}

/* Modal add-to-cart states */
.qac-submit[data-loading] {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

.qac-submit[data-success] {
  background: var(--accent);
  color: var(--accent-foreground);
}

.qac-submit[data-error] {
  background: var(--striking);
  color: var(--striking-foreground);
}

/* Sold-out state */
.qac-submit[data-sold-out] {
  background: var(--secondary);
  color: var(--secondary-foreground);
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

/* Mobile modal adjustment */
@media (max-width: 600px) {
  .qac-body {
    flex-direction: column;
  }

  .qac-product-media {
    flex: 0 0 200px;
  }
}