/* =============================================================================
   HOME – các khối của trang chủ (thứ tự trong template-parts/home/)
   1 hero  2 benefits  3 categories  4 bestsellers  5 brands  6 types  7 posts
   ============================================================================= */

/* ----- 1. Hero ----- */
.wb-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 420px at 85% 0%, rgba(232, 163, 61, 0.28), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(255, 255, 255, 0.08), transparent 60%),
    linear-gradient(135deg, #b1132d 0%, var(--wb-primary) 40%, #4f0413 100%);
}
.wb-hero__grid {
  display: grid; align-items: center; gap: 32px;
  padding-block: clamp(40px, 7vw, 84px);
}
.wb-hero__title { margin-bottom: 14px; color: #fff; font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.15; }
.wb-hero__sub { max-width: 520px; margin-bottom: 28px; font-size: clamp(1rem, 1.6vw, 1.2rem); color: rgba(255, 255, 255, 0.88); }
.wb-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.wb-hero__media { position: relative; }
.wb-hero__img {
  width: 100%; border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  aspect-ratio: 16 / 10; object-fit: cover;
}

@media (min-width: 900px) {
  .wb-hero__grid { grid-template-columns: 1.05fr 1fr; gap: 56px; }
}

/* ----- 2. Bốn ô cam kết (nằm đè lên đáy hero) ----- */
.wb-benefits { position: relative; z-index: 2; margin-top: -28px; }
.wb-benefits__list {
  display: grid; gap: 12px; margin: 0; padding: 14px; list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  background: #fff; border-radius: 22px; box-shadow: var(--wb-shadow-lg);
}
.wb-benefit { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; }
.wb-benefit:hover { background: var(--wb-cream); }
.wb-benefit__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; color: var(--wb-primary);
  background: rgba(153, 13, 35, 0.08); border-radius: 16px;
}
.wb-benefit__body { display: flex; flex-direction: column; line-height: 1.35; }
.wb-benefit__body strong { font-size: 0.98rem; }
.wb-benefit__body span { font-size: 0.83rem; color: var(--wb-muted); }

/* ----- 3 & 6. Ô ảnh danh mục / loại vang ----- */
.wb-tiles { display: grid; gap: 16px; }
.wb-tiles--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wb-tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.wb-tile {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 1 / 1; background: var(--wb-cream);
  border-radius: var(--wb-radius);
  box-shadow: var(--wb-shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}
.wb-tile--tall { aspect-ratio: 4 / 5; }
.wb-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.wb-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(61, 3, 16, 0.78) 0%, rgba(61, 3, 16, 0.05) 55%);
}
.wb-tile__label {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1;
  font-weight: 700; font-size: 1rem; line-height: 1.25; color: #fff;
}
.wb-tile:hover { transform: translateY(-4px); box-shadow: var(--wb-shadow-lg); }
.wb-tile:hover img { transform: scale(1.06); }

@media (min-width: 720px) {
  .wb-tiles--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wb-tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .wb-tiles--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ----- 5. Thương hiệu ----- */
.wb-brands { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wb-brand-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 18px 14px; color: var(--wb-ink); text-align: center; font-weight: 600; font-size: 0.92rem;
  background: #fff; border: 1.5px solid var(--wb-line); border-radius: var(--wb-radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.wb-brand-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; }
.wb-brand-card:hover { color: var(--wb-primary); border-color: var(--wb-primary); box-shadow: var(--wb-shadow); transform: translateY(-3px); }

@media (min-width: 720px) {
  .wb-brands { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
}

/* ----- 7. Bài viết ----- */
.wb-postblock + .wb-postblock { margin-top: clamp(32px, 5vw, 56px); }
.wb-posts { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .wb-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .wb-posts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ----- 1.0.4: điện thoại – trang chủ gọn hơn ----- */
@media (max-width: 719px) {
  /* Bốn ô cam kết: 2 cột, ẩn dòng mô tả */
  .wb-benefits__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px; }
  .wb-benefit { gap: 8px; padding: 8px; }
  .wb-benefit__icon { width: 38px; height: 38px; border-radius: 12px; }
  .wb-benefit__body strong { font-size: 0.82rem; }
  .wb-benefit__body span { display: none; }

  /* Sản phẩm bán chạy và bài viết: vuốt ngang */
  .wb-section .wb-grid--5, .home .wb-posts {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: calc(var(--wb-gutter) * -1); padding: 4px var(--wb-gutter) 12px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding-inline: var(--wb-gutter);
  }
  .wb-section .wb-grid--5::-webkit-scrollbar, .home .wb-posts::-webkit-scrollbar { display: none; }
  .wb-section .wb-grid--5 > li { flex: 0 0 46%; scroll-snap-align: start; }
  .home .wb-posts > * { flex: 0 0 78%; scroll-snap-align: start; }
}
