/* =========================================================
   CL LIGHT — 상품 카테고리 목록 스킨 (list.10.skin.php)
   구조: 0.RESET/VARS  1.서브 히어로 배너  2.카테고리 탭  3.상품 그리드
   ========================================================= */

/* ---------- 0. RESET / VARS ---------- */
:root {
  --cl-ink: #161513;
  --cl-muted: #78746b;
  --cl-accent: #bb9857;
  --cl-line: #e9e6de;
  --cl-ease: cubic-bezier(.22, 1, .36, 1);
}

/* 기본 그누보드 상품진열 잔재 스타일 무력화 */
#wrapper {
  background: #fff;
}

#container {
  background: #fff;
}

#sct {
  position: relative;
  background: #fff;
}

body {
  overflow-x: hidden;
}

/* #container가 1200px 고정폭이라, 우리 섹션들은 뷰포트 전체폭으로 탈출시킴 (헤더와 여백 100% 일치) */
.cl-sub-hero,
.cl-cat-title-plain,
.cl-cat-nav,
.cl-section-head,
.cl-product-grid,
.cl-noitem,
#sct_thtml {
  position: relative;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
}

/* 분류관리 "하단내용" 에디터 글 — 100vw로 풀블리드만 시키고 왼쪽 정렬로 방치하면 오른쪽에
   빈 공간만 남아 어색해서, People 페이지(CEO 왼쪽/팀 오른쪽)와 같은 톤의 2단 편집형으로:
   제목은 왼쪽 고정폭 라벨처럼, 본문은 오른쪽에 — 넓은 폭을 실제로 써먹게 함.
   flex를 썼더니 에디터에서 문장마다 Enter 쳐서 <p>가 여러 개로 쪼개지면 그 문단 하나하나가
   전부 자기 flex 칸을 차지해서 옆으로 좌르르 나열돼버림(문단이 정확히 2개일 때만 맞는 가정이었음) —
   grid로 바꿔서 첫 <p>만 1열에 고정하고, 나머지 <p>는 몇 개든 전부 2열에 세로로 쌓이게 함 */
#sct_thtml {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0 60px;
  padding: 90px 5vw 110px;
  font-family: 'Pretendard', -apple-system, sans-serif;
}

/* 제목(1열)과 본문(2열) 사이 세로 구분선 — 두 칸의 실제 콘텐츠 높이에 맞춰 위/아래 여백만큼 뺌 */
#sct_thtml::before {
  content: '';
  position: absolute;
  left: calc(5vw + 340px + 30px);
  top: 90px;
  bottom: 110px;
  width: 1px;
  background: var(--cl-line);
}

#sct_thtml p {
  grid-column: 2;
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--cl-muted);
}

/* 빈 문단(에디터에서 줄바꿈만 친 <p><br></p>)은 굳이 여백을 만들지 않게 감춤 */
#sct_thtml p:has(> br:only-child) {
  display: none;
}

#sct_thtml p:first-child {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--cl-ink);
}

@media (max-width:860px) {
  #sct_thtml {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #sct_thtml p:first-child {
    grid-column: 1;
  }

  #sct_thtml p {
    grid-column: 1;
  }
}

/* 분류관리 상단내용(ca_head_html)의 원본 출력은 숨기고, 우리가 만든 cl-sub-hero로 대체 */
#sct_hhtml {
  display: none;
}

/* 비어있는 기본 정렬바/뷰전환 래퍼가 여백을 남기지 않도록 */
#sct_sortlst:empty {
  display: none;
  margin: 0;
  padding: 0;
}

/* shop.head.php가 항상 출력하는 기본 제목바 — cl-sub-hero가 그 역할을 대신함 */
#wrapper_title {
  display: none;
}

/* 관리자 전용 "분류 관리" 톱니 버튼 — 우측 상단에 작고 은은하게 */
.sct_admin {
  position: absolute;
  top: 14px;
  right: 5vw;
  z-index: 20;
}

.sct_admin .btn_admin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  transition: background .3s var(--cl-ease), color .3s var(--cl-ease), transform .5s var(--cl-ease);
}

.sct_admin .btn_admin:hover {
  background: rgba(255, 255, 255, .28);
  color: var(--cl-accent);
  transform: rotate(45deg);
}

.sct_admin .btn_admin i {
  animation: none !important;
  font-size: 13px;
}

/* ---------- 1. 서브 히어로 배너 ---------- */
.cl-sub-hero {
  position: relative;
  height: 38vh;
  min-height: 280px;
  max-height: 440px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cl-sub-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 9, 7, .28) 0%, rgba(10, 9, 7, .12) 45%, rgba(10, 9, 7, .42) 100%);
}

