/* 태블릿·모바일 + 강제 모바일 모드(data-view=mobile) */

/* 공통 모바일 레이아웃 — 실제 좁은 화면 */
@media (max-width: 1100px) {
  .shortcut-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .info-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .header-top {
    min-height: 0;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-phones {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .header-phone {
    min-width: 0;
    padding: 8px 10px;
  }

  .header-phone strong {
    font-size: 1.2rem;
  }

  .header-phone-sub strong {
    font-size: 0.95rem;
  }

  .header-bar-inner {
    position: relative;
    min-height: 52px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2933;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 0 8px;
    z-index: 40;
    max-height: min(70vh, 480px);
    overflow: auto;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav a {
    width: 100%;
  }

  .header-cta {
    margin-left: auto;
  }

  .hero-grid,
  .mall-grid,
  .info-grid,
  .detail-layout,
  .location-grid,
  .footer-grid,
  .project-layout,
  .deal-banner {
    grid-template-columns: 1fr;
  }

  .shortcut-grid,
  .topic-grid,
  .contact-grid,
  .product-grid,
  .iot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .consult-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .consult-phones {
    min-width: 0;
    width: 100%;
  }

  .cate {
    position: static;
  }

  .mall-main {
    order: -1;
  }

  .deal-visual img {
    min-height: 200px;
    max-height: 240px;
  }
}

@media (max-width: 768px) {
  .point-list,
  .shortcut-grid,
  .topic-grid,
  .contact-grid,
  .project-grid,
  .product-grid,
  .iot-grid {
    grid-template-columns: 1fr;
  }

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

  .brand-name span {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .header-phone span {
    font-size: 0.72rem;
  }

  .header-phone strong {
    font-size: 1.05rem;
    word-break: keep-all;
  }

  .header-phone-sub strong {
    font-size: 0.92rem;
  }

  .container {
    width: min(100% - 24px, var(--container));
  }

  .mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: 1.15fr 1fr 0.9fr;
    background: var(--white);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -6px 18px rgba(23, 23, 23, 0.08);
  }

  html[data-view="pc"] .mobile-dock {
    display: none;
  }

  html[data-view="pc"] body {
    padding-bottom: 0;
  }

  .mobile-dock a {
    min-height: var(--dock-h);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--ink);
  }

  .mobile-dock a:hover {
    color: var(--ink);
  }

  .mobile-dock .is-call {
    background: var(--orange);
    color: var(--white);
  }

  .mobile-dock .is-call:hover {
    background: var(--orange-hover);
    color: var(--white);
  }

  .mobile-dock .is-mobile {
    background: #1f2933;
    color: #fff;
  }

  .mobile-dock .is-mobile:hover {
    background: #111827;
    color: #fff;
  }

  body {
    padding-bottom: calc(var(--dock-h) + 16px + env(safe-area-inset-bottom));
  }

  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .hero {
    padding-top: 12px;
  }

  .deal-copy {
    padding: 20px 18px;
  }

  .deal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .deal-actions .btn {
    min-width: 0;
    white-space: normal;
  }

  .section-head p,
  .faq-list,
  .topic-card,
  .product-card,
  .iot-card {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 640px) {
  .point-list,
  .package-grid {
    grid-template-columns: 1fr;
  }

  .header-phones {
    grid-template-columns: 1fr;
  }

  .header-phone strong {
    font-size: 1.2rem;
  }
}

/* =========================================================
   강제 모바일 모드 (PC에서 화면모드=모바일)
   실제 창이 넓어도 미디어쿼리와 같은 모바일 레이아웃 적용
   ========================================================= */
html[data-view="mobile"] {
  background: #cfd5dc;
}

html[data-view="mobile"] body {
  max-width: 430px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.08), 0 18px 40px rgba(23, 23, 23, 0.12);
  min-height: 100vh;
  overflow-x: clip;
  padding-bottom: calc(var(--dock-h) + 16px + env(safe-area-inset-bottom));
}

html[data-view="mobile"] .container {
  width: min(100% - 24px, 430px);
}

html[data-view="mobile"] .header-top {
  min-height: 0;
  padding: 10px 0;
  flex-wrap: wrap;
  gap: 10px;
}

html[data-view="mobile"] .brand {
  flex: 1 1 auto;
  min-width: 0;
}

html[data-view="mobile"] .brand-name span {
  display: none;
}

html[data-view="mobile"] .header-phones {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

html[data-view="mobile"] .header-phone {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
}

html[data-view="mobile"] .header-phone strong {
  font-size: 1.05rem;
}

html[data-view="mobile"] .header-phone-sub {
  display: flex;
}

html[data-view="mobile"] .header-phone-sub strong {
  font-size: 0.92rem;
}

html[data-view="mobile"] .header-bar-inner {
  position: relative;
  min-height: 52px;
}

html[data-view="mobile"] .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-view="mobile"] .site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1f2933;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 0 8px;
  z-index: 40;
  max-height: min(70vh, 480px);
  overflow: auto;
}

html[data-view="mobile"] .site-nav.is-open {
  display: block;
}

html[data-view="mobile"] .site-nav ul {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

html[data-view="mobile"] .site-nav a {
  width: 100%;
}

html[data-view="mobile"] .header-cta {
  display: none;
}

html[data-view="mobile"] .hero-grid,
html[data-view="mobile"] .mall-grid,
html[data-view="mobile"] .info-grid,
html[data-view="mobile"] .detail-layout,
html[data-view="mobile"] .location-grid,
html[data-view="mobile"] .footer-grid,
html[data-view="mobile"] .project-layout,
html[data-view="mobile"] .deal-banner {
  grid-template-columns: 1fr;
}

html[data-view="mobile"] .point-list,
html[data-view="mobile"] .shortcut-grid,
html[data-view="mobile"] .topic-grid,
html[data-view="mobile"] .contact-grid,
html[data-view="mobile"] .project-grid,
html[data-view="mobile"] .product-grid,
html[data-view="mobile"] .iot-grid,
html[data-view="mobile"] .package-grid {
  grid-template-columns: 1fr;
}

html[data-view="mobile"] .cate {
  position: static;
}

html[data-view="mobile"] .mall-main {
  order: -1;
}

html[data-view="mobile"] .consult-inner {
  flex-direction: column;
  align-items: stretch;
}

html[data-view="mobile"] .consult-phones {
  min-width: 0;
  width: 100%;
}

html[data-view="mobile"] .deal-actions {
  flex-direction: column;
  align-items: stretch;
}

html[data-view="mobile"] .deal-actions .btn {
  min-width: 0;
  white-space: normal;
}

html[data-view="mobile"] .deal-visual img {
  min-height: 180px;
  max-height: 220px;
}

html[data-view="mobile"] .mobile-dock {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  width: min(430px, 100%);
  transform: translateX(-50%);
  background: var(--white);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 18px rgba(23, 23, 23, 0.08);
}

html[data-view="mobile"] .mobile-dock a {
  min-height: var(--dock-h);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
}

html[data-view="mobile"] .mobile-dock .is-call {
  background: var(--orange);
  color: #fff;
}

html[data-view="mobile"] .mobile-dock .is-mobile {
  background: #1f2933;
  color: #fff;
}

html[data-view="mobile"] .site-footer {
  padding-bottom: calc(28px + var(--dock-h) + env(safe-area-inset-bottom));
}

html[data-view="mobile"] .view-mode-toast {
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(400px, calc(100% - 24px));
}

html[data-view="mobile"] .section-head p,
html[data-view="mobile"] .topic-card,
html[data-view="mobile"] .product-card,
html[data-view="mobile"] .iot-card,
html[data-view="mobile"] .faq-list {
  overflow-wrap: anywhere;
}

html[data-view="mobile"] .site-header,
html[data-view="mobile"] .header-bar,
html[data-view="mobile"] main,
html[data-view="mobile"] .site-footer {
  max-width: 100%;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .package-card,
  .product-card,
  .iot-card,
  .shortcut-card,
  .topic-card,
  .project-card,
  .consult-phone,
  .product-media img,
  .iot-media img {
    transition: none;
  }

  .product-card:hover,
  .iot-card:hover,
  .package-card:hover,
  .shortcut-card:hover,
  .topic-card:hover,
  .project-card:hover {
    transform: none;
  }
}
