/* 여기에 작업 또는 수정할 당신의 css style을 설정하세요. (customizations) */
/* ===============================
   한 줄에 5개씩(20%) 강제 레이아웃 덮어쓰기
   (custom.css 맨 끝에 붙여넣으세요)
=============================== */

/* 1) Flex 컨테이너(.brand-list) 줄바꿈 허용 + margin·padding 초기화 */
section.section-m-tb .container .brand-wrap .brand-list {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* 2) Flex 아이템(<li>): 한 줄 5개 = 너비 20% */
section.section-m-tb .container .brand-wrap .brand-list li {
  flex: 0 0 20% !important;   /* 한 줄을 5등분 */
  width: 20% !important;      /* 기존 width:25% 덮어쓰기 */
  max-width: 20% !important;
  box-sizing: border-box !important;
  margin: 0 !important;       /* 기존 margin(0 10px 0 0) 제거 */
  padding: 10px !important;   /* 기존 padding(0 20px) 제거 */
}

/* 3) 브랜드 이미지(.brand-img) 영역: 600×800 비율로 고정 후 잘림 처리 */
section.section-m-tb .container .brand-wrap .brand-list li .brand-img {
  position: relative !important;
  width: 100% !important;
  height: 0 !important;
  padding-bottom: 133.333% !important; /* 800 ÷ 600 × 100% */
  overflow: hidden !important;
  border-radius: 4px !important;
}
section.section-m-tb .container .brand-wrap .brand-list li .brand-img img {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: auto !important;
  transform: translate(-50%, -50%) !important;
  object-fit: cover !important;
}

/* 4) 반응형: 화면 폭에 따라 한 줄 노출 개수 변경 */
/* - 화면 너비 ≤ 1024px: 한 줄에 3개씩 */
@media (max-width: 1024px) {
  section.section-m-tb .container .brand-wrap .brand-list li {
    flex: 0 0 33.3333% !important;
    width: 33.3333% !important;
    max-width: 33.3333% !important;
  }
}
/* - 화면 너비 ≤ 768px: 한 줄에 2개씩 */
@media (max-width: 768px) {
  section.section-m-tb .container .brand-wrap .brand-list li {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
  }
}
/* - 화면 너비 ≤ 480px: 한 줄에 1개 */
@media (max-width: 480px) {
  section.section-m-tb .container .brand-wrap .brand-list li {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
/* =========================================================
   (1) Flex 컨테이너(.brand-list)는 이미 한 줄에 5개씩,
       flex-wrap: wrap 으로 줄바꿈이 되는 상태라고 가정
   ========================================================= */
section.section-m-tb .container .brand-wrap .brand-list {
  /* (기존에 flex, flex-wrap, margin/padding 리셋만 유지) */
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important; /* 필요 시 중앙 정렬 */
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* =========================================================
   (2) 한 줄에 5개씩(각 li 너비 20%) 고정 → 그대로 유지
   ========================================================= */
section.section-m-tb .container .brand-wrap .brand-list li {
  flex: 0 0 20% !important;
  max-width: 20% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 10px !important;
}

/* ======================================================
   (3) brand-img 컨테이너: 4:3 비율(가로에 비해 세로가 75%)으로 고정
   ====================================================== */
section.section-m-tb .container .brand-wrap .brand-list li .brand-img {
  position: relative !important;
  width: 100% !important;
  height: 0 !important;
  padding-bottom: 75% !important; /* 4:3 비율(예: 400×300) */
  overflow: hidden !important;
  border-radius: 4px !important;
}

/* ======================================================
   (4) 내부 <img>는 가로 100%에 맞추고 비율 유지 → 잘려도 중앙 기준 cover
   ====================================================== */
section.section-m-tb .container .brand-wrap .brand-list li .brand-img img {
  position: absolute     !important;
  top: 50%               !important;
  left: 50%              !important;
  width: 100%            !important; /* → 컨테이너 너비에 딱 맞춤 */
  height: auto            !important; /* → 비율 유지 */
  transform: translate(-50%, -50%) !important;
  object-fit: cover      !important; /* → 중앙 기준으로 잘라도 박스를 꽉 채움 */
}