.cl-sub-hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 0 5vw;
  font-family: 'Pretendard', -apple-system, sans-serif;
  text-align: center;
}

.cl-sub-title {
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 600;
  letter-spacing: .04em;
  margin: 0;
}

/* 타이포/여백은 전역 .cl-plain-title(theme/cllight/css/cllight.css)에서 가져옴 —
   Products/Projects/Download와 완전히 같은 클래스를 마크업에 같이 붙여씀(여백 불일치 방지).
   여기 .cl-cat-title-plain은 이제 순전히 레이아웃(0번 항목의 풀블리드 처리)만 담당 */

/* ---------- 2. 카테고리 탭 ---------- */
.cl-cat-nav {
  padding: 104px 5vw 0;
  font-family: 'Pretendard', -apple-system, sans-serif;
}

/* 서브 히어로 배너가 없는 분류는 고정 nav 바로 아래에 탭이 붙어버리므로 상단 여백을 더 줌 */
#sct_sortlst+.cl-cat-nav {
  padding-top: 220px;
}

.cl-cat-title-plain+.cl-cat-nav {
  padding-top: 0;
}

.cl-cat-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--cl-line);
}

.cl-cat-top a {
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cl-ink);
  opacity: .4;
  position: relative;
  padding: 12px 0 28px;
  margin: -12px 0 -12px;
  transition: opacity .3s var(--cl-ease), color .3s var(--cl-ease);
}

.cl-cat-top a:hover {
  opacity: .75;
}

.cl-cat-top a.active {
  opacity: 1;
  color: var(--cl-accent);
}

.cl-cat-top a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 2px;
  background: var(--cl-accent);
}

.cl-cat-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding: 18px 0 0;
}

.cl-cat-sub a {
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--cl-muted);
  padding: 10px 0;
  margin: -10px 0;
  position: relative;
  transition: color .3s var(--cl-ease);
}

.cl-cat-sub a:hover {
  color: var(--cl-ink);
}

.cl-cat-sub a.active {
  color: var(--cl-accent);
  font-weight: 600;
}

.cl-cat-sub a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--cl-accent);
}

.cl-cat-sub a.active {
  color: var(--cl-ink);
  font-weight: 600;
}

/* ---------- 3. 상품 그리드 ---------- */
.cl-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 56px 5vw 0;
  font-family: 'Pretendard', -apple-system, sans-serif;
}

.cl-section-title {
  font-size: 16px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cl-ink);
  margin: 0;
}

.cl-section-count {
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--cl-muted);
}

.cl-section-count b {
  color: var(--cl-accent);
  font-weight: 600;
  font-size: 14px;
}

.cl-product-grid {
  padding: 24px 5vw 100px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 56px 22px;
}

.cl-product-card {
  display: block;
  color: var(--cl-ink);
}

.cl-product-img {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #f4f2ec;
  border-radius: 2px;
}

.cl-product-img1,
.cl-product-img2 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .7s var(--cl-ease), opacity .5s var(--cl-ease);
}

/* 상위분류(예: INDOOR) 대표 타일 전용 이미지는 실제 상품사진보다 살짝 어둡게 톤을 낮춤 */
.cl-product-card--cat .cl-product-img1,
.cl-product-card--cat .cl-product-img2 {
  filter: brightness(.86);
}

.cl-product-card:hover .cl-product-img1,
.cl-product-card:hover .cl-product-img2 {
  transform: scale(1.08);
}

/* 2번째 이미지(상품등록 화면에 등록돼 있을 때만 존재) — 1번째 위에 겹쳐뒀다가 오버 시 페이드인 */
.cl-product-img2 {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.cl-product-card:hover .cl-product-img2 {
  opacity: 1;
}

/* 오버 시 어두운 그라디언트 + 가운데 "+" (다른 목록 페이지와 동일한 크기/굵기) */
.cl-product-img::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10, 9, 7, 0) 45%, rgba(10, 9, 7, .55) 100%);
  opacity: 0;
  transition: opacity .4s var(--cl-ease);
}

.cl-product-card:hover .cl-product-img::after {
  opacity: 1;
}

.cl-product-hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .4s var(--cl-ease), transform .4s var(--cl-ease);
  pointer-events: none;
}

.cl-product-card:hover .cl-product-hover {
  opacity: 1;
  transform: translateY(0);
}

.cl-product-plus {
  font-size: 56px;
  font-weight: 100;
  line-height: 1;
}

/* 상위분류 대표 타일(--cat)만: 메인 쇼핑몰 타일과 동일하게 "+" 밑에 분류이름도 같이 호버로 노출 */
.cl-product-card--cat .cl-product-hover {
  flex-direction: column;
  gap: 12px;
}

