/* --- TRANG TRÍ TIÊU ĐỀ: YOU MIGHT ALSO LIKE --- */
.section-title {
  text-align: center; /* 1. Căn giữa tiêu đề và gạch chân */
  margin-bottom: 40px; /* Khoảng cách so với lưới sản phẩm bên dưới */
  margin-top: 20px;
}

.section-title h3 {
  font-family: "Playfair Display", serif;
  font-size: 16px;       /* Kích thước chữ vừa phải */
  font-weight: 700;      /* Chữ đậm */
  color: #8b1e14;        /* Màu đỏ thương hiệu */
  text-transform: uppercase;
  letter-spacing: 2px;   /* Khoảng cách giữa các KÝ TỰ */
  
  margin-bottom: 15px;   /* Khoảng cách từ chữ xuống gạch chân */
  margin-top: 0;
}

/* 👇 3. ĐƯỜNG GẠCH DƯỚI (Ngắn, nằm giữa) */
.title-divider {
  width: 40px;           /* Độ dài gạch chân (ngắn thôi mới đẹp) */
  height: 2px;           /* Độ dày */
  background-color: #e5e5e5; /* Màu xám nhạt (hoặc #8b1e14 nếu muốn đỏ) */
  margin: 0 auto;        /* Lệnh quan trọng để gạch chân nằm giữa */
}


/* img */
.product-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin: 40px 0;
  justify-items: stretch;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.35s ease;
}


/* Khi có class layout-2 thì chuyển thành 2 cột */
.product-gallery.layout-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Tùy chỉnh: Khi ảnh to ra (2 cột), có thể bạn muốn tăng chiều cao ảnh lên chút cho đẹp */
.product-gallery.layout-2 .image-wrapper {
  height: 450px; /* Tăng chiều cao ảnh khi ở chế độ xem lớn */
}

.product-gallery.layout-4 {
  grid-template-columns: repeat(4, 1fr); /* Chia 4 cột */
  gap: 20px; /* Giảm khoảng cách chút cho đỡ thưa */
}

/* Khi ảnh nhỏ (4 cột), giảm chiều cao ảnh xuống cho cân đối */
.product-gallery.layout-4 .image-wrapper {
  height: 280px; 
}

.product {
  position: relative;
  text-align: center;
  overflow: hidden;
  background-color: #fff;
  border-radius: 10px;
}

.product img {
  width: 100%;
  height: 350px;
  object-fit: cover; /* giúp các ảnh có cùng kích thước */
  transition: opacity 0.8s ease;
  border-radius: 10px;
  display: block;
}

.product img.hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.product:hover img.hover {
  opacity: 1;
}

.product:hover img.main {
  opacity: 0;
}

.product .title {
  font-size: 18px;
  color: #833b1a;
  margin-top: 10px;
  font-weight: 600;
}

.product .price {
  font-size: 16px;
  color: #c47a3f;
  margin-top: 4px;
}




/* =========================
   HIỆU ỨNG HOVER: THANH TRẮNG & ĐỔI ẢNH
   ========================= */
.image-wrapper {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  border-radius: 10px;
}

.image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: 10px;
}

.image-wrapper img.active {
  opacity: 1;
  position: relative;
}


/* --- PROGRESS BAR KIỂU STORY --- */

/* Hộp chứa chung: Nằm trên cùng, chia cột flex */
.progress-container {
  position: absolute;
  top: 10px;          /* Cách mép trên 10px */
  left: 10px;         /* Cách mép trái 10px */
  right: 10px;        /* Cách mép phải 10px */
  z-index: 20;        /* Nằm trên ảnh và badge */
  display: flex;      /* Xếp các thanh nằm ngang */
  gap: 5px;           /* Khoảng cách giữa các đoạn */
  height: 3px;        /* Chiều cao thanh */
  pointer-events: none; /* Để chuột xuyên qua bấm vào ảnh được */
}

/* Các đoạn nền (màu xám mờ) */
.progress-segment {
  flex: 1;            /* Tự động chia đều chiều rộng */
  background-color: rgba(255, 255, 255, 0.3); /* Màu nền chưa chạy */
  border-radius: 2px;
  overflow: hidden;   /* Để thanh fill bên trong không bị tràn */
  height: 100%;
  position: relative;
}

/* Thanh màu trắng chạy bên trong mỗi đoạn */
.progress-fill {
  background-color: #fff; /* Màu trắng sáng */
  width: 0;
  height: 100%;
  display: block;
}

/* Hiệu ứng chạy từ 0 -> 100% */
@keyframes fillAnimation {
  from { width: 0; }
  to { width: 100%; }
}

/* ===========================
   1. BADGE (NEW IN / RE-RELEASE)
   =========================== */
/* Badge (Nhãn góc trên) */
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  
  background-color: #fff;
  color: #8b1e14;
  font-family: sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  
  /* --- THÊM DÒNG NÀY --- */
  transition: opacity 0.3s ease, visibility 0.3s ease; /* Tạo hiệu ứng mờ dần */
}

/* Khi di chuột vào sản phẩm (.product) thì ẩn Badge đi */
.product:hover .badge {
  opacity: 0;          /* Làm mờ hoàn toàn */
  visibility: hidden;  /* Ẩn hẳn khỏi cây hiển thị để không bấm nhầm */
}

/* ===========================
   2. ADD TO CART BUTTON
   =========================== */
.add-to-cart-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 10; /* Nằm đè lên trên ảnh */
  
  background-color: rgba(230, 226, 221, 0.95); /* Màu kem nhạt, hơi trong suốt */
  color: #8b1e14;
  border: none;
  padding: 15px 0;
  
  font-family: "Playfair Display", serif; /* Hoặc font bạn muốn */
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  
  /* Hiệu ứng ẩn mặc định */
  opacity: 0;
  transform: translateY(100%); /* Đẩy nút xuống dưới đáy ảnh */
  transition: all 0.4s ease;
}

.add-to-cart-btn:hover {
  background-color: #8b1e14;
  color: #fff;
}

/* Hiệu ứng rung lắc giỏ hàng */
@keyframes shakeCart {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  50% { transform: rotate(-15deg); }
  75% { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

.cart-shake i {
  animation: shakeCart 0.4s ease-in-out;
  color: #c47a3f; /* Đổi màu icon một chút khi rung */
}

/* ===========================
   HIỆU ỨNG KHI DI CHUỘT VÀO SẢN PHẨM (.product)
   =========================== */
.product:hover .add-to-cart-btn {
  opacity: 1;
  transform: translateY(0); /* Trượt lên vị trí gốc */
}