:root {
  --text-color: #000;
  --bg-card: #fff;
  --bg-primary: #007bff;
  --border-light: #ccc; /* 회색 선 색상 */
}

body {
  color: var(--text-color);
  background: #f0f0f0;
  margin: 0;
  font-family: sans-serif;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px;
  height: 60px;
  background-color: #222;
  color: #fff;
}

.topbar .logo {
  width: 200px;
  font-size: 1.6rem;
  font-weight: bold;
  cursor: pointer;
}

.top-nav {
  display: flex;
  margin-left: 24px;
}

.top-nav button {
  background: none;
  border: none;
  color: #ccc;
  margin-left: 16px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.top-nav button.active,
.top-nav button:hover {
  color: #fff;
}

.body {
  display: flex;
  margin-top: 60px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.sidebar {
  position: relative;
  width: 200px;
  background: #f4f4f4;
  padding: 16px 0;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar .indicator {
  position: absolute;
  left: 0;
  width: 4px;
  height: 48px;
  background: var(--bg-primary);
  transition: top 0.3s cubic-bezier(0.25,0.8,0.25,1);
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  height: 48px;
  line-height: 48px;
  padding: 0 24px;
  cursor: pointer;
  color: var(--text-color);
  font-size: 1.2rem;
}

.sidebar li.active,
.sidebar li:hover {
  background: #ddd;
  color: #000;
}

.content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: scale(1.03);
}

.card img {
  width: 100%; /* 카드 너비에 맞춤 */
  height: 150px; /* 고정 높이로 일관성 확보 */
  object-fit: contain; /* 비율 유지, 잘림 없음 */
  border-radius: 4px;
  max-width: 100%; /* 침범 방지 */
}

.product-name {
  color: var(--text-color);
  font-weight: bold;
  margin: 8px 0 4px;
  font-size: 1rem;
}

.product-price {
  color: var(--text-color);
  font-size: 0.95rem;
}

.modal {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  
}

.modal-content {
  background: var(--bg-card);
  width: 80vw;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  overflow: hidden;
  border-radius: 8px;
  position: relative;
  padding: 16px;
}

.modal-left {
  flex: 1;
  background: #f9f9f9;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 50%; /* 오른쪽 섹션과의 균형 유지 */
  border-right: 1px solid var(--border-light);
}

.modal-image {
  width: 100%; /* 컨테이너에 맞춤 */
  height: 300px; /* 고정 높이로 일관성 확보 */
  object-fit: contain; /* 비율 유지, 잘림 없음 */
  border-radius: 4px;
  max-width: 100%;
}

.modal-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 16px; /* 왼쪽 이미지와 간격 */
  max-width: 50%;
}

.modal-section {
  padding: 8px 0;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-title {
  font-size: 1.5rem;
  color: var(--text-color);
  margin: 0;
}

.modal-price {
  font-size: 1.2rem;
  color: var(--text-color);
  margin: 0;
}

.modal-desc {
  font-size: 1rem;
  color: var(--text-color);
  margin: 0;
}

.attribute-group {
  margin-top: 8px;
}

.attribute-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.attr-label {
  width: 70px;
  font-size: 1rem;
  color: var(--text-color);
}

.dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
}

.dot.filled {
  background: var(--bg-primary);
}

.login-modal {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 8px;
  width: 60vw;
  max-width: 400px;
  text-align: center;
  position: relative;
  border: 1px solid var(--border-light);
}

.login-modal h2 {
  margin-bottom: 16px;
  font-size: 1.2rem;
  color: var(--text-color);
}

.login-modal input {
  width: 80%;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-modal button {
  margin: 4px;
  padding: 8px 16px;
  cursor: pointer;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 20px;
  background: none;
  color: var(--text-color); 
  border: none;
  padding: 0;
  font-size: 20px;
  cursor: pointer;
}
/* ——— 기본 모드 전용 스타일 (수정) ——— */
.modal-content.basic {
  /* 원래 너비 복구 */
  width: 80vw;          
  max-width: 800px;     
  max-height: 85vh;     

  /* 더 둥글게 */
  border-radius: 16px;  

  /* 전체 패딩 제거(좌측 이미지만 꽉 채우기 위해) */
  padding: 0;           

  overflow: hidden;     
  display: flex;        
}
/* 좌/우 동일 비율 */
.modal-content.basic .modal-left,
.modal-content.basic .modal-right {
  flex: 1;       /* 좌우 각각 50% */
}

/* 왼쪽 이미지 컨테이너: 마진/패딩 0, 좌측만 둥글게 */
.modal-content.basic .modal-left {
  margin: 0;                        
  padding: 0;                       
  border-top-left-radius:    16px;  
  border-bottom-left-radius: 16px;  
  border-right: 1px solid var(--border-light);
}

/* 오른쪽 컨텐츠: 필요한 패딩만 지정, 우측은 각지게(디폴트) */
.modal-content.basic .modal-right {
  padding: 16px;     
  /* 우측 모서리는 기본(각진) 상태 유지 */
  border-top-right-radius:    0;
  border-bottom-right-radius: 0;
}

/* 이미지 자체도 컨테이너에 딱 맞게 */
.modal-content.basic .modal-left .modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-top-left-radius:    inherit;
  border-bottom-left-radius: inherit;
}
/* ——— 기본 모드: 제목–가격 사이 간격 좁히기 ——— */
.modal-content.basic .modal-right > div.modal-section:nth-of-type(2) {
  padding-top:    4px;  /* 위쪽 패딩을 줄여서 간격 좁힘 */
  padding-bottom: 4px;  /* 아래쪽 패딩도 줄여서 균등하게 */
}

/* ——— 기본 모드: 설명–속성 사이 간격 넓히기 ——— */
.modal-content.basic .modal-right > div#modalAttributes {
  margin-top: 16px;      /* 위쪽 마진으로 간격 넓힘 */
}
/* ——— 기본 모드: 가격(2)–설명(3) 사이 간격 넓히기 ——— */
.modal-content.basic .modal-right > div.modal-section:nth-of-type(3) {
  margin-top: 12px;  /* 숫자를 조절해 원하는 간격으로 맞추세요 */
}

