/* ===== 1400px 이하: 헤더 여백 줄이고 히어로 비율 살짝 조정 ===== */
@media (max-width: 1400px) {
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  header h2 {
    margin-left: 180px;
  }

  nav {
    margin-right: 180px;
  }

  .slide-inner {
    grid-template-columns: 1fr 480px;
    gap: 24px;
    padding: 32px 28px;
  }

  .hero-img {
    width: 205%;
  }

  .banner-card {
    width: 82%;
  }

  .content {
    max-width: 82%;
  }
}

/* ===== 1200px 이하: 컨텐츠 폭 넓히고 카드 폭 정리 ===== */
@media (max-width: 1200px) {
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  header h2 {
    margin-left: 120px;
  }

  nav {
    margin-right: 120px;
    gap: 24px;
  }

  .slide-inner {
    grid-template-columns: 1fr 460px;
    padding: 28px 24px;
  }

  .feature-card {
    max-width: 300px;
  }

  .banner img {
    width: 94%;
    margin: 16px;
  }

  .content {
    max-width: 90%;
  }
}

/* ===== 1024px 이하(태블릿): 헤더 2줄 가능, 네비 줄바꿈 & 스와이퍼 살짝 축소 ===== */
@media (max-width: 1024px) {
  header {
    display: flex;
    flex-wrap: wrap;
    /* 메뉴 줄바꿈 허용 */
    align-items: center;
    justify-content: center;
    /* 양쪽 균등 */
    padding: 0.75rem 1rem;
    row-gap: 8px;
  }

  header h2 {
    margin: 0;
    flex: 1 1 100%;
    text-align: center;
    font-size: 1.35rem;
  }

  nav {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 0;
    padding: 0 0 8px;
  }

  nav a {
    font-size: .95rem;
  }

  .slide-inner {
    grid-template-columns: 1fr 420px;
    min-height: 360px;
    gap: 22px;
  }

  .hero-img {
    width: 108%;
  }

  .banner-card {
    width: 94%;
    margin-top: 16px;
  }

  .features-2 {
    padding: 2.4rem 0 2rem;
  }
}

/* ===== 900px 이하(작은 태블릿): 히어로 단일 컬럼 전환 ===== */
@media (max-width: 900px) {
  header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  header h2 {
    margin: 0 0 6px;
    text-align: center;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 0;
  }

  .slide-inner {
    grid-template-columns: 1fr;
    min-height: unset;
    padding: 24px 20px;
  }

  .hero-content {
    max-width: none;
    text-align: left;
    width: 100%;
  }

  .hero-visual {
    position: relative;
    height: auto;
    width: 0px;
    justify-content: center;
    align-items: center;
  }

  .feature-card {
    flex: 1 1 44%;
    max-width: none;
  }
}

/* ===== 768px 이하(모바일 기준 진입): 레이아웃 세로 스택, 폰트/패딩 다운스케일 ===== */
@media (max-width: 768px) {
  nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  nav a {
    padding-bottom: 2px;
  }

  .swiper {
    height: auto;
  }

  .hero-content h1 {
    font-size: clamp(24px, 6vw, 34px);
    line-height: 1.28;
  }

  .hero-content p {
    font-size: .95rem;
  }

  .hero-content .cta {
    padding: 9px 18px;
    font-size: 12.5px;
  }

  .banner img {
    width: 96%;
    margin: 12px;
  }

  .feature-card-list {
    gap: 16px;
    padding: 0 12px;
  }

  .feature-card {
    padding: 1.2rem 1.2rem 1.6rem;
    min-height: 220px;
  }

  .feature-desc {
    max-width: 100%;
    font-size: 12.5px;
  }

  .content {
    max-width: 96%;
    padding: 0 12px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .box,
  .card {
    padding: 20px 18px;
  }

  .scroll-container {
    height: 240px;
  }

  .voucher_card,
  .pin_card,
  .voucher_history {
    padding: 1.2rem 1.2rem 1.5rem;
  }

  .gc-btn {
    font-size: 16px;
    padding: 15px 0;
    border-radius: 10px;
  }
}

/* ===== 640px 이하: 네비 언더라인 위치/두께 보정, 리스트/버튼 터치 최적화 ===== */
@media (max-width: 640px) {
  header {
    padding: .75rem .9rem;
  }

  header h2 {
    margin-left: 8px;
  }

  nav {
    margin-right: 8px;
    padding: 0 8px 6px;
    gap: 14px;
  }

  nav a {
    --underline-gap: 0;
    font-size: .93rem;
  }

  nav a::before,
  nav a::after {
    bottom: -8px;
    height: 4px;
  }

  .box .list li {
    padding: 12px 12px;
  }

  .box .list li::after {
    right: 8px;
  }

  .feature-card img {
    width: 160px;
    right: 12px;
    bottom: 12px;
  }

  .scroll-container {
    height: 220px;
  }

  #scroll-list li {
    padding: 8px 10px;
    font-size: .92rem;
  }

  #scroll-list li span:first-child {
    width: 58%;
  }
}

/* ===== 480px 이하(소형폰): 핀 입력 스택, CTA/버튼 최소 터치 영역 보장 ===== */
@media (max-width: 480px) {
  .slide-inner {
    padding: 18px 14px;
  }

  .hero-content h1 {
    font-size: clamp(22px, 7vw, 28px);
  }

  .hero-content p {
    font-size: .9rem;
  }

  .hero-content .cta {
    padding: 9px 16px;
    font-size: 12px;
    border-radius: 999px;
  }

  .feature-card {
    flex: 1 1 100%;
  }

  .pin-inputs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .pin-inputs .code {
    height: 42px;
    font-size: 13.5px;
  }

  .pin-inputs .submit {
    height: 44px;
    width: 100%;
    padding: 0 16px;
    margin-left: 0;
  }

  .voucher_card button {
    padding: 10px 16px;
    border-radius: 14px;
  }

  .gc-btn {
    font-size: 15.5px;
    padding: 14px 0;
  }

  .banner-card {
    width: 100%;
    border-radius: 12px;
  }

  .banner img {
    width: 96%;
    border-radius: 12px;
    margin: 10px;
  }
}

/* ===== 접근성: 모션 최소화 선호 시 애니메이션 정지 ===== */
@media (prefers-reduced-motion: reduce) {

  .slideIn,
  .slideOut,
  .swiper-slide-active .hero-content h1,
  .swiper-slide-active .hero-content p,
  .swiper-slide-active .hero-content .cta,
  .swiper-slide-active .hero-visual .hero-img,
  .hero-content .cta::before,
  .pin-inputs .submit::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}