@charset "UTF-8";

/* ==========================================
   1. 상세 페이지 메인 레이아웃
   ========================================== */
.product-detail-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 80px;
  font-family: inherit;
}

/* 브레드크럼 영역 (본문 너비 및 여백 맞춤) */
.page-header {
  width: 100%;
  background-color: #ffffff;
  padding: 40px 0 10px;
}

.page-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 타이틀 & 오른쪽 끝 인쇄 버튼 영역 */
.product-title-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 12px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--main-navy, #0f2645);
}

.product-detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--main-navy, #0f2645);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
}

.btn-print {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border: 1px solid var(--main-navy, #0f2645);
  background-color: #ffffff;
  color: var(--main-navy, #0f2645);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  margin-bottom: 2px;
}

.btn-print:hover {
  background-color: var(--main-navy, #0f2645);
  color: #ffffff;
}

/* ==========================================
   2. 메인 이미지 (상단)
   ========================================== */
.main-img-box {
  width: 100%;
  margin-bottom: 40px;
}

.main-img-box img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

/* ==========================================
   3. 중앙 2열 (왼쪽: 도면 / 오른쪽: 사양표)
   ========================================== */
.detail-mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
  align-items: start;
}

.section-sub-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--main-navy, #0f2645);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.drawing-img-box img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

/* 오른쪽 사양 표 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}

.spec-table th,
.spec-table td {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.spec-table th {
  width: 35%;
  background-color: #f8fafc;
  font-weight: 600;
  color: #334155;
  border-right: 1px solid #e2e8f0;
}

.spec-table td {
  color: #475569;
}

/* ==========================================
   4. 하단 가로형 이미지 2장
   ========================================== */
.detail-bottom-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.detail-bottom-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

/* ==========================================
   5. 모바일 반응형 (768px 이하)
   ========================================== */
@media (max-width: 768px) {
  .product-detail-wrapper {
    padding: 20px 15px 50px;
  }

  .product-title-area {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 15px;
  }

  .product-detail-title {
    font-size: 22px;
  }

  .btn-print {
    align-self: flex-end;
  }

  .detail-mid-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .detail-bottom-gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* ==========================================
   6. A4 인쇄 / PDF 저장 전용 스타일 (@media print)
   ========================================== */
@media print {
  @page {
    size: A4;
    margin: 6mm; /* 여백을 살짝 줄여서 메인 이미지 공간 확보 */
  }

  /* 화면 전용 요소 및 하단 갤러리 숨김 */
  body #header,
  body .page-header,
  body .no-print,
  body .btn-print,
  body .detail-bottom-gallery {
    display: none !important;
  }

  body, html {
    background: #ffffff;
    color: #000000;
    font-size: 11px;
  }

  .product-detail-wrapper {
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
  }

  /* 타이틀 영역 컴팩트하게 조정 */
  .product-title-area {
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
    margin-bottom: 50px;
  }

  .product-detail-title {
    font-size: 18px;
    color: #000000;
  }

  /* 메인 이미지 크기 시원하게 확대 및 중앙 정렬 */
  .main-img-box {
    margin-bottom: 50px;
    text-align: center;
  }

  .main-img-box img {
    max-height: 400px; /* 메인 이미지 높이 상향 조정 */
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
    border: 1px solid #ccc;
  }

  /* 중앙 2열 (도면 / 사양표) 배치 최적화 */
  .detail-mid-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
    page-break-inside: avoid;
    align-items: start;
  }

  .section-sub-title {
    font-size: 13px;
    color: #000000;
    margin-bottom: 4px;
  }

  .drawing-img-box img {
    max-height: 300px;
    object-fit: contain;
    width: 100%;
    border: 1px solid #ccc;
  }

  /* 사양 표 폰트 및 패딩 축소 */
  .spec-table {
    font-size: 10.5px;
  }

  .spec-table th,
  .spec-table td {
    padding: 4px 8px;
    border-color: #ccc;
  }

  .spec-table th {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #000000;
  }

  .spec-table td {
    color: #000000;
  }
}

/* =========================================
   인쇄 전용 스타일 (CSS 파일 맨 하단에 추가)
   ========================================== */
@media print {
    /* 1. 인쇄 시 불필요한 요소 (헤더, 푸터, 모바일 푸터, 브레드크럼, 인쇄 버튼 등) 완벽 차단 */
    #header, 
    #footer, 
    footer, 
    .footer, 
    .mobile-footer, 
    .m-footer, 
    .sp-footer, 
    .breadcrumb, 
    .print-btn, 
    .print-button {
        display: none !important;
    }

    /* 2. 타이틀과 하단 요소 사이의 과도한 여백 바짝 붙이기 */
    h1, 
    .page-title, 
    .product-title {
        margin-bottom: 5px !important;
        padding-bottom: 0 !important;
    }

    .title-area, 
    .page-title-section {
        margin-bottom: 10px !important;
        padding-bottom: 0 !important;
    }

    /* 3. A4 용지 규격 및 배경 최적화 */
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
}

/* 도면이 없을 때(.no-drawing 클래스가 붙었을 때) 레이아웃 변경 */
.product-detail-container.no-drawing {
    display: flex;
    flex-direction: column;
    align-items: center; /* 가로 기준 정중앙 정렬 */
    justify-content: center;
}

/* 도면이 없을 때 사양표가 너무 넓게 퍼지지 않고 폼 나도록 가운데 정렬 */
.product-detail-container.no-drawing .spec-table-area { /* 사양표를 감싸고 있는 클래스명 */
    width: 100%;
    max-width: 650px; /* 사양표의 적절한 최대 가로 폭 */
    margin: 0 auto;
}