.cl-product-hover-name {
  font-size: 15px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* 외부 링크(다른 사이트 제품) 카드: 오버 시 우상단에 "새창으로 열림" 아이콘 표시 */
.cl-product-ext {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--cl-ink);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s var(--cl-ease), transform .3s var(--cl-ease);
}

.cl-product-card.is-ext:hover .cl-product-ext {
  opacity: 1;
  transform: translateY(0);
}

.cl-product-ext svg {
  width: 16px;
  height: 16px;
}

/* 상품명 + (관리자면) 수정 아이콘을 한 줄에 */
.cl-product-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0px;
}

/* 상품명: 호버 없이 항상 이미지 아래 노출 */
.cl-product-name {
  display: block;
  min-width: 0;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cl-muted);
  transition: color .3s var(--cl-ease);
  margin-top: 15px;
}

.cl-product-card:hover .cl-product-name {
  color: var(--cl-accent);
}

/* 로그인한 회원(=관리자)에게만 보이는 수정 버튼 — 호버에 숨어있지 않고 제목 옆에 항상 노출 */
.cl-product-edit {
  flex: none;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--cl-muted);
  cursor: pointer;
  transition: background-color .25s var(--cl-ease), color .25s var(--cl-ease);
}

.cl-product-edit:hover {
  background: #f4f2ec;
  color: var(--cl-accent);
}

.cl-product-edit svg {
  width: 13px;
  height: 13px;
}

.cl-noitem {
  padding: 80px 5vw;
  text-align: center;
  color: var(--cl-muted);
  font-size: 14px;
}

/* ---------- 4. RELATED PROJECTS ---------- */
.cl-related-grid {
  position: relative;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  padding: 24px 5vw 110px;
}

.cl-related-card {
  cursor: pointer;
}

.cl-related-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 2px;
  background: #f4f2ec;
}

.cl-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .7s var(--cl-ease);
}

.cl-related-card:hover .cl-related-img img {
  transform: scale(1.06);
}

/* 오버레이: 평소엔 사진만, 호버 시 그라데이션 + 프로젝트명이 하단좌측에 노출 */
.cl-related-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 20px 20px;
  text-align: left;
  background: linear-gradient(180deg, transparent 45%, rgba(10, 9, 7, .72) 100%);
  opacity: 0;
  transition: opacity .45s var(--cl-ease);
}

.cl-related-card:hover .cl-related-overlay {
  opacity: 1;
}

.cl-related-overlay .cl-related-name {
  font-size: 14.5px;
  letter-spacing: .06em;
  color: #fff;
  transform: translateY(10px);
  transition: transform .45s var(--cl-ease);
}

.cl-related-card:hover .cl-related-overlay .cl-related-name {
  transform: translateY(0);
}

/* ---------- 5. LIGHTBOX (Related Projects 확대보기) ---------- */
.cl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 9, 7, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s var(--cl-ease);
}

.cl-lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cl-lightbox-figure {
  position: relative;
  max-width: 86vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0;
}

.cl-lightbox-img {
  max-width: 86vw;
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.cl-lightbox-caption {
  color: #fff;
  font-size: 13px;
  letter-spacing: .08em;
  text-align: center;
  font-family: 'Pretendard', -apple-system, sans-serif;
  opacity: .85;
}

.cl-lightbox-close {
  position: absolute;
  top: 34px;
  right: 5vw;
  z-index: 2;
  width: 72px;
  height: 72px;
  border: none;
  background: transparent;
  color: #fff;
  opacity: .75;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .3s var(--cl-ease), transform .4s var(--cl-ease);
}

.cl-lightbox-close svg {
  width: 44px;
  height: 44px;
}

.cl-lightbox-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.cl-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 64px;
  height: 88px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .3s var(--cl-ease);
}

.cl-lightbox-nav:hover {
  color: #fff;
}

.cl-lightbox-nav svg {
  width: 28px;
  height: 46px;
}

.cl-lightbox-prev {
  left: 2vw;
}

.cl-lightbox-next {
  right: 2vw;
}

@media (max-width:700px) {
  .cl-lightbox-close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
  }

  .cl-lightbox-close svg {
    width: 24px;
    height: 24px;
  }

  .cl-lightbox-nav {
    width: 44px;
  }

  .cl-lightbox-prev {
    left: 0;
  }

  .cl-lightbox-next {
    right: 0;
  }
}

@media (max-width:1100px) {
  .cl-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cl-related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width:700px) {
  .cl-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 14px;
  }

  .cl-related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .cl-cat-top {
    gap: 20px;
  }

  .cl-cat-sub {
    gap: 16px;
  }
}