/* ============================================================
   ai-product-card-generated.css
   Design: Tropical Resort Swimwear — Coral × Deep Sea Blue
   ============================================================ */

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

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

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

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

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

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

/* ----------------------------------------------------------
   Card Root
   ---------------------------------------------------------- */
.ai-card {
  background: var(--background); color: var(--foreground);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(26, 95, 122, 0.10);
  transition: box-shadow 0.3s, transform 0.3s;
  position: relative;
}

.ai-card:hover {
  box-shadow: 0 8px 32px rgba(26, 95, 122, 0.18);
  transform: translateY(-4px);
}

/* ----------------------------------------------------------
   Inner / Front / Back
   ---------------------------------------------------------- */
.ai-card__inner {
  position: relative;
}

.ai-card__front {
  position: relative;
}

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

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

/* Hover image swap */
.ai-card__img--hover {
  opacity: 0;
  transition: opacity 0.4s 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.4s ease;
}

/* ----------------------------------------------------------
   Badges
   ---------------------------------------------------------- */
.ai-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--brand);
  color: var(--brand-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(232, 96, 60, 0.25);
}

.ai-card__badge--new {
  display: inline-block;
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--striking);
  color: var(--striking-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 201, 167, 0.30);
}

/* ----------------------------------------------------------
   Wishlist Button
   ---------------------------------------------------------- */
.ai-card__wishlist {
  display: flex;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(253, 248, 242, 0.85);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
}

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

.ai-card__wishlist svg {
  width: 18px;
  height: 18px;
 
  fill: none;
  stroke-width: 2;
  transition: stroke 0.2s, fill 0.2s;
}

.ai-card__wishlist:hover svg {
  stroke: var(--brand-foreground);
  fill: var(--brand-foreground);
}

/* ----------------------------------------------------------
   Hover Overlay (Slide-Up Add to Cart)
   ---------------------------------------------------------- */
.ai-card__overlay {
  display: block;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(transparent, rgba(26, 95, 122, 0.55));
  padding: 16px 12px 12px;
}

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

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

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

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

/* 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(--striking);
  color: var(--striking-foreground);
}

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

/* ----------------------------------------------------------
   Info Area (hidden add-to-cart wrap in info)
   ---------------------------------------------------------- */
.ai-card__info {
  padding: 14px 12px 12px;
  gap: 6px;
}

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

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

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

.ai-card__title {
  font-family: 'Bebas Neue', 'Futura', 'Arial Black', 'Impact', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--foreground);
  line-height: 1.25;
  display: block;
  margin-bottom: 2px;
}

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

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

.ai-price__current {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-foreground);
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

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

/* ----------------------------------------------------------
   Swatches — show for swimwear
   ---------------------------------------------------------- */
.ai-card__swatches {
  display: flex;
  margin-top: 2px;
}

.ai-card__swatch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.ai-card__swatch:hover {
  background: var(--accent); color: var(--accent-foreground);
}

.ai-card__swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(26, 95, 122, 0.20);
  display: inline-block;
  transition: border-color 0.2s, transform 0.2s;
}

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

.ai-card__swatch-more {
  font-size: 12px;
  color: var(--foreground);
  opacity: 0.6;
  align-self: center;
  padding: 2px 4px;
}

/* ----------------------------------------------------------
   Rating — show for swimwear
   ---------------------------------------------------------- */
.ai-card__rating {
  display: flex;
  margin-top: 2px;
}

.ai-card__stars {
  font-size: 13px;
  color: var(--accent-foreground);
  background: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
}

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

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

/* ----------------------------------------------------------
   Quick Add-to-Cart Modal (.qac-*)
   ---------------------------------------------------------- */
.qac-wrapper[data-variant-mode="modal"] {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

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

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

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 95, 122, 0.45);
  backdrop-filter: blur(3px);
}

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  max-height: 90vh;
  border-radius: 20px;
  background: var(--background);
  color: var(--foreground);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(26, 95, 122, 0.22);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Header */
.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(26, 95, 122, 0.12);
  background: var(--secondary);
  color: var(--secondary-foreground);
  flex-shrink: 0;
}

.qac-product-title {
  font-family: 'Bebas Neue', 'Futura', 'Arial Black', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--secondary-foreground);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 48px);
}

.qac-close {
  background: rgba(253, 248, 242, 0.15);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--secondary-foreground);
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
  line-height: 1;
}

.qac-close:hover {
  background: rgba(253, 248, 242, 0.30);
  transform: rotate(90deg);
}

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

.qac-product-media {
  width: 40%;
  flex-shrink: 0;
  background: #e8f4f8;
  overflow: hidden;
}

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

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

/* Footer */
.qac-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(26, 95, 122, 0.10);
  flex-shrink: 0;
  background: var(--background); color: var(--foreground);
}

.qac-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--cta);
  color: var(--cta-foreground);
  border: none;
  border-radius: 12px;
  font-family: 'Bebas Neue', 'Futura', 'Arial Black', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.qac-submit:hover:not(:disabled):not([data-loading]):not([data-success]):not([data-error]) {
  background: var(--brand);
  color: var(--brand-foreground);
  transform: scale(1.01);
}

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

.qac-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--cta);
  color: var(--cta-foreground);
}

.qac-submit[data-sold-out] {
  opacity: 0.5;
  cursor: not-allowed;
  background: #aaa;
 
}

.qac-submit[data-loading] {
  opacity: 0.7;
  pointer-events: none;
  background: var(--secondary);
  color: var(--secondary-foreground);
}

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

.qac-submit[data-error] {
  background: #c0392b;
 
  animation: shake 0.4s;
}

/* Responsive: stack on small screens */
@media (max-width: 600px) {
  .qac-body {
    flex-direction: column;
    overflow-y: auto;
  }

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

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

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

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

  .qac-modal {
    border-radius: 16px 16px 0 0;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    max-height: 90vh;
  }

  .qac-wrapper:not([data-open]) .qac-modal {
    transform: translateY(40px);
    opacity: 0;
  }

  .qac-wrapper[data-open] .qac-modal {
    transform: translateY(0);
    opacity: 1;
  }
}