@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400&family=Rubik:wght@400;500;600&display=swap');

/* 전체 메인 래퍼 */
.product-detail-main {
  width: 100%;
  max-width: 1152px;
  margin: 60px auto 0 auto;
  display: flex;
  flex-direction: row;
  gap: 80px;
  align-items: flex-start;
  position: relative;
  box-sizing: border-box;
}

/* 왼쪽: 이미지 그룹 */
.product-main-images {
  width: 617px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px 0;
  position: relative;
}

.product-main-images .main-image {
  width: 100%;
  max-width: 573px;
  height: 383px;
  background: #fff;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-main-images .main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;  /* 이미지를 늘리기, 잘라도 center 맞춤 */
  object-position: center center !important;
  border-radius: 0 !important;
  display: block;
}

.product-main-images .sub-images {
  display: flex;
  flex-direction: row;
  gap: 16px;
  width: 100%;
  justify-content: center;   /* 중앙정렬! */
  align-items: center;
  margin-top: 0;
}

.product-main-images .sub-thumb {
  width: 113px;
  height: 75px;
  object-fit: cover;
  object-position: center center;
  background: #F8F8F8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.18s;
  display: block;
}
.product-main-images .sub-thumb:hover {
  border: 2px solid #323341;
}

.product-main-images .sub-thumb.selected {
  border: 2.5px solid #323341;
}

/* 오른쪽: 상품 정보 */
.product-main-info {
  width: 525px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}

.product-title {
  font-family: 'Rubik', sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 25px;
  color: #171717;

}

.product-summary {
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  color: #444;
  line-height: 21px;
  min-height: 36px;
  margin-bottom: 30px;
}

/* 옵션 드롭다운 */
.product-option-select {
  width: 100%;
  margin-bottom: 12px;
}

.option-label {
  display: flex;
  align-items: center;
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  font-weight: 500;
  background: #323341;
  color: #fff;
  border-radius: 3px 3px 0 0;
  height: 20px;
margin: 0;
  border: 0;
}

.product-option-select select {
  width: 100%;
  background: #DEDEDE;
  border: none;
  border-radius: 0 0 3px 3px;
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  color: #171717;
  padding: 13px 20px;
  height: 40px;
  outline: none;
  margin-bottom: 0;
  appearance: none;
}

/* 가격/수량 */
.product-detail-price {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 좌우 정렬 */
  margin: 0;
  gap: 12px;
}
.price {
  white-space: nowrap;
  font-family: 'Rubik', sans-serif;
  font-size: 34px;
  font-weight: 600;
  color: #323341;
  letter-spacing: -0.5px;
}
.qty-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.qty-btn {
  width: 33px;
  height: 33px;
  border-radius: 12px;
  background: #D9D9D9;
  color: #fff;
  border: none;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}


.qty-btn.plus {
  background: #323341;
  color: #fff;
}

.qty-label {
  min-width: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  user-select: none;
}
/* 버튼 영역 */
.product-detail-buttons {
  display: flex;
  flex-wrap: nowrap; /* ❗한 줄로 강제 */
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.btn-buy {
  flex: unset;
  width: 334px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
  background: #323341;
  color: #fff;
  border: 1px solid #000000;
  border-radius: 30.5px;

  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 21px;
  cursor: pointer;
}
.btn-buy:hover {
  background: #1a1a1a;
}

.btn-cart {
  flex: unset;
  width: 175px;

  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
  background: #EFEFEF;
  color: #323341;
  border: 3px solid #323341;
  border-radius: 30.5px;

  font-family: 'Rubik', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 21px;
  cursor: pointer;
}


.btn-cart:hover {
  background: #e0e0e0;
}

@media (max-width: 1100px) {
  .product-detail-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 60px;
    margin-left: 16px;
    margin-right: 16px;
  }
  .product-main-images, .product-main-info {
    width: 100%;
    max-width: 100%;
  }
  .product-main-images .main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 220px;
  }
}

