/* ==========================================================================
   Fix & Safe - Total Responsive Reset & Fix
   ========================================================================== */

/* 1. 모바일 공통 리셋 (768px 이하) */
@media (max-width: 768px) {
    /* 가로 스크롤 절대 방지 및 기본 여백 설정 */
    html, body { overflow-x: hidden; width: 100%; position: relative; }
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 20px !important; /* 좌우 여백 확보 */
        box-sizing: border-box !important;
    }

    /* [헤더 교정] 이미지 image_5c690a.png 대응 */
    .header { height: 60px !important; position: relative; z-index: 1000; }
    .header .container { display: flex !important; justify-content: space-between !important; align-items: center !important; height: 60px; }

    /* PC용 메뉴 강제 숨김 */
    .nav-menu, .header-util { display: none !important; }

    /* 로고 크기 조정 */
    .logo a { font-size: 20px !important; }

    /* 햄버거 버튼(삼선메뉴) 위치 및 크기 고정 */
    .button-container {
        display: block !important;
        position: relative !important;
        right: 0 !important;
		top: 0;
        margin: 0 !important;
        z-index: 1001;
    }

    /* [메인 비주얼] 히어로 영역 레이아웃 */
	.main-mov { top: 0; height: 200px; }
	.main-mov .mask { height: 100vh; background-size: cover; z-index: 10; }
	.main-mov video{ position: absolute!important; left: 0!important; top: -20px!important; }
    .main-hero { padding: 20px 0 40px !important; height: auto !important; }
    .main-hero .container { flex-direction: column !important; gap: 50px !important; }
    .hero-text-content { width: 100% !important; text-align: center; }
    .hero-text-content h1 { font-size: 24px !important; word-break: keep-all !important; }
    .hero-action-cards { width: 100% !important; max-width: 100% !important; margin: 0 auto !important; }
    .action-card { padding: 20px !important; }

    /* [교정] 안심 시공 사례 (image_5c5d0f.png 대응) */
    .section-work-list .icon-nav-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* 2열 배치 */
        gap: 10px !important;
        margin-bottom: 30px !important;
    }
    .section-work-list .nav-item {
        width: 100% !important;
        min-width: unset !important;
        padding: 15px 5px !important;
        background: #f8f9fa !important;
        border-radius: 10px !important;
    }
    .section-work-list .nav-item span {
        font-size: 13px !important;
        white-space: normal !important;
        word-break: keep-all !important;
        display: block !important;
    }

    /* 실시간 롤링 모바일 대응 */
    @media screen and (max-width: 768px) {
    .fx-live-rolling-bar { height: 48px; }
    .fx-rolling-label { font-size: 11px; padding: 3px 10px; margin-right: 12px; }
    .fx-rolling-list .r-fac, .fx-rolling-list .r-date { display: none; }
    .fx-rolling-list li { font-size: 13px; gap: 8px; }
    }

    /* [교정] 기술력 및 특허 (image_5c5d28.png 대응) */
    .patent-item dl { display: flex !important; flex-direction: row !important; /* 세로 1열 */ gap: 30px !important; align-items: center !important; margin-top: 20px; }
    .patent-item dd { width: 100% !important; text-align: center !important; }
	.patent-item dd span { font-size: 12px; line-height: 12px; display: block; margin-top: 10px; }

    /* 프로세스 바 교정 */
    .process-item { padding: 20px !important; height: auto !important; }
    .process-icon-circle { margin: 0 15px 15px 0 !important; width: 46px; height: 46px; padding: 7px; }
	.process-text h3 { font-size: 18px; }
	.process-text p { font-size: 14px; }

    /* 하단 버튼 너비 */
    .main-btn-wrap { width: 100% !important; margin-top: 20px !important; }

	.section-features, .section-process, .section-example, .section-patent, .section-banner { padding: 30px 0; }
	.section-title { font-size: 21px; margin-bottom: 20px; }
	.example-title { font-size: 16px; }
	.example-desc { font-size: 14px; }
	.patent-item p { font-size: 12px; line-height: 24px; }
	.patent-item p br { display: none; }

	.sub-visual { margin-top: 0; }
}

