/* =========================================================
   정연산업 dhnew 디자인 시안 - 공통 스타일 (2단계 디자인 시안)
   실제 사진은 아직 없어서 <img>는 의도적으로 깨진 채(브라우저 에러 아이콘)
   보이도록 두었습니다. 필요한 파일명은 assets/images/README.txt 참고.
========================================================= */

:root {
    --bg: #f6f3ee;
    --ink: #232019;
    --muted: #77716a;
    --muted2: #9c968d;
    --line: rgba(30, 25, 15, 0.12);
    --card: #ffffff;
    --band: #ece6da;
    --band2: #e2d9c8;
    --navy: #17235c;
    --navy-dark: #0f1740;
    --green: #1ea34a;
    --green-dark: #157a37;
    --dark: #15141a;
    --dark2: #1f1d24;
    --dark-muted: #b3aea6;
    --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; background: #eee; }
button { font-family: inherit; }

.container { width: 1240px; max-width: calc(100% - 48px); margin: 0 auto; }

/* ---------- 헤더 ---------- */
header.site-header {
    position: sticky;
    top: 0;
    z-index: 300;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6vw;
    background: rgba(246, 243, 238, 0.95);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 42px; width: auto; }
.logo .logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo .logo-kor { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.logo .logo-eng { font-size: 9px; letter-spacing: 2px; color: var(--green-dark); font-weight: 600; }

nav.main-nav { display: flex; gap: 36px; }
nav.main-nav a { font-size: 15px; font-weight: 500; position: relative; padding: 6px 0; }
nav.main-nav a.on, nav.main-nav a:hover { color: var(--navy); }
nav.main-nav a.on::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--green);
}

.header-cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--navy); color: #fff; font-size: 14px; font-weight: 600;
    padding: 10px 18px; border-radius: 999px;
}
.header-cta:hover { background: var(--navy-dark); }

.mobile-menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); }

.mobile-menu {
    display: none;
    position: fixed; top: 84px; left: 0; right: 0; z-index: 290;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column;
    box-shadow: 0 12px 24px rgba(20,15,5,0.08);
}
.mobile-menu.active { display: flex; }
.mobile-menu a { padding: 16px 6vw; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--line); }

