/* 기본 설정 */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body { font-family: 'Pretendard', sans-serif; line-height: 1.6; margin: 0; padding: 0; color: #333; background: #f4f7f9; overflow-x: hidden; }
img { max-width: 100%; height: auto; }

header {
    background: #ffffff;
    color: #333333;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 70px;
    position: relative;
}

/* 로고 섹션 */
.logo-container { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; z-index: 1002; }
.logo-img { height: 45px; width: auto; margin-right: 12px; }
.logo-text { font-size: 1.4rem; font-weight: bold; color: #2e7d32; }

/* 햄버거 버튼 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 메뉴 오버레이 */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}
.nav-overlay.active { display: block; opacity: 1; }

body.nav-open { overflow: hidden; }

/* 메뉴 섹션 */
nav ul,
.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 8px;
}
nav ul li,
.nav-menu li { margin-left: 17px; }
nav ul li:first-child,
.nav-menu li:first-child { margin-left: 0; }
nav ul li a,
.nav-menu li a {
    color: #333333;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: 0.3s;
    white-space: nowrap;
}
nav ul li a:hover,
.nav-menu li a:hover,
nav ul li a.active,
.nav-menu li a.active { color: #2e7d32; }

/* 레이아웃 */
.container { width: 85%; max-width: 1100px; margin: 40px auto; background: white; padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); min-height: 550px; }
h1 { color: #1a2a3a; border-left: 5px solid #4db8ff; padding-left: 15px; margin-bottom: 30px; }
h2 { color: #2c3e50; margin-top: 40px; border-bottom: 1px solid #eee; padding-bottom: 10px; }

/* 이미지 박스: 사진이 삐져나가지 않도록 강제 고정 */
.img-box {
    background: #eee;
    width: 100%;
    height: 250px;        /* 박스 높이 고정 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;     /* 박스 밖으로 나가는 이미지 숨김 */
    border: 1px solid #ddd;
}

.img-box img {
    max-width: 100%;     /* 가로 최대치 고정 */
    max-height: 100%;    /* 세로 최대치 고정 */
    width: auto;
    height: auto;
    object-fit: contain;  /* 비율 유지하며 박스 안에 쏙 들어가게 함 */
}

/* 제품 카드 레이아웃 */
.card { border: 1px solid #eee; padding: 25px; border-radius: 10px; margin-bottom: 30px; background: #fff; }
.product-flex { display: flex; gap: 30px; align-items: center; }
.product-img-side { flex: 1; min-width: 250px; max-width: 300px; }
.product-info-side { flex: 2; }

/* 버튼 */
.btn-group { margin-top: 15px; display: flex; gap: 10px; }
.btn { padding: 10px 18px; text-decoration: none; border-radius: 5px; font-size: 0.9rem; font-weight: bold; cursor: pointer; display: inline-block; border: none; }
.btn-blue { background: #007bff; color: white; }
.btn-gray { background: #6c757d; color: white; }

footer { text-align: center; padding: 30px; color: #888; font-size: 0.85rem; background: #fff; border-top: 1px solid #eee; }

/* --- 메인 페이지 히어로 배너 스타일 (추가) --- */
.hero-dark {
    height: 600px;
    background-color: #222;
    /* 사진 위에 검은색 반투명 막(0.5 농도)을 씌워 글자를 띄웁니다 */
    background-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5)), url('images/main_hero.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

.hero-content h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 25px;
    letter-spacing: -1.5px;
    line-height: 1.2;
    /* 글자 뒤에 그림자를 넣어 배경과 분리 */
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    animation: fadeInUp 1s ease-out;
}

.hero-content p {
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1.7;
    opacity: 0.9;
    /* 설명문에도 그림자 추가 */
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 공통 서브 히어로 --- */
.sub-hero {
    height: 300px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 0 20px;
}
.sub-hero h1 {
    font-size: 3.5rem;
    color: #ffffff !important;
    text-shadow: 2px 2px 15px rgba(0,0,0,0.8);
    font-weight: 800;
    margin: 0;
    border: none;
    padding: 0;
}

/* --- 푸터 공통 --- */
.footer-content p { margin: 5px 0; word-break: keep-all; }
.footer-sep { margin: 0 8px; color: #444; }

/* =============================================
   반응형 (모바일 · 태블릿)
   ============================================= */
@media (max-width: 1024px) {
    .container { width: 92%; padding: 30px 24px; }
    .product-flex { flex-direction: column; }
    .product-img-side { max-width: 100%; min-width: 0; }
    .product-info-side { min-width: 0 !important; }
}

@media (max-width: 900px) {
    .nav-toggle { display: flex; }

    nav ul,
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 85vw);
        height: 100vh;
        height: 100dvh;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 90px 28px 40px;
        box-shadow: -5px 0 25px rgba(0,0,0,0.12);
        transition: right 0.3s ease;
        gap: 0;
        z-index: 1001;
        overflow-y: auto;
    }

    nav ul.open,
    .nav-menu.open { right: 0; }

    nav ul li,
    .nav-menu li {
        margin: 0;
        border-bottom: 1px solid #eee;
    }

    nav ul li a,
    .nav-menu li a {
        display: block;
        padding: 16px 4px;
        font-size: 1.05rem;
        white-space: normal;
    }

    .hero-dark { height: 450px; }
    .hero-content h2 { font-size: 2.2rem !important; }
    .hero-content p { font-size: 1.1rem !important; }

    .sub-hero { height: 220px; }
    .sub-hero h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    header { padding: 0 16px; }
    .logo-img { height: 38px; }

    .container {
        width: 94%;
        margin: 24px auto;
        padding: 24px 18px;
        min-height: auto;
        border-radius: 10px;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; margin-top: 28px; }

    .hero-dark { height: 380px; }
    .hero-content h2 { font-size: 1.85rem !important; letter-spacing: -0.5px !important; }
    .hero-content p { font-size: 1rem !important; }

    .sub-hero { height: 200px; }
    .sub-hero h1 { font-size: 1.9rem; }

    .product-flex { gap: 0; }
    .product-img-side { padding: 20px; min-width: 0 !important; }
    .product-info-side { padding: 24px 20px !important; }
    .btn-group { flex-direction: column; }
    .btn { width: 100%; text-align: center; justify-content: center; }

    footer { padding: 24px 16px; font-size: 0.8rem; }
    .footer-content p { font-size: 0.85rem; line-height: 1.7; }
    .footer-sep { display: none; }
    .footer-content p br { display: block; content: ""; }

    .img-box { height: 200px; }
}

@media (max-width: 480px) {
    .hero-dark { height: 320px; }
    .hero-content h2 { font-size: 1.55rem !important; }
    .sub-hero h1 { font-size: 1.65rem; }
    nav ul, .nav-menu { width: 100vw; }
}