@media screen and (max-width: 768px) {
    .section-estimate-detail { padding: 30px 0 60px; }

    /* 상단 유틸 영역 세로 정렬 */
    .detail-top-util { flex-direction: column; align-items: flex-start; }
    .action-btn-group { width: 100%; overflow-x: auto; padding-bottom: 10px; white-space: nowrap; }

    /* 견적서 카드 패딩 축소 */
    .quotation-card { padding: 25px 15px; }

    /* 견적서 헤더 세로 정렬 */
    .quotation-header { flex-direction: column; gap: 15px; text-align: center; }
    .company-info { text-align: center; border-top: 1px solid #eee; padding-top: 15px; }

    /* 정보 그리드 한 줄로 변경 */
    .quotation-info-grid { grid-template-columns: 1fr; gap: 10px; }
    .info-row .label { width: 70px; font-size: 13px; }
    .info-row .value { font-size: 14px; }

    /* 합계 금액 박스 */
    .quotation-total-box { text-align: center; }
    .total-text span { display: block; font-size: 13px; margin-bottom: 5px; }
    .total-text strong { font-size: 20px; margin-left: 0; }

    /* 하단 버튼 그룹 */
    .final-btn-group { flex-direction: column; width: 100%; }
    .final-btn-group a { width: 100% !important; height: 55px; display: flex; align-items: center; justify-content: center; }
    .btn-confirm-order { order: -1; } /* 시공 승인 버튼을 위로 올림 */
}

/* ------개인정보관리 반응형------------ */
@media screen and (max-width: 768px) {
    .section-profile-edit { padding: 40px 0 60px; }

    /* 헤더 텍스트 정렬 */
    .page-header-flex { margin-bottom: 25px; text-align: center; }
    .header-text h2 { font-size: 22px; }
    .header-text p { font-size: 14px; }

    /* 카드 패딩 축소 */
    .profile-card { padding: 25px 20px; }

    /* 폼 레이아웃: 가로에서 세로로 전환 [핵심] */
    .form-row-item { flex-direction: column; align-items: stretch; margin-bottom: 25px; }
    .form-label { width: 100%; padding-top: 0; margin-bottom: 8px; font-size: 14px; }
    .form-input, .form-input-readonly { max-width: 100%; }

    /* 휴대폰 번호 + 버튼 그룹 */
    .flex-input-group { flex-direction: column; gap: 8px; }
    .btn-gray-outline { width: 100%; height: 45px; order: 2; } /* 버튼을 인풋 아래로 */

    /* 구분선 간격 조정 */
    .divider { margin: 30px 0; }

    /* 하단 액션 버튼 세로 정렬 */
    .profile-action-buttons { flex-direction: column; gap: 10px; margin-top: 35px; }
    .btn-cancel, .btn-save { width: 100% !important; height: 55px; font-size: 15px; }
    .btn-save { order: -1; } /* '수정 완료' 버튼을 위로 배치하여 접근성 향상 */

    /* 회원 탈퇴 영역 */
    .account-withdrawal { margin-top: 30px; font-size: 13px; }
    .account-withdrawal span { display: block; margin-bottom: 5px; }
}

/* 초소형 모바일 기기 (Max-width: 480px) */
@media screen and (max-width: 480px) {
    .profile-card { padding: 20px 15px; border-radius: 10px; }
    .form-section-title { font-size: 16px; margin-bottom: 20px; }
}

/* =================================================================
   📱 견적 신청 페이지 모바일 반응형 (Max-width: 768px) - estimate.php
==================================================================== */
@media screen and (max-width: 768px) {
    /* 서브 비주얼 영역 최적화 */
    .sub-visual.estimate-visual { padding: 40px 0; text-align: center; }
    .sub-title { font-size: 24px; margin-bottom: 10px; }
    .sub-description { font-size: 14px; word-break: keep-all; padding: 0 20px; }

    /* 섹션 레이아웃 */
    .section-estimate { padding: 30px 0 60px; }
    .estimate-narrow-wrap { padding: 0 15px; }

    /* 폼 카드 디자인 조정 */
    .form-card { padding: 25px 20px; margin-bottom: 25px; border-radius: 15px; }
    .card-title-wrap h2 { font-size: 18px; }

    /* 2열 그리드를 1열로 전환 [핵심] */
    .input-grid { grid-template-columns: 1fr !important; gap: 15px; }

    /* 태그 선택기 (시공 분야 등) 가로 스크롤 또는 줄바꿈 */
    .tag-selector { display: flex; flex-wrap: wrap; gap: 8px; }
    .tag-selector label { flex: 1 1 calc(50% - 8px); min-width: 120px; }
    .tag-selector label span { display: block; text-align: center; padding: 10px 5px; font-size: 13px; }

    /* 주소 검색 그룹 */
    .address-flex-group { flex-direction: column; gap: 8px; }
    .btn-address { width: 100%; height: 45px; order: 2; }

    /* 사진 업로드 영역 */
    .photo-flex-row { flex-direction: column; gap: 15px; }
    .photo-upload-box { width: 100%; height: 120px; }
    .upload-text { font-size: 12px; }

    /* 긴급도 선택기 */
    .urgency-selector { flex-direction: column; gap: 10px; }
    .urgency-selector label { width: 100%; }

    /* 하단 실행 버튼 영역 */
    .estimate-action-wrap { margin-top: 40px; }
    .estimate-btn-grid { display: flex; flex-direction: column; gap: 12px; }
    .btn-estimate-guest, .btn-estimate-member { width: 100% !important; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 15px; border-radius: 12px; }
    .btn-estimate-member { order: -1; padding: 0 20px; text-align: center; } /* 회원 신청을 위로 */

    /* 유의사항 텍스트 */
    .estimate-notice-group { margin-top: 25px; }
    .estimate-notice-text { font-size: 12px; line-height: 1.6; text-align: left; margin-bottom: 8px; }
	.section-my-estimate { padding: 50px 0;}
	.estimate-summary-grid { grid-template-columns: repeat(2, 1fr); }
	.estimate-item-card { flex-wrap: wrap; }
	.item-meta { margin-bottom: 20px; flex-direction: column; }
	.item-action-side { width: 100%; }
	.section-guide-list .filter-item { padding: 10px 15px; }
	.section-guide-list .guide-grid-container { grid-template-columns: repeat(1, 1fr); }
}

/* 초소형 모바일 (Max-width: 480px) */
@media screen and (max-width: 480px) {
    .tag-selector label { flex: 1 1 100%; } /* 태그도 한 줄에 하나씩 */
    .form-card { padding: 20px 15px; }
}

/* 모바일 반응형 조정 */
@media screen and (max-width: 580px) {
    .final-btn-group { flex-direction: column; }
    .btn-cancel-order, .btn-confirm-order, .btn-re-estimate { width: 100%; flex: none; }
}

/* ------find_pw.php-------- */
@media screen and (max-width: 480px) {
    .section-find-account { padding: 40px 15px; }
    .find-content-wrap { padding: 35px 20px; }
    .find-header h3 { font-size: 20px; }
    .icon-circle { width: 50px; height: 50px; font-size: 20px; margin-bottom: 15px; }
    .btn-submit-find { height: 52px; font-size: 15px; }
    .form-control { height: 46px; font-size: 14px; }
}

/* 시공 완료 리포트 반응형 */
@media screen and (max-width: 768px) {
    .report-card { padding: 30px 20px; }
    .report-header h2 { font-size: 22px; }
    .report-summary-grid { grid-template-columns: 1fr; gap: 15px; }
    .photo-compare-grid { grid-template-columns: 1fr; }
    .report-final-action { flex-direction: column; }
    .btn-list-go, .btn-as-request { width: 100%; text-align: center; }
}

/* 이용약관 모바일 대응 */
@media screen and (max-width: 992px) {
    .terms-aside { display: none; } /* 모바일에서는 사이드바 숨김 */
    .section-terms-page { padding: 50px 15px; }
    .page-header-center h2 { font-size: 26px; }
    .terms-main-title { font-size: 20px; }
}

/* 480px 이하 초소형 기기 */
@media (max-width: 480px) {
    .hero-text-content h1 { font-size: 22px !important; }
    .section-work-list .icon-nav-row { grid-template-columns: 1fr !important; } /* 1열 배치 */
}