@media (max-width: 700px) {
  .product-detail-main {
    gap: 30px;
    margin: 30px 0 0 0;
  }
  .product-main-images .main-image {
    width: 100vw;
    max-width: 100vw;
    height: 220px;
  }
  .product-main-images .sub-images {
    gap: 6px;
  }
  .product-main-images .sub-thumb {
    width: 64px;
    height: 45px;
  }
  .product-main-info {
    width: 100%;
    min-width: 0;
  }
  .btn-buy, .btn-cart {
    padding: 13px 18px;
    font-size: 15px;
  }
}

.main-image img, .sub-images .sub-thumb {
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  object-fit: cover;
}

.product-main-images .sub-thumb.selected {
  border: 2.5px solid #323341;
  /* 우측+아래만 그림자, spread 없이 */
  box-shadow: 5px 5px 5px 0 rgba(0,0,0,0.3) !important;
  z-index: 5;
  background: #fff;
  transition: box-shadow 0.18s;
}
/* 팝업ㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂ */
/* ===== 팝업 전체 래퍼 ===== */
.image-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.image-popup[style*="flex"] { display: flex !important; }

/* 어두운 배경 */
.image-popup .popup-bg {
  position: absolute; inset: 0;
  background: rgba(34,36,38,0.78);
  z-index: 1;
}

/* 팝업 콘텐츠 */
/* === 슬라이드 이미지 (핵심) === */
.popup-content {
  position: relative;
  background: #fff;
  box-shadow: 0 4px 42px 0 rgba(0,0,0,0.19);
  max-width: 1100px;
  max-height: 80vh;
  width: 90vw;
  height: 80vh;
  padding: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;   /* 한장만 보이게! */
}

.popup-slider-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.34s cubic-bezier(.43,.53,.34,1);
  will-change: transform;
}

.popup-slider-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* !! 핵심 !! */
  flex: 0 0 100%;
  user-select: none;
  pointer-events: none;
}

.popup-arrow, .popup-close {
  position: absolute;
  top: 24px;
  background: rgba(44,44,44,0.20);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  transition: background 0.18s;
  font-size: 28px;
  color: #555;
}

.popup-arrow.left { left: 24px; top: 50%; transform: translateY(-50%);}
.popup-arrow.right { right: 24px; top: 50%; transform: translateY(-50%);}
.popup-close { right: 24px; top: 24px; font-size: 28px; color: #444; }

.popup-arrow:hover, .popup-close:hover {
  background: rgba(44,44,44,0.38);
  color: #111;
}


/* 반응형 (노트북/태블릿) */
@media (max-width: 1200px) {
  .image-popup .popup-content { width: 96vw; height: 70vw; max-height: 85vh; }
}

/* 반응형 (모바일) */
@media (max-width: 700px) {
  .image-popup .popup-content { width: 100vw; height: 60vw; max-height: 65vh; border-radius: 0; }
  .popup-image { max-width: 100vw; max-height: 65vh; }
  .image-popup .popup-arrow { width: 36px; height: 36px; }
  .image-popup .popup-close { width: 32px; height: 32px; font-size: 24px; top: 8px; right: 8px; }
}



/*특징사진*/
.product-detail-features {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
}

.feature-image {
  width: 100%;
  margin-top: 126px;
  max-width: 1000px;
  height: auto;
  display: block;
}

/*서브이미지*/
.product-sub-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 100px auto 0;
  padding: 0 20px;
}

.sub-image-thumb {
  width: 100%;
  height: 0;
  padding-bottom: 66.666%; /* 3:2 비율 유지 */
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: none;
}

.sub-image-thumb img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
}


/* 서브이미지팝업 */
.sub-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.sub-popup-content {
  position: relative;
  width: 796px;
  height: 531px;
  background: none;
  padding: 0;
  overflow: hidden;
}

.sub-popup-content img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.sub-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;

  display: flex;              /* ✅ 추가 */
  align-items: center;        /* ✅ 세로 중앙 */
  justify-content: center;    /* ✅ 가로 중앙 */
  line-height: 1;             /* ✅ 텍스트 높이 정렬 보정 */
  padding: 0;                 /* ✅ 여백 제거 */
}
