/* ai-product-card-generated.css — Fire Service Training & Professional Certification */

/* ============================================================
   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-wrap {
  position: relative;
}

.ai-pl-carousel {
  display: flex;
  overflow: hidden;
}

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

.ai-pl-prev,
.ai-pl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: var(--brand);
  color: var(--brand-foreground);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

.ai-pl-prev {
  left: 0;
}

.ai-pl-next {
  right: 0;
}

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

/* ============================================================
   CARD — BASE
   ============================================================ */

.ai-card {
  background: var(--background);
  color: var(--foreground);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.12);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
}

.ai-card:hover {
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.22);
  transform: translateY(-2px);
}

/* ============================================================
   CARD — IMAGE AREA
   ============================================================ */

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

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

/* ============================================================
   CARD — DISCOUNT BADGE
   ============================================================ */

.ai-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-family: 'Barlow Condensed', 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  line-height: 1.4;
  z-index: 2;
}

/* New badge — hidden by default, shown when present */
.ai-card__badge--new {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--striking);
  color: var(--striking-foreground);
  font-family: 'Barlow Condensed', 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  z-index: 2;
}

/* ============================================================
   CARD — WISHLIST BUTTON (hidden by default)
   ============================================================ */

.ai-card__wishlist {
  display: none;
}

/* ============================================================
   CARD — OVERLAY (slide-up add to cart)
   ============================================================ */

.ai-card__overlay {
  background: linear-gradient(transparent, rgba(17, 24, 39, 0.72));
  transform: translateY(100%);
  transition: transform 0.28s ease;
  padding: 12px;
}

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

.ai-card__overlay-btn {
  width: 100%;
  padding: 10px 16px;
  background: var(--cta);
  color: var(--cta-foreground);
  font-family: 'Barlow Condensed', 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

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

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

/* ============================================================
   CARD — INFO AREA
   ============================================================ */

.ai-card__info {
  padding: 12px;
  gap: 6px;
  background: var(--background);
  color: var(--foreground);
}

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

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

.ai-card__title {
  font-family: 'Barlow Condensed', 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: inherit;
  line-height: 1.3;
}

/* ============================================================
   CARD — PRICE
   ============================================================ */

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

.ai-price__current {
  font-family: 'Barlow Condensed', 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: inherit;
}

.ai-price__compare {
  font-size: 13px;
  text-decoration: line-through;
  opacity: 0.55;
  color: inherit;
}

/* ============================================================
   CARD — SWATCHES (hidden by default)
   ============================================================ */

.ai-card__swatches {
  display: none;
}

/* ============================================================
   CARD — RATING (hidden by default)
   ============================================================ */

.ai-card__rating {
  display: none;
}

/* ============================================================
   CARD — ADD WRAP (inside info area — hidden; using overlay instead)
   ============================================================ */

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

/* ============================================================
   CARD — BACK SIDE (hidden — not using flip effect)
   ============================================================ */

.ai-card__back {
  display: none;
}

/* ============================================================
   ADD-TO-CART STATE FEEDBACK — OVERLAY BUTTON
   ============================================================ */

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

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

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

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

.qac-wrapper {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.qac-wrapper[data-open] {
  opacity: 1;
  pointer-events: auto;
}

.qac-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.65);
  z-index: 9998;
}

.qac-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 90vw;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--background);
  color: var(--foreground);
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, 0.35);
  display: flex;
  flex-direction: column;
}

/* Header */
.qac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--brand);
  color: var(--brand-foreground);
  border-radius: 4px 4px 0 0;
}

.qac-product-title {
  font-family: 'Barlow Condensed', 'Oswald', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-foreground);
}

.qac-close {
  background: transparent;
  border: none;
  color: var(--brand-foreground);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}

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

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

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

.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);
}

/* Footer */
.qac-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(28, 30, 33, 0.1);
  background: var(--background);
}

.qac-submit {
  width: 100%;
  padding: 12px 20px;
  background: var(--cta);
  color: var(--cta-foreground);
  font-family: 'Barlow Condensed', 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

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

.qac-submit:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.qac-submit[data-sold-out] {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--secondary);
  color: var(--secondary-foreground);
}

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

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

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

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

  .qac-product-media {
    width: 100%;
    height: 200px;
  }
}