/* ============================================================
   SAN-PHAM.CSS — Layer 3 cho trang Sản phẩm anfarm (2026-07-07).
   Trang đích của carousel "Sản phẩm nổi bật" trang chủ: 4 anchor
   #thit-sach · #so-che · #che-bien · #ready-to-eat, mỗi danh mục
   một panel packshot + copy. Ngôn ngữ hình ảnh kế thừa m-prod
   (packshot nổi trên quầng sáng radial + drop-shadow xanh).
   Chỉ chứa phần RIÊNG của trang — shell/hero/subnav ở common.css.
   ============================================================ */

/* anchor nhảy từ trang chủ/subnav: chừa header pill + subnav sticky */
#thit-sach, #so-che, #che-bien, #ready-to-eat { scroll-margin-top: calc(var(--head-h) + 80px) }

/* ---------- HERO ART — khay packshot lớn nổi trên quầng sáng ---------- */
.sp-hero__tray { position: relative; width: min(46vw, 560px) }

.sp-hero__tray::before {
  content: "";
  position: absolute;
  inset: auto;
  left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  width: 118%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 62%);
  pointer-events: none;
}

.sp-hero__tray img {
  position: relative;
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 20px 32px rgba(0, 88, 44, .26));
}

/* ---------- PANEL DANH MỤC — media | copy, đảo hướng xen kẽ ---------- */
.sp-cat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

/* --flip: packshot sang phải — dùng order thay vì đổi DOM để thứ tự đọc
   (copy trước, ảnh sau với screen reader) giữ nguyên trên mọi panel */
.sp-cat--flip .sp-cat__media { order: 2 }

.sp-cat__media { position: relative }

.sp-cat__media::before {
  content: "";
  position: absolute;
  left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  width: 116%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 62%);
  pointer-events: none;
}

.sp-cat__media img {
  position: relative;
  width: min(100%, 520px);
  height: auto; display: block;
  margin-inline: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 88, 44, .22));
}

.sp-cat__copy .headline { margin-bottom: 10px }

/* tagline client = giọng nói của danh mục — nghiêng nhẹ, xanh head */
.sp-cat__tag {
  font-size: clamp(16px, 1.6vw, 19px);
  font-style: italic;
  color: var(--head);
  margin-bottom: 14px;
}

.sp-cat__desc { color: var(--ink-2); max-width: 56ch; margin-bottom: 22px }

.sp-cat__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center }

/* ---------- DẢI SKU (chỉ Thịt sạch anfarm có bộ ảnh phần thịt) ---------- */
.sp-skus {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
  margin-top: clamp(26px, 3.5vw, 44px);
}

.sp-sku {
  background: #fff;
  border: 1px solid var(--green-line);
  border-radius: var(--r-card);
  overflow: hidden; /* FB bo góc 08/05: card tự clip, không phụ thuộc radius của img */
  padding: 12px 10px 10px;
  text-align: center;
  transition: transform var(--t-3) var(--ease), box-shadow var(--t-3) var(--ease);
}

.sp-sku:hover {
  transform: translateY(var(--lift-2));
  box-shadow: 0 16px 28px -18px rgba(0, 88, 44, .35);
}

.sp-sku img {
  width: 100%;
  /* packshot nguồn là ảnh NGANG trên khay tối — khung 4/3 khớp tỉ lệ,
     tránh letterbox trắng trên/dưới như khung vuông */
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-card); /* FB bo góc 08/05 vòng 2: khớp wrapper 16px (--r-card) + override cùng trị ở thuc-pham-sach.css */
  display: block;
}

.sp-sku b {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--head);
  line-height: 1.3;
}

.sp-skus__note {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {   /* 09/09: 900 → 860 */
  .sp-cat { grid-template-columns: 1fr; gap: 22px }

  /* mobile xếp dọc: ảnh lên trước copy cho cả panel thường lẫn --flip */
  .sp-cat__media, .sp-cat--flip .sp-cat__media { order: -1 }

  .sp-cat__media img { width: min(100%, 400px); display: block; margin-inline: auto }
  .sp-hero__tray { width: min(78vw, 420px) }
  .sp-skus { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)) }
}
