/* ============================================================
   ai-product-card-generated.css
   Swimwear / Beach Fashion — Tropical Paradise Theme
   ============================================================ */

/* ------------------------------------------------------------
   1. Card Base
   ------------------------------------------------------------ */
.ai-card {
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(26, 58, 74, 0.12);
  background: var(--background);
  color: var(--foreground);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
}

.ai-card:hover {
  box-shadow: 0 8px 36px rgba(26, 58, 74, 0.22);
  transform: translateY(-4px);
}

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

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

/* 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;
}

/* ------------------------------------------------------------
   3. Badges
   ------------------------------------------------------------ */
.ai-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  z-index: 2;
  line-height: 1.4;
}

/* New badge */
.ai-card__badge--new {
  display: inline-flex;
  align-items: center;
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  z-index: 2;
}

/* ------------------------------------------------------------
   4. Wishlist Button
   ------------------------------------------------------------ */
.ai-card__wishlist {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 248, 240, 0.88);
  color: var(--foreground);
  border: none;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ai-card__wishlist:hover,
.ai-card__wishlist:focus {
  background: var(--brand);
  color: var(--brand-foreground);
  transform: scale(1.12);
  outline: none;
}

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

/* ------------------------------------------------------------
   5. Overlay — Slide-Up Add to Cart
   ------------------------------------------------------------ */
.ai-card__overlay {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  background: linear-gradient(to top, rgba(26, 58, 74, 0.72) 0%, transparent 100%);
  padding: 12px;
  z-index: 2;
}

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

.ai-card__overlay-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--cta);
  color: var(--cta-foreground);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

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

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

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

/* ------------------------------------------------------------
   6. Information 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,
.ai-card__info-link:focus {
  color: var(--brand-foreground);
  background: transparent;
  outline: none;
}

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

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

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

.ai-price__current {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-foreground);
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1.4;
}

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

/* ------------------------------------------------------------
   7. Swatches
   ------------------------------------------------------------ */
.ai-card__swatches {
  display: flex;
  padding-top: 2px;
}

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

.ai-card__swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(26, 58, 74, 0.15);
  display: block;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.ai-card__swatch-more {
  font-size: 11px;
  color: var(--foreground);
  opacity: 0.65;
  font-weight: 600;
  padding: 0 4px;
  align-self: center;
}

/* ------------------------------------------------------------
   8. Rating
   ------------------------------------------------------------ */
.ai-card__rating {
  display: flex;
}

.ai-card__stars {
  font-size: 13px;
  color: var(--striking-foreground);
  background: var(--striking);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
}

.ai-card__reviews-count {
  font-size: 11px;
  color: var(--foreground);
  opacity: 0.6;
}

/* ------------------------------------------------------------
   9. Back Side (disabled — no flip effect for this design)
   ------------------------------------------------------------ */
.ai-card__back {
  display: none;
}

/* ------------------------------------------------------------
   10. Add-to-cart State Styles (Overlay Button)
   ------------------------------------------------------------ */
ai-quick-add-cart[data-state="loading"] .ai-card__overlay-btn {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
}

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

ai-quick-add-cart[data-state="error"] .ai-card__overlay-btn {
  background: var(--brand);
  color: var(--brand-foreground);
  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); }
}

/* CTA golden shimmer pulse */
@keyframes ai-cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
}

.ai-card__overlay-btn {
  animation: ai-cta-pulse 2.4s ease-in-out infinite;
}

/* ------------------------------------------------------------
   11. Product List — Grid Layout
   ------------------------------------------------------------ */
.ai-pl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 750px) {
  .ai-pl-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  .ai-pl-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* ------------------------------------------------------------
   12. 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: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--brand-foreground);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(26, 58, 74, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

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

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

.ai-pl-prev:hover,
.ai-pl-prev:focus,
.ai-pl-next:hover,
.ai-pl-next:focus {
  background: var(--secondary);
  color: var(--secondary-foreground);
  transform: translateY(-50%) scale(1.1);
  outline: none;
}

.ai-pl-prev:active,
.ai-pl-next:active {
  background: var(--striking);
  color: var(--striking-foreground);
  transform: translateY(-50%) scale(0.96);
}

/* ------------------------------------------------------------
   13. QAC Modal
   ------------------------------------------------------------ */
.qac-wrapper {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 58, 74, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
}

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(720px, 92vw);
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(26, 58, 74, 0.3);
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* QAC Header */
.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(26, 58, 74, 0.1);
  background: var(--brand);
  color: var(--brand-foreground);
}

.qac-product-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-foreground);
}

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

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

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

.qac-product-media {
  flex: 0 0 40%;
  min-height: 260px;
  overflow: hidden;
  background: #f0ede8;
}

.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 */
.qac-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(26, 58, 74, 0.1);
  background: var(--background);
}

.qac-submit {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: var(--cta);
  color: var(--cta-foreground);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  animation: ai-cta-pulse 2.4s ease-in-out infinite;
}

.qac-submit:hover,
.qac-submit:focus {
  background: var(--brand);
  color: var(--brand-foreground);
  transform: scale(1.02);
  outline: none;
}

.qac-submit:active {
  transform: scale(0.98);
  background: var(--accent);
  color: var(--accent-foreground);
}

.qac-submit:disabled {
  opacity: 0.4;
  background: var(--background);
  color: var(--foreground);
  cursor: not-allowed;
  pointer-events: none;
  animation: none;
  transform: none;
}

/* QAC Submit States */
.qac-submit[data-loading] {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
  animation: none;
}

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

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

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

/* ------------------------------------------------------------
   14. Responsive Adjustments
   ------------------------------------------------------------ */
@media (max-width: 749px) {
  .ai-card {
    border-radius: 12px;
  }

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

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

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

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

  .qac-product-media {
    flex: none;
    height: 220px;
    min-height: unset;
  }

  .qac-modal {
    width: 96vw;
  }

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

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