/* ============================================
   PRODUCTS.CSS — Carousel + Shopee-style badge
   ============================================ */

/* === Crossfade 2 ảnh === */
.crossfade-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.38s cubic-bezier(0.32, 0, 0.26, 1);
  z-index: 0;
}

.crossfade-img.visible {
  opacity: 1 !important;
  z-index: 1;
}

@media (pointer: fine) {

  .hero-prod-card:hover .crossfade-img.bottom,
  .hero-prod-card:focus .crossfade-img.bottom {
    opacity: 1;
    z-index: 2;
  }
}

/* === Box giá trong ảnh — ẨN hoàn toàn === */
.prod-card-price {
  display: none !important;
}

/* === Badge cũ trong ảnh — ẨN === */
.prod-badge {
  display: none !important;
}

/* ═══════════════════════════════════════════
   SHOPEE-STYLE BADGE — góc phải dưới info
   ═══════════════════════════════════════════ */
.shopee-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

/* =====================================================================
   MOBILE: Horizontal scroll carousel
   ===================================================================== */
@media (max-width: 767px) {

  .products-scroll-track {
    display: flex;
    flex-direction: row;
    align-items: stretch;       /* tất cả card cùng chiều cao */
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: none;
    scroll-behavior: auto;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 16px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .products-scroll-track::-webkit-scrollbar {
    display: none;
  }

  /* Tất cả card cùng width, dùng flex column để đáy thẳng hàng */
  .prod-card-s,
  .prod-card-m {
    flex-shrink: 0;
    width: 58vw;
    max-width: 240px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
  }

  /* prod-info chiếm hết phần còn lại → nút mua luôn ở đáy */
  .prod-card-s .prod-info,
  .prod-card-m .prod-info {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .prod-card-s .prod-info .add-cart-btn,
  .prod-card-m .prod-info .add-cart-btn {
    margin-top: auto;
  }

  /* Image wrap — aspect-square đồng bộ */
  .prod-card-s .prod-img-wrap,
  .prod-card-m .prod-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .prod-info .font-serif {
    font-size: 14px;
  }
}

/* =====================================================================
   DESKTOP: Grid 3 cột
   ===================================================================== */
@media (min-width: 768px) {

  .products-scroll-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 32px;
    padding: 0 28px;
    overflow: visible;
  }

  .prod-card-s,
  .prod-card-m {
    width: 100%;
    cursor: pointer;
  }

  .prod-card-s .prod-img-wrap,
  .prod-card-m .prod-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .hero-prod-card {
    transition: transform 0.25s cubic-bezier(0.32, 0, 0.26, 1);
  }

  .hero-prod-card:hover {
    transform: translateY(-2px);
  }

  .prod-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 16px;
  }

  /* Badge + giá ngang nhau trên desktop cũng gọn */
  .prod-info .flex.items-center.justify-between {
    width: 100%;
  }

  .prod-info .font-serif {
    font-size: 17px;
  }

  .prod-info .add-cart-btn {
    width: 100%;
  }
}

/* =====================================================================
   SHARED
   ===================================================================== */
.hero-prod-card:focus-visible {
  outline: 2px solid var(--ink, #111111);
  outline-offset: 3px;
}

.hero-prod-card:active {
  opacity: 0.85;
}

.products-scroll-track {
  touch-action: pan-x pan-y;
}