/* mobile.css — WizCube 모바일 전용 스타일 (768px 이하)
   styles.css와 함께 로드. 데스크톱 styles.css 규칙에 영향 없음.
   ========================================================================= */

/* =========================================================================
   모바일 메뉴 (햄버거 + 드로어) — 768px 이하에서만 동작
   드로어(.mmenu)는 #scaler/#page 바깥(body 직속)에 배치 → zoom 영향 없이 1:1 유지
   ========================================================================= */
.hamb {
  display: none;
}
.mmenu {
  display: none;
}
/* 드로어 링크 아이콘 (mask-image 단색) */
.micon {
  width: 22px;
  height: 22px;
  flex: none;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}
.micon--home {
  mask-image: url(icons/home.svg);
  -webkit-mask-image: url(icons/home.svg);
}
.micon--info {
  mask-image: url(icons/info.svg);
  -webkit-mask-image: url(icons/info.svg);
}
.micon--guide {
  mask-image: url(icons/guide.svg);
  -webkit-mask-image: url(icons/guide.svg);
}
.micon--pin {
  mask-image: url(icons/pin.svg);
  -webkit-mask-image: url(icons/pin.svg);
}
.micon--notice {
  mask-image: url(icons/notice.svg);
  -webkit-mask-image: url(icons/notice.svg);
}
.micon--chat {
  mask-image: url(icons/chat.svg);
  -webkit-mask-image: url(icons/chat.svg);
}

/* =========================================================================
   모바일 레이아웃 — 768px 이하
   이 분기점 아래에서는 site.js가 데스크톱 zoom을 끄고 유동 레이아웃으로 전환.
   (300px 미만은 콘텐츠 300px 고정 + 배율 축소 — site.js fit() 참고)
   타이포·간격은 design.md의 8px 그리드를 유지.
   ========================================================================= */
