/* ========================================
   승대지질(주) 모바일 최적화 공통 스타일
   모든 페이지 <style> 뒤에 로드 → 우선 적용
   ======================================== */

/* ---------- 태블릿 이하 ---------- */
@media(max-width:860px){

  /* 상단바 — 로고·전화버튼·햄버거가 한 줄에 들어가게 */
  .nav-inner{height:62px!important;padding:0 14px!important;gap:10px}
  .logo-svg-wrap{flex-shrink:1;min-width:0}
  .logo-svg-wrap svg{width:152px!important;height:37px!important}
  .nav-cta{padding:9px 12px!important;font-size:12px!important;letter-spacing:-.4px;
           box-shadow:none;flex-shrink:0}
  .hamburger{flex-shrink:0;padding:8px 2px;margin-left:2px}
  .hamburger span{width:22px}

  /* 드롭다운 메뉴 — 열었을 때 화면을 넘지 않게 */
  .nav-links{max-height:calc(100vh - 62px);overflow-y:auto;-webkit-overflow-scrolling:touch;
             padding-bottom:20px}
  .nav-links>li>a{padding:14px 16px!important;font-size:15px!important}
  .sub a{padding:13px 14px!important;font-size:14px!important}

  /* 가로 스크롤 유발 요소 차단 */
  body{overflow-x:hidden}
  .about-img-stack,.img-main{margin-left:0!important;margin-right:0!important}
  img{max-width:100%;height:auto}

  /* 표·코드 등 넓은 요소는 자체 스크롤 */
  table{display:block;overflow-x:auto;white-space:nowrap}
}

/* ---------- 스마트폰 ---------- */
@media(max-width:560px){

  /* 상단 전화버튼은 하단 고정바로 대체 */
  .nav-cta{display:none!important}
  .logo-svg-wrap svg{width:164px!important;height:40px!important}

  /* 섹션 여백 — 좌우를 좁혀 글이 넓게 보이도록 */
  section{padding:52px 18px!important}
  .sec-title{font-size:25px!important;letter-spacing:-1px!important;line-height:1.25!important}
  .sec-desc{font-size:14.5px!important;line-height:1.75!important}
  .eyebrow{font-size:11px!important}

  /* 메인 히어로 */
  .hero-inner{padding:88px 18px 44px!important;min-height:auto!important;gap:28px!important}
  .hero h1{font-size:29px!important;letter-spacing:-1.1px!important;line-height:1.26!important;
           margin-bottom:16px!important}
  .hero-sub{font-size:14.5px!important;line-height:1.8!important;margin-bottom:24px!important}
  .hero-badge{padding:6px 13px!important;margin-bottom:16px!important}
  .hero-badge span{font-size:10.5px!important;letter-spacing:0!important}
  .hero-stats{grid-template-columns:1fr 1fr!important;gap:10px!important}

  /* 서브페이지 히어로 */
  .phero{padding:96px 18px 44px!important;min-height:auto!important}
  .phero h1{font-size:27px!important;letter-spacing:-1px!important;line-height:1.26!important}
  .phero p{font-size:14.5px!important;line-height:1.75!important}

  /* 사진 위 글자가 묻히지 않게 어둡기 보강 */
  .hero-overlay,.phero-ov{background:linear-gradient(120deg,
    rgba(11,29,53,.80) 0%,rgba(11,29,53,.70) 55%,rgba(11,29,53,.78) 100%)!important}

  /* 카드·그리드는 모두 1열 */
  .svc-grid,.port-grid,.part-grid,.cert-grid,.award-grid,.stats-grid,
  .qnav,.proc,.str-grid,.faq-grid,.esg-grid{grid-template-columns:1fr!important}
  .hero-stats{grid-template-columns:1fr 1fr!important}

  /* 상세 항목 — 사진이 글 위로 */
  .det{grid-template-columns:1fr!important;gap:22px!important;padding:38px 0!important}
  .det.rev .det-txt{order:1}
  .det.rev .det-img{order:2}
  .det-img img{height:210px!important}
  .det h3{font-size:22px!important;letter-spacing:-.8px!important}
  .det p,.det-list li{font-size:14.5px!important;line-height:1.8!important}

  /* 손가락으로 누를 수 있는 크기 확보 */
  .qnav a,.det-more,.faq-q,.chip,.btn,.sub a{min-height:44px;display:flex;align-items:center}
  .qnav a{padding:14px 16px!important}

  /* 본문 가독성 */
  p,li{font-size:14.5px;line-height:1.8}
  h2{font-size:23px!important;letter-spacing:-.9px!important;line-height:1.3!important}
  h3{font-size:19px!important;letter-spacing:-.6px!important}

  /* 푸터 */
  .footer-grid{grid-template-columns:1fr!important;gap:26px!important}
  footer{padding:42px 18px 96px!important}
  .footer-desc{font-size:12.5px!important;line-height:1.85!important}

  /* CTA 박스 */
  .cta-big,.contact-left{padding:24px 20px!important}
  .cta-info{flex-direction:column;gap:14px!important;align-items:flex-start}

  /* 하단 고정바에 가리지 않도록 여백 */
  body{padding-bottom:0}
}

