/* =============================================================================
   NextE&M 제품 상세 페이지 스타일시트
   작성일: 2025.06.20
   설명: product-detail.php 페이지 전용 스타일
============================================================================= */

/* -----------------------------------------------------------------------------
   제품 이미지 스타일
----------------------------------------------------------------------------- */
.overview-image img {
    max-width: clamp(80%, 60vw, 60%);
    height: auto;
    display: block;
    margin: 0 auto;
}

/* 테블릿 이하에서 이미지 크기 조정 */
@media (max-width: 768px) {
    .overview-image img {
        max-width: clamp(70%, 65vw, 85%);
    }
}

/* 모바일에서 전체 너비 사용 */
@media (max-width: 480px) {
    .overview-image img {
        max-width: 100%;
    }
}

/* -----------------------------------------------------------------------------
   성능 섹션 레이아웃
----------------------------------------------------------------------------- */
.performance-section {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.performance-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.performance-left {
    flex: 1 1 45%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.performance-right {
    flex: 1 1 45%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* -----------------------------------------------------------------------------
   차트 컨테이너 스타일
----------------------------------------------------------------------------- */
.chart-block {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container {
    min-height: 250px;
    position: relative;
}

/* 도넛 차트의 chart-container는 최소 높이 해제 */
.performance-right .chart-block:first-child .chart-container {
    min-height: 180px; /* 도넛 차트는 더 작은 최소 높이 */
}

.chart-container h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #003399;
}

/* Canvas 최소 크기 설정 */
.canvas-holder {
    height: 200px; /* 고정 높이 */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 차트1 막대 너비 조정을 위한 컨테이너 크기 제한 */
.performance-left .chart-block:first-child .canvas-holder {
    max-width: 90%;
    margin: 0 auto;
}

.canvas-holder canvas {
    max-width: 100%;
    height: auto !important;
}

/* 도넛 차트만 특별 처리 - 원형 유지, 유연한 높이 */
.performance-right .chart-block:first-child .canvas-holder {
    height: auto; /* 자동 높이 */
    min-height: 150px; /* 최소 높이만 설정 */
    max-height: 250px; /* 최대 높이 제한 */
}


/* 차트 설명 텍스트 */
.chart-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.performance-list {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: #666;
}

.performance-list li {
    margin-bottom: 8px;
}

/* -----------------------------------------------------------------------------
   비교 테이블 스타일
----------------------------------------------------------------------------- */
.comparison-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.comparison-container h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #003399;
}

.comparison-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.comparison-table table {
    width: 100%;
    min-width: 400px; /* 테이블 최소 너비 */
    border-collapse: collapse;
    table-layout: fixed; /* 열 너비 계산 방식 고정 */
}

/* 열별 너비 설정 */
.comparison-table th:nth-child(1),
.comparison-table td:nth-child(1) {
    width: 20%; /* 구분 열 */
    min-width: 80px;
}

.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
    width: 30%; /* 그린도로 배수시스템 */
    min-width: 130px;
}

.comparison-table th:nth-child(3),
.comparison-table td:nth-child(3) {
    width: 25%; /* 청소차 */
    min-width: 100px;
}

.comparison-table th:nth-child(4),
.comparison-table td:nth-child(4) {
    width: 25%; /* 클린로드 시스템 */
    min-width: 100px;
}

.comparison-table th,
.comparison-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.comparison-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.comparison-table td {
    /* 폰트 사이즈는 기본값 사용 */
}

/* 그린도로 배수시스템 강조 (2열) */
.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
    font-weight: 600;
    position: relative;
    border-left: 3px solid #003399;
    border-right: 3px solid #003399;
}

.comparison-table th:nth-child(2) {
    border-top: 3px solid #003399;
}

.comparison-table tr:last-child td:nth-child(2) {
    border-bottom: 3px solid #003399;
}


.table-note {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* -----------------------------------------------------------------------------
   적용 사례 그리드
----------------------------------------------------------------------------- */
/* 새로운 BEM 스타일 클래스 */
.product-detail-case-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.product-detail-case-grid__item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    height: auto;  /* 이미지 높이에 맞춤 */
}

.product-detail-case-grid__item:hover {
    transform: translateY(-3px);
}

.product-detail-case-grid__item img {
    width: 100%;
    height: 100%;  /* auto → 100%로 변경하여 컨테이너 완전히 채우기 */
    display: block;
    object-fit: cover;  /* 비율 유지하면서 컨테이너 채우기 */
}

/* 기존 클래스 (하위 호환성 유지) */
.case-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.case-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    height: auto;  /* 이미지 높이에 맞춤 */
}