@media (max-width: 767px) {
  /* ---- 유동 폭 전환 ---- */
  #page {
    width: 100%;
    min-width: 300px;
  }

  /* ---- 공통 좌우 여백 16px (8px 그리드) ---- */
  .wrap,
  .hdr__in,
  .hero__in,
  .foot__in,
  .foot__bottom,
  .appcta__panel {
    max-width: calc(100% - 64px);
    padding-inline: 0;
  }

  /* ---- 타이포 축소 ---- */
  .h1 {
    font-size: 34px;
    line-height: 1.14;
  }
  .h2 {
    font-size: 24px;
  }
  .hero .h1 {
    font-size: 34px;
  }

  /* ---- 슬림 헤더 (로고 + 햄버거) ---- */
  .hdr__in {
    height: 60px;
    gap: 16px;
  }
  .nav,
  .hdr__cta {
    display: none;
  }
  .logo {
    height: 32px;
  }
  .logo__img {
    height: 26px;
  }

  /* ---- 햄버거 버튼 ---- */
  .hamb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: -8px;
    margin-left: auto;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    flex: none;
  }
  .hamb__lines {
    position: relative;
  }
  .hamb__lines,
  .hamb__lines::before,
  .hamb__lines::after {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease, background 0.2s ease;
  }
  .hamb__lines::before,
  .hamb__lines::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .hamb__lines::before {
    top: -7px;
  }
  .hamb__lines::after {
    top: 7px;
  }
  .hamb[aria-expanded="true"] .hamb__lines {
    background: transparent;
  }
  .hamb[aria-expanded="true"] .hamb__lines::before {
    transform: translateY(7px) rotate(45deg);
  }
  .hamb[aria-expanded="true"] .hamb__lines::after {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ---- 드로어 메뉴 ---- */
  .mmenu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 200;
    visibility: hidden;
    transition: visibility 0s linear 0.3s;
  }
  .mmenu.open {
    visibility: visible;
    transition-delay: 0s;
  }
  .mmenu__scrim {
    position: absolute;
    inset: 0;
    background: rgba(21, 23, 28, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
  }
  .mmenu.open .mmenu__scrim {
    opacity: 1;
  }
  .mmenu__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(82%, 320px);
    background: var(--bg);
    box-shadow: -20px 0 50px rgba(20, 20, 30, 0.16);
    display: flex;
    flex-direction: column;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    overflow-y: auto;
  }
  .mmenu.open .mmenu__panel {
    transform: none;
  }
  .mmenu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    margin-bottom: 12px;
    padding: 0 4px;
    flex: none;
  }
  .mmenu__head .logo__img {
    height: 24px;
  }
  .mmenu__close {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 50%;
    cursor: pointer;
    flex: none;
    padding: 0;
  }
  .mmenu__close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
  }
  .mmenu__close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
  }
  .mmenu__close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
  }
  .mmenu__link {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 54px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
  }
  .mmenu__link .micon {
    color: var(--muted);
    transition: color 0.18s ease;
  }
  .mmenu__link:hover {
    background: var(--surface);
  }
  .mmenu__link.active {
    color: var(--primary);
    background: var(--surface);
  }
  .mmenu__link.active .micon {
    color: var(--primary);
  }
  .mmenu__cta {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding: 20px 4px 4px;
  }
  .mmenu__cta .badge {
    flex: 1 1 0;
    min-width: 0;
    height: 52px;
    padding-inline: 14px;
    gap: 10px;
  }

  /* ---- 섹션 간격 ---- */
  .section {
    padding-block: 56px;
  }
  .find-page {
    padding-top: 40px;
  }
  .card {
    padding: 24px;
  }
  .sec-head {
    margin-bottom: 32px;
  }
  .sec-head p {
    font-size: 16px;
  }

  /* ---- 히어로: 텍스트 먼저, 이미지 아래로 ---- */
  .hero {
    padding-top: 28px;
  }
  .hero__in {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: auto;
  }
  .hero__media {
    order: -1;
    height: 300px;
  }
  .hero__copy {
    max-width: none;
  }
  .hero .label {
    margin-bottom: 14px;
  }
  .hero .h1 {
    margin-bottom: 18px;
  }
  .hero__sub {
    font-size: 16px;
    max-width: none;
    margin-bottom: 28px;
  }
  .hero__chip {
    left: 16px;
    bottom: 16px;
    padding: 12px 16px;
    border-radius: 14px;
  }

  /* ---- features / steps → 스와이프 캐러셀 (site.js가 .mcar 추가 + 도트/자동루프) ---- */
  .features,
  .steps {
    grid-template-columns: 1fr;
  }
  .features.mcar,
  .steps.mcar {
    display: flex;
    grid-template-columns: none;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -32px;
    padding-inline: 32px;
    scroll-padding-left: 32px;
    cursor: grab;
  }
  .features.mcar--grab,
  .steps.mcar--grab {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .features.mcar--grab *,
  .steps.mcar--grab * {
    user-select: none;
    -webkit-user-select: none;
  }
  .features.mcar::-webkit-scrollbar,
  .steps.mcar::-webkit-scrollbar {
    display: none;
  }
  .features.mcar > *,
  .steps.mcar > * {
    flex: 0 0 82%;
    min-width: 0;
    scroll-snap-align: start;
  }
  /* 캐러셀 안에서는 step도 카드면으로 */
  .steps.mcar > .step {
    background: var(--surface);
    border-radius: var(--r-card);
    padding: 28px 24px;
  }
  .mcar-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
  }
  .mcar-dot {
    width: 8px;
    height: 8px;
    border-radius: 100px;
    background: var(--line);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s, width 0.25s;
  }
  .mcar-dot.active {
    background: var(--primary);
    width: 24px;
  }

  /* ---- 앱 다운로드 배지: "다운로드" 텍스트 숨김 + 가로 2열 ---- */
  .badges {
    width: 100%;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .hero__actions .badge,
  .appcta .badge {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 16px;
    gap: 10px;
    justify-content: flex-start;
  }
  .badge__dl {
    display: none;
  }

  /* ---- find ---- */
  .find {
    grid-template-columns: 1fr;
  }
  .find__map {
    min-height: 280px;
  }
  .search {
    flex-direction: column;
    align-items: stretch;
  }
  .search__field {
    height: 56px;
  }
  .search .btn {
    height: 52px;
    width: 100%;
  }
  .find-empty {
    padding: 56px 24px;
  }

  /* ---- about ---- */
  .about-story {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .about-story__img {
    height: 280px;
  }
  .about-story__text p {
    font-size: 16px;
  }

  /* ---- contact ---- */
  .contact {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .contact-info__big {
    font-size: 24px;
  }
  .contact-info__big--sm {
    font-size: 20px;
  }

  /* ---- 사이즈 캐러셀: 한 장씩 ---- */
  .size-carousel__slide {
    flex: 0 0 100%;
  }
  .size-price strong {
    font-size: 24px;
  }

  /* ---- 공지 리스트: 날짜 위, 제목 아래 ---- */
  .notice-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px 8px;
  }
  .notice-row__date {
    width: auto;
  }
  .notice-row__title {
    font-size: 16px;
  }

  /* ---- FAQ ---- */
  .faq__item {
    padding: 0 22px;
  }
  .faq__item summary {
    font-size: 16px;
    padding: 20px 0;
  }

  /* ---- 공지 모달 ---- */
  .notice-modal-overlay {
    padding: 16px;
  }
  .notice-modal__head {
    padding: 32px 24px 0;
  }
  .notice-modal__title {
    font-size: 19px;
    padding-right: 24px;
  }
  .notice-modal__body {
    padding: 20px 24px 32px;
  }

  /* ---- 앱 CTA 패널 ---- */
  .appcta {
    padding: 56px 0;
  }
  .appcta__panel {
    grid-template-columns: 1fr;
    padding: 40px 24px 0;
    gap: 28px;
  }
  .appcta__copy {
    padding-bottom: 32px;
  }
  .appcta__copy .h2 {
    font-size: 26px;
  }
  .appcta__phone {
    height: 260px;
  }

  /* ---- 푸터 ---- */
  .foot {
    padding-top: 48px;
  }
  .foot__in {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  /* 서비스·고객지원 컬럼 숨김, 문의 + 브랜드만 유지 */
  .foot__col:nth-child(2),
  .foot__col:nth-child(3) {
    display: none;
  }
  .foot__brand {
    grid-column: 1 / -1;
  }
  .foot__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 24px;
    line-height: 1.5;
    padding-bottom: 24px;
  }
}
