/* Giao diện trang thương hiệu (Maison RMI Style) */

.brand-page-container {
  width: 100%;
  margin: 0 auto;
  font-family: 'Maison', 'Averta', sans-serif;
  color: #333;
}

/* 1. Section Hero Banner */
.brand-hero-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 50px;
  background-color: #f9f9f9;
}

.brand-hero-image-col {
  flex: 0 0 50%;
  max-width: 50%;
  line-height: 0;
}

.brand-hero-image-col img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.brand-hero-content-col {
  flex: 0 0 50%;
  max-width: 50%;
  padding: 40px 60px;
  box-sizing: border-box;
}

.brand-hero-block {
  margin-bottom: 30px;
}

.brand-hero-block:last-child {
  margin-bottom: 0;
}

.brand-hero-block h2 {
  font-size: 28px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 15px;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.brand-hero-block h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: #000;
}

.brand-hero-block p {
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* Khi chưa upload ảnh banner (ảnh lỗi): ẩn cột ảnh, cho nội dung tràn full & canh giữa */
.brand-hero-section.no-banner .brand-hero-image-col {
  display: none;
}

.brand-hero-section.no-banner .brand-hero-content-col {
  flex: 0 0 100%;
  max-width: 100%;
  text-align: center;
}

/* 2. Brand Grid Layout */
.brand-list-section {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 15px;
  display: flex;
  flex-wrap: wrap;
}

.brand-title-col {
  flex: 0 0 20%;
  max-width: 20%;
  padding-right: 20px;
  box-sizing: border-box;
}

.brand-title-col h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 1.3;
  margin-top: 0;
  text-transform: uppercase;
  border-left: 3px solid #000;
  padding-left: 15px;
}

.brand-grid-col {
  flex: 0 0 80%;
  max-width: 80%;
  box-sizing: border-box;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* 3. Flip Box Effect */
.brand-card {
  background-color: transparent;
  width: 100%;
  aspect-ratio: 300 / 290;
  perspective: 1000px; /* Tạo chiều sâu 3D */
  cursor: pointer;
}

.brand-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Hiệu ứng lật khi hover */
.brand-card:hover .brand-card-inner {
  transform: rotateY(180deg);
}

.brand-card-front, .brand-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden; /* Ẩn mặt sau khi lật */
  -webkit-backface-visibility: hidden;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mặt trước - Hiển thị ảnh full khung */
.brand-card-front {
  background-color: #f7f7f7;
  border: 1px solid #eaeaea;
  box-sizing: border-box;
  padding: 0;
}

.brand-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.brand-card:hover .brand-card-front img {
  transform: scale(1.05);
}

/* Mặt sau - Ảnh Lifestyle & Thông tin */
.brand-card-back {
  background-size: cover;
  background-position: center;
  transform: rotateY(180deg); /* Xoay 180 độ mặc định */
}

/* Lớp phủ mờ tối trên ảnh nền */
.brand-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 25px;
  box-sizing: border-box;
  color: #fff;
  transition: background-color 0.3s ease;
}

.brand-card:hover .brand-card-overlay {
  background-color: rgba(0, 0, 0, 0.75);
}

.brand-card-overlay h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffffff;
}

.brand-card-overlay p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  color: #dddddd;
  font-weight: 300;
  /* Giới hạn mô tả tối đa 4 dòng */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 4. Responsive CSS */
@media screen and (max-width: 991px) {
  .brand-hero-image-col {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .brand-hero-content-col {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 30px 20px;
  }
  
  .brand-title-col {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 30px;
    padding-right: 0;
  }
  
  .brand-grid-col {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .brand-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media screen and (max-width: 480px) {
  .brand-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .brand-hero-block h2 {
    font-size: 22px;
  }
  
  /* Hỗ trợ cảm ứng trên mobile: chạm nhẹ để lật và click nút hoặc liên kết */
  .brand-card:active .brand-card-inner {
    transform: rotateY(180deg);
  }
}
