/* 기본 설정 */
body { font-family: 'Pretendard', sans-serif; margin: 0; color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; }

/* 헤더 영역 (로고 중앙, 메뉴 하단 우측 정렬 유지) */
header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 30px 50px 10px 50px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    position: absolute;
    left: 50%;
    bottom: 5px;
    transform: translateX(-50%);
    margin-bottom: 0;
}

.logo img { height: 60px; width: auto; vertical-align: bottom; }

nav { display: flex; }
nav a { margin-left: 20px; color: #555; font-weight: 500; line-height: 2; }
nav a:hover { color: #0056b3; }

/* 메인 배너 슬라이드쇼 애니메이션 */
@keyframes heroSlide {
    0%   { background-image: url('메인배너(기술).jpg'); }
    25%  { background-image: url('메인배너(기술).jpg'); }
    
    25%  { background-image: url('메인배너(측정).jpg'); }
    50%  { background-image: url('메인배너(측정).jpg'); }
    
    50%  { background-image: url('메인배너(캠핑).jpg'); }
    75%  { background-image: url('메인배너(캠핑).jpg'); }
    
    75%  { background-image: url('메인배너(자연).jpg'); }
    100% { background-image: url('메인배너(자연).jpg'); }
}

.hero {
    width: 100%; 
    aspect-ratio: 16 / 6; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: white;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    animation: heroSlide 20s infinite;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}
.hero h1 { font-size: 3rem; margin-bottom: 10px; }

/* ======================================================== */
/* 메인 페이지 하단 분할 영역 (3분할 레이아웃 적용)           */
/* ======================================================== */
.division-container { 
    display: flex; 
    height: 400px; 
    width: 100%; 
}

.division { 
    flex: 1; /* R&D, Equipments, Life 섹션이 동일한 비율(1:1:1)로 너비를 차지하도록 설정합니다. */
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    color: white; 
    transition: 0.3s; 
    cursor: pointer; 
    text-decoration: none; /* a 태그 기본 밑줄 제거 */
    padding: 0 20px;
    box-sizing: border-box;
    text-align: center;
}

/* 각 섹션별 배경 컬러 */
.RND { background: #2c3e50; }
.equipments { background: #004b93; } /* Equipments 전용 네이비/블루 컬러 추가 */
.life { background: #27ae60; }

.division:hover { 
    opacity: 0.9; 
    transform: scale(1.02); 
    z-index: 10; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); 
}

.division h2 { 
    font-size: 50px; 
    margin-bottom: 20px; 
}

.division p { 
    font-size: 18px; 
    margin: 5px 0; 
}

/* 서브 페이지 공통 (제품, 스토어 등) */
.page-container { padding: 20px 50px; max-width: 1200px; margin: 0 auto; text-align: center; }
.page-title { font-size: 2.5rem; margin-bottom: 50px; color: #111111; }

/* ======================================================== */
/* 제품 섹션 - 제품 그리드 (300x300 썸네일 고정 크기 적용)    */
/* ======================================================== */
.rnd-section {
    text-align: center; 
    padding: 60px 20px;
    background-color: #fcfcfc;
}

.rnd-section h2 {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 40px;
}

/* 제품 카드 전체 테두리 박스 */
.product-card {
    width: 300px !important;
    flex: 0 0 300px !important;  
    margin-bottom: 20px !important;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 15px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    box-sizing: border-box; 
}

.product-card:hover { transform: translateY(-5px); }

/* 사진이 들어가는 영역을 카드의 가로 폭에 맞춤 */
.product-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;           
    height: 250px;         
    margin: 0 auto 15px; 
    overflow: hidden;      
}

/* 이미지가 무조건 박스 안에 들어가도록 수정 */
.product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;  
    width: auto;
    height: auto;
}

/* 사진(네모 상자) 아래 텍스트 디자인 */
.product-card p {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* 강제 줄바꿈 및 그리드 정렬 설정 */
.product-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 30px !important;
    width: 95% !important;        
    max-width: 1200px !important;
    margin: 30px auto !important;
}

/* ======================================================== */
/* 펨토100 등 상세 페이지 전용 스타일                          */
/* ======================================================== */
.detail-page .container { max-width: 1000px; margin: 40px auto; padding: 0 20px; }
.product-top { display: flex; gap: 40px; margin-bottom: 60px; flex-wrap: wrap; align-items: center; justify-content: center; }
.product-img-box { 
    flex: 1 1 300px !important; 
    max-width: 500px !important;    
    width: 100% !important;         
    aspect-ratio: 1 / 1 !important; 
    height: auto !important;        
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background-color: #ffffff !important; 
    border: 1px solid #eeeeee !important; 
    border-radius: 10px !important;       
    margin: 0 auto !important;
    overflow: hidden !important;          
}

.product-img-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; 
    cursor: zoom-in !important;     
    transition: transform 0.3s ease !important;
}

/* 오른쪽 글씨와 버튼들을 감싸는 구역 */
.product-info { 
    flex: 1; 
    min-width: 300px; 
    text-align: left; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    align-self: stretch; 
    padding-left: 20px;    
    box-sizing: border-box; 
}

/* 설명 문구 구역 */
.product-desc { 
    font-size: 18px; 
    line-height: 1.6; 
    margin-bottom: 20px; 
}

/* ======================================================== */
/* 구매, 문의 및 다운로드 버튼 영역                            */
/* ======================================================== */
.action-btns {
    margin-top: auto; 
}

/* 메인 버튼(스토어구매, 제품문의) 기본 디자인 */
.action-btns a { 
    display: inline-block; 
    padding: 12px 30px; 
    margin-right: 10px; 
    background: #0056b3; 
    color: #fff; 
    border-radius: 5px; 
    font-weight: bold; 
    transition: 0.2s;
}
.action-btns a:hover { background: #003d82; }

/* 다운로드 버튼을 감싸는 그룹 */
.download-group {
    display: flex;
    gap: 10px;          
    margin-top: 2px;   
    border-top: 1px dashed #eee; 
    padding-top: 10px;  
}

/* 다운로드 전용 서브 버튼 스타일 */
.action-btns .download-group .download-btn {
    padding: 8px 15px; 
    font-size: 14px; 
    background: #f8f9fa; 
    color: #555;         
    border: 1px solid #ddd; 
    border-radius: 4px;
    margin-right: 0; 
}
.action-btns .download-group .download-btn:hover {
    background: #e2e6ea; 
    color: #111;
    border-color: #bbb;
}

/* ======================================================== */
/* 상세페이지 - 사진 및 동영상 썸네일 4개 정렬                 */
/* ======================================================== */
.media-gallery {
    display: flex;
    justify-content: center;
    gap: 15px; 
    margin-bottom: 60px;
    flex-wrap: wrap;
}
.media-item {
    width: 160px; 
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    transition: transform 0.2s;
}
.media-item:hover {
    transform: translateY(-5px);
    border-color: #0056b3;
}
.media-item img {
    width: 100%;
    height: 120px; 
    object-fit: contain; 
    border-radius: 4px;
    margin-bottom: 0; 
    display: block; 
}
.media-item p {
    margin: 0;
    font-weight: bold;
    color: #333;
    font-size: 13px; 
}
.media-item a { text-decoration: none; display: block; }
.media-item a:hover p { color: #0056b3; }

/* ======================================================== */
/* 이미지 크게 보기 모달창 설정                                */
/* ======================================================== */
.modal {
    display: none; 
    position: fixed;
    z-index: 5000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; 
    justify-content: center;
    align-items: center;
    cursor: zoom-out; 
}

.modal-content {
    max-width: 90%; 
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    background-color: #ffffff; 
    box-shadow: 0 15px 50px rgba(0,0,0,0.4); 
    animation: zoomIn 0.2s ease; 
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ======================================================== */
/* 스토어 로고 카드 그리드 레이아웃 최적화                     */
/* ======================================================== */
.grid-container { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px; 
    max-width: 900px; 
    margin: 0 auto;
}

.card { 
    border: 1px solid #ddd; 
    padding: 20px; 
    border-radius: 8px; 
    aspect-ratio: 2 / 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.card img {
    max-width: 90%;      
    max-height: 80%;
    object-fit: contain; 
}

.card h3 {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

/* ======================================================== */
/* 기타 컴포넌트 & 푸터 등                                     */
/* ======================================================== */
.detail-section { margin-bottom: 60px; text-align: left; }
.section-title { font-size: 24px; font-weight: bold; color: #0056b3; margin-bottom: 10px; }

.other-tech-section { text-align: center; margin-top: 80px; padding: 40px; background: #f4f7f6; border-radius: 10px; }
.other-tech-title { font-size: 20px; font-weight: bold; margin-bottom: 20px; color: #333; }
.other-tech-btns { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.tech-btn { padding: 10px 20px; background: #fff; border: 2px solid #0056b3; color: #0056b3; border-radius: 30px; font-weight: bold; transition: 0.3s; }
.tech-btn:hover { background: #0056b3; color: #fff; }

.about-section { text-align: center; margin-bottom: 60px; }
.about-section h2 { color: #0056b3; border-bottom: 2px solid #0056b3; display: inline-block; padding-bottom: 8px; margin-bottom: 25px; font-size: 24px; }
.about-section p { font-size: 16px; line-height: 1.8; color: #444; margin: 0 auto; max-width: 800px; }
.about-section iframe { display: block; margin: 20px auto 0; max-width: 100%; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }

.contact-info-box { display: inline-block; text-align: left; margin-top: 10px; font-size: 16px; line-height: 2; }
.contact-info-box p { text-align: left; }

footer { font-size: 12px; background-color: #fff; border-top: 1px solid #eee; padding: 20px 0; text-align: center; }