/* ---------- 히어로 ---------- */
.hero {
    position: relative;
    min-height: 640px;
    display: flex;
    align-items: center;
    color: #fff;
    overflow: hidden;
    background: var(--navy-dark);
}
.hero .hero-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0.55;
}
.hero .hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15,23,64,0.55) 0%, rgba(15,23,64,0.85) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 720px; padding: 0 6vw; }
.hero-tag { font-size: 13px; letter-spacing: 3px; color: #7fd99a; font-weight: 700; margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -1px; line-height: 1.25; margin-bottom: 22px; }
.hero h1 em { color: #7fd99a; font-style: normal; }
.hero p { font-size: 17px; color: rgba(255,255,255,0.85); max-width: 520px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border-radius: 999px; font-size: 15px; font-weight: 700; border: 1px solid transparent; }
.btn.solid { background: var(--green); color: #fff; }
.btn.solid:hover { background: var(--green-dark); }
.btn.ghost { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn.ghost:hover { background: rgba(255,255,255,0.18); }
.btn.dark { background: var(--ink); color: #fff; }

/* ---------- 통계 카운터 ---------- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--card);
    margin: -46px auto 0;
    max-width: 1080px;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(20,15,5,0.12);
    position: relative;
    z-index: 5;
    overflow: hidden;
}
.stat-item { padding: 28px 20px; text-align: center; border-right: 1px solid var(--line); }
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 34px; font-weight: 800; color: var(--navy); }
.stat-num span { color: var(--green); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- 섹션 공통 ---------- */
section { padding: 96px 0; }
.section-head { margin-bottom: 44px; max-width: 640px; }
.section-tag { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--green-dark); margin-bottom: 10px; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 15px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

section.dark { background: var(--dark); color: #fff; }
section.dark .section-tag { color: #7fd99a; }
section.dark p { color: var(--dark-muted); }
section.band { background: var(--band); }

/* ---------- 카드 그리드(사업분야 등) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(var(--cat-cols, 3), 1fr); gap: 24px; }
.info-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 32px 26px; transition: transform .2s, box-shadow .2s;
}
.info-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(20,15,5,0.08); }
.info-card .num { font-size: 12px; font-weight: 700; color: var(--green-dark); letter-spacing: 2px; margin-bottom: 14px; }
.info-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.info-card p { font-size: 14px; color: var(--muted); }

/* ---------- 갤러리(납품현장) ---------- */
.gallery-toolbar { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.gallery-toolbar a, .gallery-toolbar button {
    display: inline-flex; align-items: center;
    padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
    transition: border-color .15s, color .15s;
}
.gallery-toolbar a:hover { border-color: var(--green); color: var(--green-dark); }
.gallery-toolbar a.on, .gallery-toolbar button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.gallery-card { border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.gallery-card .thumb { aspect-ratio: 4/3; width: 100%; object-fit: cover; background: var(--band2); }
.gallery-card .meta { padding: 14px 16px; }
.gallery-card .meta .tag { font-size: 11px; color: var(--green-dark); font-weight: 700; }
.gallery-card .meta h4 { font-size: 14.5px; font-weight: 700; margin: 4px 0 2px; }
.gallery-card .meta .loc { font-size: 12.5px; color: var(--muted); }

/* ---------- 제품 카드 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(var(--cat-cols, 4), 1fr); gap: 20px; }
.product-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.product-card .thumb { aspect-ratio: 1/1; width: 100%; object-fit: cover; background: var(--band2); }
.product-card .meta { padding: 16px; }
.product-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.product-card .price { font-size: 13px; color: var(--navy); font-weight: 700; }

/* ---------- 생산공정 ---------- */
.process-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.process-step { text-align: center; }
.process-circle {
    width: 64px; height: 64px; border-radius: 50%; background: rgba(126,217,154,0.12);
    color: #7fd99a; display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800; margin: 0 auto 14px; border: 1px solid rgba(126,217,154,0.4);
}
.process-step h4 { font-size: 15px; margin-bottom: 6px; }
.process-step p { font-size: 12.5px; color: var(--dark-muted); }

/* ---------- 제품 상세 모달 ---------- */
.product-modal {
    display: none; position: fixed; inset: 0; z-index: 500;
    background: rgba(15,15,10,0.55); align-items: center; justify-content: center; padding: 24px;
}
.product-modal.active { display: flex; }
.product-modal-box {
    position: relative; background: #fff; border-radius: var(--radius);
    max-width: 840px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 32px;
}
.product-modal-box img { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; margin: 0 auto 18px; border-radius: 10px; object-fit: contain; }
.product-modal-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.product-modal-close {
    position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--band); font-size: 18px; cursor: pointer;
}

/* ---------- 문의 폼 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-group { margin-bottom: 14px; }
.submit-btn { width: 100%; padding: 15px; border-radius: 999px; border: none; background: var(--green); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }

.map-box { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; }

/* PC 화면에서는 지도 비중을 줄이고 가견적이 있는 오른쪽 폼을 최대한 넓게 */
@media (min-width: 981px) {
    .contact-grid { grid-template-columns: 320px 1fr; }
    .map-box { aspect-ratio: 16/9; }
}

/* ---------- 가견적 계산기 품목행 ---------- */
.est-header, .est-row {
    display: grid;
    grid-template-columns: 1.3fr 0.65fr 0.7fr 0.7fr 0.55fr 0.8fr 0.8fr 0.75fr 0.9fr auto;
    gap: 6px;
    align-items: center;
}
.est-header { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.est-row { margin-bottom: 8px; font-size: 12.5px; }
.est-row > * { min-width: 0; }
.est-row select, .est-row input { width: 100%; padding: 8px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; font-family: inherit; }
.est-row .est-m2, .est-row .est-amount { text-align: right; }
.est-row .est-amount { font-weight: 700; color: var(--navy); }
.est-row .est-remove { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.est-field-label { display: none; }

/* ---------- 플로팅 모바일 문의 버튼 ---------- */
.mobile-cta {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
    background: var(--navy); color: #fff; text-align: center; padding: 14px;
    font-weight: 700; font-size: 15px;
}

/* ---------- 푸터 ---------- */
footer { background: var(--dark2); color: var(--dark-muted); padding: 60px 0 24px; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-logo { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 20px; font-size: 12px; }

/* ---------- 문서형 페이지(개인정보처리방침) ---------- */
.doc-body { max-width: 860px; margin: 60px auto 0; padding: 0 6vw; }
.doc-body section { margin-bottom: 20px; padding: 0; }
.doc-body h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.doc-body p, .doc-body li { font-size: 13.5px; line-height: 1.9; color: var(--muted); }
.doc-body ul { padding-left: 18px; margin-top: 8px; }
.doc-body li { margin-bottom: 6px; }

.doc-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; color: var(--muted); }
.doc-table th { background: var(--band); font-weight: 600; white-space: nowrap; }

.notice-box { margin: 40px 6vw 60px; max-width: 860px; margin-left: auto; margin-right: auto; padding: 18px 20px; background: var(--band); font-size: 12.5px; line-height: 1.8; color: var(--muted); border-radius: 10px; }

/* ---------- 반응형 ---------- */
@media (max-width: 980px) {
    nav.main-nav, .header-cta { display: none; }
    .mobile-menu-btn { display: block; }
    .card-grid, .gallery-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
    .process-row { grid-template-columns: repeat(2, 1fr); }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .mobile-cta { display: block; }
    body { padding-bottom: 54px; }

    .est-header { display: none; }
    .est-row {
        grid-template-columns: 1fr 1fr;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 14px;
        background: #fff;
        row-gap: 10px;
    }
    .est-row .est-item-wrap { grid-column: 1 / -1; }
    .est-row .est-m2, .est-row .est-amount { text-align: left; display: block; }
    .est-row .est-remove { grid-column: 1 / -1; justify-self: end; padding: 4px 10px; }
    .est-field-label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
}

@media (max-width: 560px) {
    .gallery-grid, .product-grid { grid-template-columns: 1fr 1fr; }
    section { padding: 64px 0; }
    .hero { min-height: 520px; }
    .doc-body, .notice-box { padding-left: 22px; padding-right: 22px; }
}
