/**
 * WIAWIS Color Custom System
 * Version: 1.4.2
 * Styles - WIAWIS 공식 사이트 규칙 적용
 */

/* ============================================
   기본 설정
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

#wiawis-custom {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  color: #222;
  min-height: 100vh;
  line-height: 1.5;
}

#wiawis-custom * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#wiawis-custom img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   로딩 / 에러
   ============================================ */
#wiawis-custom .loading,
#wiawis-custom .error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  font-size: 1.1rem;
  color: #666;
}

#wiawis-custom .error {
  color: #c00;
}

#wiawis-custom .loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #333;
  z-index: 9999;
}

/* ============================================
   Step 컨테이너
   ============================================ */
#wiawis-custom .step-container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 40px 30px 60px;
}

@media (max-width: 1400px) {
  #wiawis-custom .step-container {
    padding: 40px 25px 50px;
  }
}

@media (max-width: 1200px) {
  #wiawis-custom .step-container {
    padding: 30px 20px 40px;
  }
}

@media (max-width: 768px) {
  #wiawis-custom .step-container {
    padding: 25px 15px 35px;
  }
}

/* ============================================
   Step 헤더
   ============================================ */
#wiawis-custom .step-header {
  text-align: center;
  margin-bottom: 50px;
}

#wiawis-custom .step-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

#wiawis-custom .step-subtitle {
  font-size: 1rem;
  color: #666;
  margin-bottom: 25px;
}

/* ============================================
   Step 바 (프로그레스)
   ============================================ */
#wiawis-custom .step-bar {
  display: flex;
  justify-content: center;
  margin-top: 0;
}

#wiawis-custom .step-bar-inner {
  display: flex;
  width: 400px;
  height: 5px;
  gap: 10px;
}

#wiawis-custom .step-segment {
  flex: 1;
  height: 100%;
  background: #e0e0e0;
  border-radius: 3px;
}

#wiawis-custom .step-segment.active {
  background: #6366f1;
}

#wiawis-custom .step-segment.done {
  background: #333;
}

/* ============================================
   Step 1: 모델 선택
   ============================================ */
#wiawis-custom .model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  max-width: 1300px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  #wiawis-custom .model-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    max-width: 900px;
  }
}

@media (max-width: 768px) {
  #wiawis-custom .model-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 500px;
  }
}

#wiawis-custom .model-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 35px 45px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

#wiawis-custom .model-card:hover {
  border-color: #bbb;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

#wiawis-custom .model-card.selected {
  border-color: #222;
  border-width: 2px;
}

#wiawis-custom .model-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

#wiawis-custom .model-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}

#wiawis-custom .model-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

#wiawis-custom .model-desc {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 15px;
  min-height: 48px;
}

#wiawis-custom .model-name-ko {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

#wiawis-custom .btn-select {
  display: inline-block;
  background: #333;
  color: #fff;
  padding: 15px 55px;
  border: none;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#wiawis-custom .btn-select:hover {
  background: #111;
}

/* ============================================
   Step 2: 패턴 선택
   ============================================ */
#wiawis-custom .pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  max-width: 1300px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  #wiawis-custom .pattern-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    max-width: 900px;
  }
}

@media (max-width: 768px) {
  #wiawis-custom .pattern-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 500px;
  }
}

#wiawis-custom .pattern-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 35px 40px 35px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

#wiawis-custom .pattern-card:hover {
  border-color: #bbb;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

#wiawis-custom .pattern-card.selected {
  border-color: #222;
  border-width: 2px;
}

#wiawis-custom .pattern-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

#wiawis-custom .pattern-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

#wiawis-custom .pattern-name {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

#wiawis-custom .pattern-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

#wiawis-custom .pattern-component-price {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 15px;
}

#wiawis-custom .pattern-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
  min-height: 45px;
}

#wiawis-custom .btn-select-pattern {
  display: inline-block;
  background: #333;
  color: #fff;
  padding: 15px 55px;
  border: none;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#wiawis-custom .btn-select-pattern:hover {
  background: #111;
}

/* ============================================
   Step 네비게이션
   ============================================ */
#wiawis-custom .step-nav {
  display: flex;
  justify-content: center;
  margin-top: 50px;
  margin-bottom: 40px;
  gap: 20px;
}

#wiawis-custom .btn-prev,
#wiawis-custom .btn-next {
  padding: 14px 35px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

#wiawis-custom .btn-prev {
  background: #f0f0f0;
  color: #666;
}

#wiawis-custom .btn-prev:hover {
  background: #e0e0e0;
}

#wiawis-custom .btn-next {
  background: #222;
  color: #fff;
}

#wiawis-custom .btn-next:hover {
  background: #000;
}

/* ============================================
   Step 3: 색상 선택 (WIAWIS 공식 사이트 규칙 적용)
   ============================================ */
#wiawis-custom .step3-layout {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 40px;
}

@media (max-width: 1200px) {
  #wiawis-custom .step3-layout {
    flex-direction: column;
    align-items: center;
  }
}

#wiawis-custom .preview-section {
  flex: 1;
  min-width: 0;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1200px) {
  #wiawis-custom .preview-section {
    width: 100%;
    padding: 15px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #f5f5f5;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    max-height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* 프리뷰 고정으로 인한 컨트롤 섹션 여백 */
  #wiawis-custom .step3-layout {
    padding-top: 46vh;
  }
  
  #wiawis-custom .preview-section #preview-canvas {
    max-height: 40vh;
    width: auto;
    max-width: 100%;
  }
}