/* ——— 기본 모드: 좌우 칸 사이 간격 늘리기 ——— */
.modal-content.basic {
  /* 기존 display:flex; 아래에 추가 */
  gap: 20px; /* 원하시는 만큼 px 값을 조정하세요 */
}

/* ——— 캐로셀 (수평) 모드 ——— */
.carousel-modal {
  width: 95vw !important;
  max-width: 1200px !important;
  max-height: 95vh !important;
}

.carousel-modal .modal-left {
  display: flex;
  flex-direction: column;    /* 위아래로 쌓이게 */
  align-items: center;       /* 가운데 정렬 유지 */
}

.image-carousel {
  position: relative;
  overflow: hidden;
}

.carousel-slide {
  display: none;
  text-align: center;
}

.carousel-slide.active {
  display: block;
}

.carousel-indicators {
  margin-top: 12px;
  text-align: center;
}

.carousel-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 4px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
}

.carousel-dot.active {
  background: var(--bg-primary);
}

.image-carousel .modal-image {
  width: 100%;
  height: calc(80vh - 120px);
  object-fit: contain;
}

/* ——— 캐로셀 (수직) 모드 ——— */
/* 3) 캐로셀-세로 모드 모달 컨텐츠를 뷰포트 풀스크린으로 */
.modal-content.carousel-vertical {
  position: fixed !important;
  top: 10vh !important;
  left: 20vw !important;
  right: auto !important;
  bottom: auto !important;
  /* transform: translate(-50vw, -50%) !important; */
  min-width: 120vw !important;
  height: 90vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  overflow-y: auto !important;   /* 세로 스크롤 */
  overflow-x: hidden !important;  /* 가로 스크롤 차단 */
  display: block !important;
}

/* 4) 오른쪽 영역 완전 숨기기 */
.modal-content.carousel-vertical .modal-right {
  display: none !important;
}

/* 5) 왼쪽 컨테이너도 풀스크린 */
.modal-content.carousel-vertical .modal-left {
  position: absolute !important;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  display: block !important;
}

/* 6) 이미지들 꽉 채우기 */
.modal-content.carousel-vertical .vertical-carousel-image {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  object-fit: contain !important;
}

.modal-close-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  border-radius: 12px;
  cursor: pointer;
  z-index: 1001;
}
.modal-close-overlay:hover {
  background: rgba(0,0,0,0.8);
}