/* ========================================
   하단 고정 전화 바 — 스마트폰 전용
   ======================================== */
.mbar{display:none}

@media(max-width:560px){
  .mbar{
    display:grid;grid-template-columns:1.25fr 1fr;gap:8px;
    position:fixed;left:0;right:0;bottom:0;z-index:2000;
    padding:9px 12px calc(9px + env(safe-area-inset-bottom));
    background:rgba(9,23,43,.97);backdrop-filter:blur(14px);
    border-top:1px solid rgba(200,146,26,.3);
    box-shadow:0 -6px 24px rgba(0,0,0,.45)
  }
  .mbar a{
    display:flex;align-items:center;justify-content:center;gap:7px;
    min-height:48px;border-radius:10px;text-decoration:none;
    font-size:14.5px;font-weight:800;letter-spacing:-.4px
  }
  .mbar .mbar-call{
    background:linear-gradient(135deg,#C8921A,#E8B84B);color:#0B1D35;
    box-shadow:0 3px 14px rgba(200,146,26,.4)
  }
  .mbar .mbar-sub{
    background:rgba(255,255,255,.08);color:#fff;
    border:1px solid rgba(255,255,255,.18)
  }
  .mbar a:active{transform:scale(.97)}
}

/* ---------- 한글 줄바꿈 보정 ---------- */
@media(max-width:560px){
  /* 단어 중간에서 끊기지 않게 */
  h1,h2,h3,h4,h5,p,li,a,span,div,.trust-label,.sec-desc,.det p,.det-list li{
    word-break:keep-all;overflow-wrap:break-word}
  .trust-bar{flex-direction:column;gap:8px!important;text-align:center;padding:14px 18px!important}
  .trust-bar>*{justify-content:center}
  .trust-label{font-size:13px!important;line-height:1.6!important}
}

/* ============================================================
   PC 버전 / 모바일 버전 전환 버튼
   ============================================================ */
.viewswitch{
  display:none;align-items:center;justify-content:center;gap:8px;
  margin:22px auto 0;padding:13px 22px;
  background:rgba(255,255,255,.07);border:1px solid rgba(200,146,26,.35);
  border-radius:10px;color:#E8B84B;font-size:14px;font-weight:700;
  letter-spacing:-.3px;text-decoration:none;cursor:pointer;
  font-family:inherit;min-height:46px;width:100%;max-width:280px
}
.viewswitch:active{transform:scale(.98)}

/* 실제 작은 화면에서 모바일 버전을 보고 있을 때 */
@media(max-width:860px){
  html[data-view="mobile"] .viewswitch{display:flex}
}
/* PC 버전을 선택한 상태에서는 화면 폭과 무관하게 항상 보이게
   (되돌아갈 방법이 없어지면 안 되므로) */
html[data-view="pc"] .viewswitch{display:flex}

/* PC 버전일 때는 아래에 떠 있는 되돌리기 칩도 함께 제공 */
html[data-view="pc"] .viewswitch-float{
  display:flex;align-items:center;justify-content:center;gap:7px;
  position:fixed;right:14px;bottom:14px;z-index:2100;
  padding:12px 18px;border-radius:24px;border:1px solid rgba(200,146,26,.45);
  background:rgba(9,23,43,.96);color:#E8B84B;
  font-size:14px;font-weight:700;letter-spacing:-.3px;
  box-shadow:0 6px 22px rgba(0,0,0,.5);cursor:pointer;font-family:inherit
}
.viewswitch-float{display:none}

/* PC 버전을 보는 중에는 하단 고정 전화바를 숨김 (레이아웃 방해) */
html[data-view="pc"] .mbar{display:none!important}

/* 떠 있는 되돌리기 칩은 PC 버전일 때만 (모바일 모드에서는 숨김) */
html[data-view="mobile"] .viewswitch-float{display:none!important}
