/* Clean spacing + “functional minimalism” */
.shop-hero {
  padding: 14px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: rgba(13, 110, 253, 0.03);
}

.trust-pill {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

/* Card */
.shop-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  .shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.1);
  }
}

/* Image wrap with consistent height */
.shop-imgwrap {
  position: relative;
  background: #fff;
  padding: 10px;
  min-height: 190px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fixed: .shop-imglink must have explicit height for absolute children */
.shop-imglink {
  position: relative;
  width: 100%;
  height: 180px;
  display: block;
}

/* All images inside are absolutely positioned */
.shop-img,
.shop-img-primary,
.shop-img-secondary {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.18s ease;
}

.shop-img-primary {
  opacity: 1;
  z-index: 1;
}

.shop-img-secondary {
  opacity: 0;
  z-index: 2;
}

@media (hover: hover) {
  .shop-card.has-secondary:hover .shop-img-primary {
    opacity: 0;
  }
  .shop-card.has-secondary:hover .shop-img-secondary {
    opacity: 1;
  }
}

/* Smart badge (e.g., "New", "Bestseller") – top-left */
.shop-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  border-radius: 999px;
  padding: 0.4rem 0.6rem;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #495057;
}

/* Quick view button (above images) */
.shop-quickview {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.15s ease;
  background: #fff;
  padding: 0.4rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

@media (hover: hover) {
  .shop-card:hover .shop-quickview {
    opacity: 1;
    transform: translateY(0);
  }
}

.shop-title a {
  color: inherit;
  text-decoration: none;
}

.shop-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #6c757d;
  font-size: 0.92rem;
  line-height: 1.4;
}

/* Prices */
.shop-price-old {
  font-size: 0.85rem;
  line-height: 1.1;
  color: #888;
  text-decoration: line-through;
}

/* ✅ Small, snug discount badge – top right */
.shop-badge-discount {
  left: 12px !important;
  right: auto !important;
  position: absolute;
  top: 12px;

  /* Prevent layout interference from other rules */

  width: auto !important;

  display: inline-flex;
  align-items: center;

  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;

  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1;

  color: #fff;
  background: linear-gradient(135deg, #ff1b6b 0%, #ff8a00 55%, #ffd400 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);

  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.18);
  transform: rotate(-4deg);
}

/* Lighter shine effect */
.shop-badge-discount::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.28) 35%,
    rgba(255, 255, 255, 0) 70%);
  transform: translateX(-120%);
  animation: badgeShine 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes badgeShine {
  0%, 40% { transform: translateX(-120%); opacity: 0; }
  55%     { opacity: 1; }
  70%, 100%{ transform: translateX(120%); opacity: 0; }
}

/* Subtle pulse animation (respects user preference) */
@media (prefers-reduced-motion: no-preference) {
  .shop-badge-discount {
    animation: badgePop 2.2s ease-in-out infinite;
  }
  @keyframes badgePop {
    0%, 100% { transform: rotate(-4deg) scale(1); }
    50%      { transform: rotate(-4deg) scale(1.04); }
  }
}

/* ✅ Percentage-off chip (e.g., "-30%") – classy inline companion */
.shop-badge-off {
  margin-left: 0.45rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  line-height: 1;
  color: #fff;
  backdrop-filter: blur(2px);
}

/* Cart wiggle micro-interaction */
@keyframes cartWiggle {
  0%   { transform: rotate(0); }
  25%  { transform: rotate(-10deg); }
  50%  { transform: rotate(10deg); }
  75%  { transform: rotate(-6deg); }
  100% { transform: rotate(0); }
}

.cart-wiggle {
  animation: cartWiggle 0.55s ease;
}


/* ✅ Preview button overlay INSIDE product image (like screenshot) */
.shop-imgwrap { position: relative; }

.shop-imgwrap .shop-quickview{
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 8;

  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);

  opacity: 0;
  transform: translateY(6px);
  transition: all .15s ease;
}

/* show on hover (your cards are .card, not .shop-card) */
.card:hover .shop-imgwrap .shop-quickview{
  opacity: 1;
  transform: translateY(0);
}

/* on phones/tablets (no hover), keep it visible */
@media (max-width: 768px){
  .shop-imgwrap .shop-quickview{
    opacity: 1;
    transform: none;
  }
}

/* ---------- FIX: Preview button inside product image (like screenshot) ---------- */
.shop-imgwrap{
  position: relative;
  background: #fff;
}

.shop-imglink{
  display: block;
  height: 200px;
}

.shop-imgwrap .shop-img{
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Sale badge inside image (top-left) */
.shop-badge-discount{
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  right: auto !important;

  width: auto !important;
  white-space: nowrap;
  line-height: 1;

  padding: 0.22rem 0.45rem !important;
  font-size: 0.70rem !important;
  border-radius: 999px;
}

/* Preview button overlay (bottom-right) */
.shop-imgwrap .shop-quickview{
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 8;

  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);

  opacity: 0;
  transform: translateY(6px);
  transition: all .15s ease;
}

/* show on hover (your cards use .card) */
.card:hover .shop-imgwrap .shop-quickview{
  opacity: 1;
  transform: translateY(0);
}

/* on phones/tablets (no hover), keep visible */
@media (max-width: 768px){
  .shop-imgwrap .shop-quickview{
    opacity: 1;
    transform: none;
  }
}
