/**
 * Universal Smyths Toys Product Card Styles
 * Used across: Category, Shop, Product Tag, Brand, Search, and Infinite Scroll
 */

@keyframes smythsImgShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes plpRowGlideRight {
  0% {
    opacity: 0;
    transform: translate3d(32px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Base Card */
.smyths-plp-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.smyths-plp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  border-color: #D1D5DB;
}

/* Wishlist Heart Button */
.smyths-card-wishlist-wrapper {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}

.smyths-card-heart-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  color: #0072CE;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  padding: 0;
}

.smyths-card-heart-btn:hover,
.smyths-card-heart-btn.active-wishlist {
  background: #FEE2E2;
  color: #E31B23;
  border-color: #FECACA;
}

/* Link Wrap */
.smyths-card-link-wrap {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  color: inherit;
}

/* Aspect Square Image Box */
.smyths-card-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.smyths-card-img-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(241, 245, 249, 0.4) 0%, rgba(226, 232, 240, 0.7) 50%, rgba(241, 245, 249, 0.4) 100%);
  background-size: 200% 100%;
  animation: smythsImgShimmer 1.5s infinite;
  pointer-events: none;
  z-index: 1;
}

.smyths-card-img-box.img-loaded::before {
  display: none;
}

.smyths-card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.smyths-plp-card:hover .smyths-card-img {
  transform: scale(1.04);
}

/* Card Body */
.smyths-card-body {
  padding: 10px 12px 6px 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Decal Area & Badge */
.smyths-card-decal-area {
  min-height: 22px;
  margin-bottom: 4px;
}

.smyths-card-decal-badge {
  display: inline-flex;
  align-items: center;
  background-color: #BB1D29;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #ffffff;
}

/* Brand Wrap (Logo + Label) */
.smyths-card-brand-wrap {
  min-height: 18px;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.smyths-card-brand-logo {
  max-height: 18px;
  max-width: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.smyths-card-brand-label {
  font-family: var(--smyths-font-family, system-ui, -apple-system, sans-serif);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Product Title */
.smyths-card-product-title {
  font-family: var(--smyths-font-family, system-ui, -apple-system, sans-serif);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #111827;
  margin-bottom: 8px;
  height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Variation Badges */
.smyths-card-variation-badges {
  margin-bottom: 4px;
}

/* Price Section */
.smyths-card-price-section {
  padding: 0 12px 8px 12px;
  margin-top: auto;
}

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

.smyths-price-main {
  font-size: 1.22rem;
  font-weight: 900;
  color: #C8102E;
  letter-spacing: -0.02em;
}

.smyths-price-main .smyths-currency {
  font-size: 0.88rem;
  font-weight: 700;
}

.smyths-price-was {
  font-size: 0.82rem;
  color: #6B7280;
}

.smyths-was-price {
  text-decoration: line-through;
}

/* Action Box & Pill Button */
.smyths-card-action-box {
  padding: 0 12px 14px 12px;
}

.smyths-add-pill-btn {
  width: 100%;
  height: 40px;
  border: 2px solid #008744 !important;
  color: #008744 !important;
  background: transparent !important;
  font-weight: 700 !important;
  border-radius: 9999px !important;
  font-size: 0.92rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
}

.smyths-add-pill-btn:hover {
  background: #008744 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 135, 68, 0.25) !important;
}

/* Card Arrival Animations */
.plp-row-arrive {
  animation: plpRowGlideRight 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}

.plp-scroll-anim {
  opacity: 0;
  transform: translate3d(32px, 0, 0);
  will-change: transform, opacity;
}

.plp-scroll-anim.is-visible {
  animation: plpRowGlideRight 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 991.98px) {
  .plp-row-arrive:nth-child(-n+2) { animation-delay: 0s; }
  .plp-row-arrive:nth-child(n+3):nth-child(-n+4) { animation-delay: 0.08s; }
  .plp-row-arrive:nth-child(n+5):nth-child(-n+6) { animation-delay: 0.16s; }
}

@media (min-width: 992px) {
  .plp-row-arrive:nth-child(-n+3) { animation-delay: 0s; }
  .plp-row-arrive:nth-child(n+4):nth-child(-n+6) { animation-delay: 0.09s; }
}

@media (prefers-reduced-motion: reduce) {
  .plp-row-arrive,
  .plp-scroll-anim {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