#wiawis-custom .preview-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

#wiawis-custom .preview-canvas-container {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

#wiawis-custom #preview-canvas {
  width: 100%;
  height: auto;
  display: block;
}

#wiawis-custom .pearl-notice {
  margin-top: 15px;
  padding: 10px 15px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #92400e;
  text-align: center;
}

#wiawis-custom .control-section {
  width: 620px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 1400px) {
  #wiawis-custom .control-section {
    width: 560px;
  }
}

@media (max-width: 1200px) {
  #wiawis-custom .control-section {
    width: 100%;
  }
}

#wiawis-custom .step3-breadcrumb {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

#wiawis-custom .breadcrumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 25px;
  background: #f5f5f5;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

#wiawis-custom .breadcrumb-item.active {
  background: #fff;
  border-color: #6366f1;
}

#wiawis-custom .breadcrumb-item:hover {
  background: #fff;
}

#wiawis-custom .breadcrumb-icon {
  font-size: 1.5rem;
}

#wiawis-custom .breadcrumb-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
}

#wiawis-custom .breadcrumb-item.active .breadcrumb-label {
  color: #6366f1;
  font-weight: 600;
}

/* 파트 선택 탭 */
#wiawis-custom .part-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#wiawis-custom .part-tab {
  padding: 10px 20px;
  background: #f5f5f5;
  border: 2px solid transparent;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

#wiawis-custom .part-tab:hover {
  background: #eee;
}

#wiawis-custom .part-tab.active {
  background: #fff;
  border-color: #333;
}

/* 색상 스와치 */
#wiawis-custom .color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#wiawis-custom .color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #e0e0e0;
  transition: all 0.2s;
  position: relative;
}

#wiawis-custom .color-swatch:hover {
  transform: scale(1.1);
}

#wiawis-custom .color-swatch.selected {
  border-color: #333;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

/* 피니시 옵션 */
#wiawis-custom .finish-options {
  display: flex;
  gap: 15px;
}

#wiawis-custom .finish-option {
  flex: 1;
  padding: 15px;
  background: #f5f5f5;
  border: 2px solid transparent;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

#wiawis-custom .finish-option:hover {
  background: #eee;
}

#wiawis-custom .finish-option.selected {
  background: #fff;
  border-color: #333;
}

#wiawis-custom .finish-name {
  font-size: 0.9rem;
  font-weight: 600;
}

/* 컨트롤 그룹 */
#wiawis-custom .control-group {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e5e5e5;
}

#wiawis-custom .control-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #333;
}

#wiawis-custom .part-label {
  font-size: 1rem;
  font-weight: 700;
  color: #555;
}

#wiawis-custom .logo-type-name {
  font-size: 1rem;
  font-weight: 700;
  color: #555;
}

#wiawis-custom .status-text {
  font-size: 0.85rem;
}

/* ============================================
   Step 4: 최종 확인
   ============================================ */
#wiawis-custom .step4-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 80px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 1200px) {
  #wiawis-custom .step4-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

#wiawis-custom .preview-section.final {
  background: #fff;
  border-radius: 0;
  padding: 20px;
  position: relative;
  max-height: none;
}

@media (max-width: 1200px) {
  #wiawis-custom .preview-section.final {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    max-height: none;
    box-shadow: none;
  }
  
  #wiawis-custom .step4-layout {
    padding-top: 0;
  }
}

#wiawis-custom .summary-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#wiawis-custom .summary-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

#wiawis-custom .summary-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 5px 0;
  overflow: hidden;
}

#wiawis-custom .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
}

#wiawis-custom .summary-row:last-child {
  border-bottom: none;
}

#wiawis-custom .summary-row .row-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

#wiawis-custom .summary-row .row-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

#wiawis-custom .summary-row .color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #ddd;
  flex-shrink: 0;
}

#wiawis-custom .summary-row .finish-text {
  color: #888;
  font-size: 0.85rem;
}

#wiawis-custom .summary-row .color-name {
  font-weight: 600;
  color: #333;
}

#wiawis-custom .summary-row .pantone-code {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

#wiawis-custom .summary-row .pearl-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #ffd700 0%, #ffe066 50%, #ffd700 100%);
  color: #7a5c00;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(255, 215, 0, 0.4);
  letter-spacing: 0.5px;
}

#wiawis-custom .summary-label {
  font-size: 0.9rem;
  color: #666;
}

#wiawis-custom .summary-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

#wiawis-custom .action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

#wiawis-custom .action-buttons .btn-edit {
  flex: 1;
  padding: 16px 20px;
  background: #7c4dff;
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

#wiawis-custom .action-buttons .btn-edit:hover {
  background: #651fff;
}

#wiawis-custom .action-buttons .btn-pdf {
  flex: 1;
  padding: 16px 20px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

#wiawis-custom .action-buttons .btn-pdf:hover {
  background: #111;
}

/* ============================================
   펄 효과 애니메이션
   ============================================ */
@keyframes pearlPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* ============================================
   반응형 추가
   ============================================ */
@media (max-width: 480px) {
  #wiawis-custom .step-bar-inner {
    width: 280px;
  }
  
  #wiawis-custom .model-card {
    padding: 25px 20px 30px;
  }
  
  #wiawis-custom .btn-select,
  #wiawis-custom .btn-select-pattern {
    padding: 12px 40px;
    font-size: 0.9rem;
  }
  
  #wiawis-custom .action-buttons {
    flex-direction: column;
  }
}