.case-card:hover {
    transform: translateY(-3px);
}

.case-card img {
    width: 100%;
    height: 100%;  /* auto → 100%로 변경하여 컨테이너 완전히 채우기 */
    display: block;
    object-fit: cover;  /* 비율 유지하면서 컨테이너 채우기 */
}

/* -----------------------------------------------------------------------------
   적용 사례 반응형 미디어 쿼리
----------------------------------------------------------------------------- */
/* 큰 화면에서 3컬럼 (1200px 이하) */
@media (max-width: 1200px) {
    .case-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        max-width: 600px;  /* 3컬럼에 맞게 전체 너비 축소 */
        padding: 0 20px;
    }
}

/* 태블릿 (1024px 이하) - 3컬럼 유지 */
@media (max-width: 1024px) {
    .case-grid {
        grid-template-columns: repeat(3, 1fr);  /* 3컬럼 유지 */
        gap: 15px;
        max-width: 100%;  /* 전체 너비 사용 */
        padding: 0 20px;
    }
    
    .case-card {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }
}

/* 작은 태블릿 (768px 이하) - 3컬럼 유지하되 더 작게 */
@media (max-width: 768px) {
    /* 새로운 BEM 클래스 스타일 */
    .product-detail-case-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 30px;
        max-width: 100%;
        padding: 0 15px;
    }
    
    .product-detail-case-grid__item {
        border-radius: 4px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
    
    .product-detail-case-grid__item:hover {
        transform: translateY(-1px);
    }
    
    /* 기존 클래스 스타일 (높은 우선순위) */
    .performance-section .case-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 30px;
        max-width: 100%;
        padding: 0 15px;
    }
    
    .performance-section .case-grid .case-card {
        border-radius: 4px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        width: 100%;
        height: auto;  /* 이미지 높이에 맞춤 */
        position: relative;
        overflow: hidden;
    }
    
    .performance-section .case-grid .case-card img {
        width: 100%;
        height: 100%;  /* auto → 100%로 변경하여 컨테이너 완전히 채우기 */
        display: block;
        object-fit: cover;  /* 비율 유지하면서 컨테이너 채우기 */
    }
    
    .performance-section .case-grid .case-card:hover {
        transform: translateY(-1px);
    }
}

/* 큰 모바일 (600px 이하) */
@media (max-width: 600px) {
    .case-grid {
        grid-template-columns: repeat(3, 1fr);  /* 3개로 변경 */
        gap: 10px;
        max-width: 100%;
        padding: 0 20px;
    }
    
    .case-card {
        max-width: none;
        border-radius: 3px;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    .case-grid {
        grid-template-columns: repeat(3, 1fr);  /* 3개로 변경 */
        gap: 8px;
        margin-top: 20px;
        max-width: 100%;  /* 전체 너비 사용 */
        padding: 0 20px;  /* 좌우 패딩 유지 */
    }
    
    .case-card {
        max-width: none;  /* 최대 너비 제한 해제 */
        border-radius: 3px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
    
    .case-card:hover {
        transform: none;  /* 모바일에서 호버 효과 제거 */
    }
}

/* 작은 모바일 (400px 이하) */
@media (max-width: 400px) {
    .case-grid {
        grid-template-columns: repeat(3, 1fr);  /* 3개 유지 */
        gap: 6px;
        max-width: 100%;
        padding: 0 15px;
    }
    
    .case-card {
        max-width: none;
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.08);
    }
}

/* 아주 작은 모바일 (350px 이하) */
@media (max-width: 350px) {
    .case-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2개로 변경 */
        gap: 8px;
        max-width: 100%;
        margin-top: 15px;
        padding: 0 10px;
    }
    
    .case-card {
        max-width: none;
        border-radius: 2px;
        border: 1px solid rgba(0, 0, 0, 0.06);
    }
}
