/* style.css */

/* 삼성/안드로이드 필수 리셋 */
* {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html {
  -webkit-text-size-adjust: none;
  -ms-text-size-adjust: none;
  text-size-adjust: none;
  touch-action: manipulation;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden; /* 가로 스크롤 방지 */
}




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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #222;
  background: #ffffff;
}

img {
  max-width: 100%;
  display: block;
}

/* 공통 레이아웃 */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 70px 0;
}

.section-alt {
  background: #f5f7fb;
}

.section h2 {
  font-size: 28px;
  margin-bottom: 20px;
}

.section-desc {
  margin-bottom: 32px;
  color: #555;
}

/* 헤더 & 네비게이션 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffffd9;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e5e5;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-weight: 800;
  font-size: 20px;
}

.nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

.nav a:hover {
  color: #1e3c72;
}

/* 모바일 메뉴 기본 숨김 */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid #eee;
}

.nav-mobile a {
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
}

.nav-mobile.open {
  display: flex;
}

.hamburger {
  display: none;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

/* 히어로 섹션 */
.hero {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 40%, #ffffff 40%);
  color: #fff;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.hero-text h1 {
  font-size: 32px;
  margin-bottom: 16px;
}

.hero-text p {
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 480px;
}

.hero-image img {
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 버튼 */
.btn-primary {
  display: inline-block;
  padding: 12px 26px;
  background: #ffcc00;
  color: #222;
  border-radius: 999px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
}

.btn-primary:hover {
  background: #f0bd00;
}

.btn-full {
  width: 100%;
}

/* 카드/그리드 */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.card h3 {
  margin-bottom: 10px;
}

/* 작업 사진 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.work-item {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.work-item h3 {
  margin-bottom: 10px;
}

.caption {
  margin-top: 8px;
  font-size: 13px;
  color: #666;
}

/* 리스트 */
.list {
  list-style: disc;
  padding-left: 20px;
}

.list li {
  margin-bottom: 6px;
}

.list.numbered {
  list-style: decimal;
}

/* 폼 */
.apply-form {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 14px;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.form-group textarea {
  resize: vertical;
}

.form-note {
  margin: 14px 0;
  font-size: 13px;
  color: #666;
}

/* 푸터 */
.footer {
  border-top: 1px solid #e5e5e5;
  padding: 16px 0;
  font-size: 13px;
  color: #777;
}

.footer-inner {
  display: flex;
  justify-content: center;
}

/* 반응형 */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .hero {
    background: #1e3c72;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .apply-form {
    padding: 20px 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}


/* 삼성폰 특화 360~414px */
@media screen and (max-width: 414px) and (min-width: 360px) {
  .container {
    padding: 0 12px !important;
  }
  
  .hero-text h1 {
    font-size: 22px !important;
    line-height: 1.2 !important;
  }
  
  .btn-primary {
    padding: 16px 24px !important;
    font-size: 16px !important;
    min-height: 48px !important;
  }
}

/* 삼성 폴드/갤탭 */
@media screen and (max-width: 360px) {
  html {
    font-size: 14px !important;
  }
}



/* ===========================================
   모바일 반응형 (768px 이하)
============================================= */
@media screen and (max-width: 768px) {
  
  /* 헤더 */
  .nav-container {
    padding: 0 15px;
  }
  
  .logo {
    font-size: 18px;
  }
  
  /* 히어로 */
  .hero-inner {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 20px;
  }
  
  .hero-text h1 {
    font-size: 24px !important;
    line-height: 1.3;
  }
  
  .hero-text p {
    font-size: 15px;
  }
  
  /* 섹션 패딩 축소 */
  .section {
    padding: 40px 15px !important;
  }
  
  /* 그리드 1열 */
  .grid-3, .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  .works-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  /* 카드 */
  .card, .work-item {
    padding: 16px;
  }
  
  /* 폼 반응형 */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  .form-row {
    flex-direction: column !important;
    gap: 12px;
  }
  
  .apply-form {
    padding: 20px 16px;
  }
  
  /* 버튼 */
  .btn-primary {
    padding: 14px 20px;
    font-size: 16px; /* iOS 터치 최소 44px */
    min-height: 44px;
  }
  
  /* 옵션 그리드 */
  .option-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* 총액 */
  .total-price {
    font-size: 18px;
  }
  
  /* 팝업 */
  .popup-content {
    margin: 20px;
    padding: 24px 20px;
    max-width: none;
  }
}

/* ===========================================
   초소형 모바일 (480px 이하)
============================================= */
@media screen and (max-width: 480px) {
  .hero-text h1 {
    font-size: 20px !important;
  }
  
  h2 {
    font-size: 22px !important;
  }
  
  .service-options {
    padding: 16px;
  }
}


/* 삼성폰 그리드 폭 고정 */
.container {
  max-width: 100%;
  padding: 0 16px;
  margin: 0 auto;
  box-sizing: border-box;
  width: calc(100% - 32px); /* 패딩 고려 */
}

/* 삼성폰 그리드 강제 수정 */
@media screen and (max-width: 768px) {
  .grid-3, .grid-2, .form-grid, .option-grid, .works-grid {
    display: block !important; /* 그리드 → 블록 */
    width: 100%;
  }
  
  .grid-3 > *, .grid-2 > *, .form-grid > *, .works-grid > * {
    width: 100% !important;
    margin-bottom: 12px !important;
    display: block !important;
  }
  
  /* 폼 한 줄 길이 방지 */
  .form-group input, .form-group select, .form-group textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px; /* 모바일 최소 폰트 */
  }
  
  /* 버튼 길이 고정 */
  .btn-primary, .btn-secondary {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 14px 0 !important;
  }
}

/* 삼성폰 폭 계산 버그 방지 */
* {
  box-sizing: border-box !important;
}

html {
  width: 100%;
  overflow-x: hidden;
}


/* ===========================================
   갤럭시 폴드 전용 (접힘/펼침 모두 커버)
============================================= */

/* 폴드 접힘 모드 (6.2인치) */
@media screen and (max-width: 440px) and (min-width: 390px) and (-webkit-min-device-pixel-ratio: 2.75) {
  .container { padding: 0 12px !important; }
  .hero-text h1 { font-size: 20px !important; }
  .grid-3, .grid-2, .form-grid { display: block !important; }
}

/* 폴드 펼침 모드 (7.6인치) */
@media screen and (max-width: 830px) and (min-width: 740px) and (-webkit-min-device-pixel-ratio: 2.75) {
  .container { max-width: 100% !important; padding: 0 16px !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2, .form-grid { grid-template-columns: 1fr !important; }
}

/* 폴드 공통 (User Agent 감지) */
@supports (-webkit-appearance: -apple-pay-button) or (-webkit-touch-callout: none) {
  /* 폴드 해상도 고정 */
  html {
    width: 100vw !important;
    max-width: 100% !important;
  }
  
  body {
    min-width: 100vw !important;
    overflow-x: hidden !important;
  }
}

/* 폴드 강제 1열 (최종 방어선) */
@media screen and (max-aspect-ratio: 16/9) and (min-aspect-ratio: 9/16) {
  .grid-3 > *, .grid-2 > *, .form-grid > * {
    width: 100% !important;
    display: block !important;
  }
}