/* =====================================================
   Mongolia Travel - responsive.css
   Mobile-First Responsive Styles
   Breakpoints: 320 / 375 / 390 / 414 / 576 / 768 / 1024 / 1200 / 1440 / 1920
   ===================================================== */

/* =====================================================
   BASE (Mobile First: 320px+)
   ===================================================== */

/* Search Box — 모바일에서 1컬럼 */
.search-fields {
  grid-template-columns: 1fr;
  gap: 10px;
}

.search-box {
  padding: 20px 16px 18px;
  border-radius: var(--radius-lg);
  margin: 0 4px;
}

.search-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.search-tabs::-webkit-scrollbar { display: none; }

.search-tab {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* Hero 모바일 조정 */
.hero-section {
  min-height: 100svh;
  min-height: 100vh;
}

.hero-content {
  padding: 100px 0 60px;
}

.hero-title {
  font-size: clamp(1.8rem, 8vw, 2.8rem);
}

.hero-subtitle {
  font-size: 0.92rem;
}

.hero-stats {
  gap: 20px;
  flex-wrap: wrap;
}

.hero-stat-number {
  font-size: 1.4rem;
}

/* Gallery — 모바일 2컬럼 */
.gallery-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gallery-item.featured {
  grid-column: 1 / -1;
  grid-row: span 1;
  aspect-ratio: 16/9;
}

.gallery-item.tall {
  grid-row: span 1;
}

/* Section padding 축소 */
.section-pad {
  padding: 52px 0;
}

.section-pad-sm {
  padding: 32px 0;
}

/* CTA Banner 모바일 */
.cta-banner {
  padding: 36px 24px;
  border-radius: var(--radius-lg);
}

.cta-banner-title {
  font-size: 1.4rem;
}

/* Footer 모바일 */
.footer {
  padding: 48px 0 0;
}

.footer-desc {
  max-width: 100%;
}

.footer-bottom {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.footer-legal {
  gap: 14px;
  flex-wrap: wrap;
}

/* Mega dropdown 모바일 숨김 */
.mega-dropdown .dropdown-menu {
  min-width: 100vw;
  left: 0 !important;
  transform: none !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

.mega-menu-grid {
  grid-template-columns: 1fr 1fr;
}

/* Header 모바일 */
.header-actions .btn-icon {
  display: none;
}

.header-actions .btn-icon:last-child {
  display: inline-flex; /* dark toggle 유지 */
}

/* Navbar Toggle */
.navbar-toggler {
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  color: #fff;
}

#mainHeader.header-scrolled .navbar-toggler {
  background: var(--bg);
  color: var(--text-dark);
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-collapse {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 10px;
  box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .navbar-collapse {
  background: #1A1E2A;
}

.navbar-collapse .nav-link {
  color: var(--text-dark) !important;
  padding: 10px 12px !important;
}

.navbar-collapse .nav-link:hover {
  color: var(--primary) !important;
  background: var(--primary-light);
}

/* Review card — 모바일 */
.review-card::before {
  font-size: 5rem;
  top: -5px;
  right: 14px;
}

/* Countdown 작게 */
.countdown-item {
  min-width: 40px;
  padding: 5px 8px;
}

.countdown-num {
  font-size: 1rem;
}

/* Back to top — 모바일 위치 */
#backToTop {
  bottom: 20px;
  right: 16px;
  width: 40px;
  height: 40px;
}

/* Toast — 모바일 */
.toast-container {
  bottom: 16px;
  right: 16px;
  left: 16px;
}

.toast-custom {
  min-width: unset;
  width: 100%;
}

/* Search box wrapper */
.search-box-wrapper {
  margin-top: -32px;
  padding: 0 8px;
}

/* Feature strip — vertical on mobile */
.feature-strip .row {
  flex-direction: column;
}

.feature-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.feature-item:last-child {
  border-bottom: none;
}

/* Hotel amenities wrap */
.hotel-amenities .amenity-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
}

/* Itinerary tabs */
.itinerary-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.itinerary-tabs::-webkit-scrollbar { display: none; }

.itinerary-tab {
  flex-shrink: 0;
}

/* Section title sizes */
.section-title {
  font-size: 1.5rem;
}

/* =====================================================
   375px+
   ===================================================== */
@media (min-width: 375px) {
  .hero-title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .search-box {
    margin: 0 8px;
  }
}

/* =====================================================
   414px+
   ===================================================== */
@media (min-width: 414px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .search-tab {
    font-size: 0.82rem;
  }
}

/* =====================================================
   576px (Bootstrap sm)
   ===================================================== */
@media (min-width: 576px) {
  .search-fields {
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    margin: 0;
    border-radius: var(--radius-xl);
  }

  .search-box-wrapper {
    margin-top: -40px;
    padding: 0;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .gallery-item.featured {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: unset;
  }

  .gallery-item.tall {
    grid-row: span 2;
  }

  .section-pad {
    padding: 64px 0;
  }

  .mega-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cta-banner {
    padding: 48px 36px;
  }
}

/* =====================================================
   768px (Bootstrap md / Tablet)
   ===================================================== */
@media (min-width: 768px) {

  /* Header */
  .header-actions .btn-icon {
    display: inline-flex;
  }

  .navbar-collapse {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-top: 0;
    box-shadow: none;
  }

  .navbar-collapse .nav-link {
    color: var(--text-body) !important;
  }

  #mainHeader.header-transparent .navbar-collapse .nav-link {
    color: rgba(0, 0, 0, 0.9) !important;
  }

  /* Hero */
  .hero-content {
    padding: 120px 0 80px;
  }

  .hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-stats {
    gap: 32px;
  }

  .hero-stat-number {
    font-size: 1.8rem;
  }

  /* Search */
  .search-fields {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
  }

  .search-box-wrapper {
    margin-top: -48px;
  }

  .search-box {
    padding: 24px 28px 20px;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  /* Section padding */
  .section-pad {
    padding: 72px 0;
  }

  .section-pad-sm {
    padding: 40px 0;
  }

  /* Feature strip — horizontal */
  .feature-strip .row {
    flex-direction: row;
  }

  .feature-item {
    border-bottom: none;
    border-right: 1px solid var(--border-light);
    padding: 8px 16px;
  }

  .feature-item:last-child {
    border-right: none;
  }

  /* CTA Banner */
  .cta-banner {
    padding: 56px 48px;
  }

  .cta-banner-title {
    font-size: 1.8rem;
  }

  /* Footer */
  .footer {
    padding: 64px 0 0;
  }

  .footer-bottom {
    flex-direction: row;
    align-items: center;
  }

  /* Countdown */
  .countdown-num {
    font-size: 1.25rem;
  }

  .countdown-item {
    min-width: 48px;
  }

  /* Review card */
  .review-card::before {
    font-size: 7rem;
  }

  /* Toast */
  .toast-container {
    bottom: 24px;
    right: 24px;
    left: auto;
  }

  .toast-custom {
    width: auto;
    min-width: 280px;
  }

  /* Section title */
  .section-title {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  }
}

/* =====================================================
   1024px (Bootstrap lg / Small Desktop)
   ===================================================== */
@media (min-width: 1024px) {

  /* Search — full 5-column layout */
  .search-fields {
    grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
  }

  /* Hero */
  .hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
  }

  /* Section pad */
  .section-pad {
    padding: 80px 0;
  }

  /* Mega menu full */
  .mega-dropdown .dropdown-menu {
    min-width: 560px;
    left: auto !important;
  }

  /* Gallery full 4-col */
  .gallery-grid {
    gap: 14px;
  }

  /* Footer */
  .footer {
    padding: 72px 0 0;
  }

  /* Feature strip */
  .feature-item {
    padding: 8px 24px;
  }

  /* CTA Banner */
  .cta-banner {
    padding: 60px 64px;
  }

  .cta-banner-title {
    font-size: 2.2rem;
  }
}

/* =====================================================
   1200px (Bootstrap xl)
   ===================================================== */
@media (min-width: 1200px) {

  .hero-title {
    font-size: 4.5rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
    max-width: 520px;
  }

  .section-pad {
    padding: 96px 0;
  }

  .search-box {
    padding: 28px 36px 24px;
  }

  .search-box-wrapper {
    margin-top: -56px;
  }

  /* Gallery - 5 columns for large screens */
  .gallery-grid-xl {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* =====================================================
   1440px (Large Desktop)
   ===================================================== */
@media (min-width: 1440px) {

  .hero-title {
    font-size: 5rem;
  }

  .section-pad {
    padding: 112px 0;
  }

  .search-box {
    padding: 32px 40px 28px;
  }

  .tour-card-body {
    padding: 22px;
  }

  .hotel-card-body {
    padding: 22px;
  }
}

/* =====================================================
   1920px (4K / Ultra-wide)
   ===================================================== */
@media (min-width: 1920px) {

  .hero-title {
    font-size: 5.5rem;
  }

  .section-pad {
    padding: 128px 0;
  }

  .container, .container-lg, .container-xl, .container-xxl {
    max-width: 1560px;
  }
}

/* =====================================================
   TOUCH DEVICE OPTIMIZATIONS
   ===================================================== */
@media (hover: none) and (pointer: coarse) {
  /* 터치 디바이스에서 hover 효과 제거 */
  .tour-card:hover {
    transform: none;
  }

  .tour-card:hover .tour-card-image img {
    transform: none;
  }

  .hotel-card:hover {
    transform: none;
  }

  .btn-card-reserve:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: none;
  }

  /* 터치 피드백 */
  .tour-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }

  .btn:active {
    transform: scale(0.97) !important;
  }

  /* 카드 quick view 항상 보이게 */
  .card-quick-view {
    opacity: 0; /* 터치에서 숨김 */
  }

  /* 갤러리 오버레이 */
  .gallery-overlay {
    opacity: 0;
  }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-slide-img {
    transform: none !important;
    transition: none !important;
  }

  .map-pin-dot::after {
    animation: none;
  }

  .scroll-dot::after {
    animation: none;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =====================================================
   LANDSCAPE MOBILE
   ===================================================== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vw;
  }

  .hero-content {
    padding: 80px 0 40px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    gap: 16px;
  }
}

/* =====================================================
   HIGH DPI DISPLAYS
   ===================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-icon {
    /* Crisp rendering on Retina */
    image-rendering: -webkit-optimize-contrast;
  }
}
/* =====================================================
   MOBILE HEADER FIX
   - 기존 구조/스타일 유지
   - 모바일에서 햄버거 영역이 흰 박스처럼 늘어나는 문제 방지
   ===================================================== */
@media (max-width: 991.98px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #mainHeader {
    width: 100%;
    max-width: 100vw;
    left: 0;
    right: 0;
  }

  #mainHeader .navbar {
    width: 100%;
    max-width: 100%;
  }

  #mainHeader .navbar > .container,
  #mainHeader .navbar > .container-fluid {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
  }

  .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 52px);
    overflow: hidden;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .logo-text {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .navbar-toggler {
    flex: 0 0 auto;
    margin-left: auto;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.1);
    color: #fff;
    position: relative;
    z-index: 2;
  }

  #mainHeader.header-scrolled .navbar-toggler {
    background: var(--bg);
    color: var(--text-dark);
  }

  .navbar-toggler:focus {
    box-shadow: none;
  }

  .navbar-collapse {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 10px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
  }

  .navbar-collapse:not(.show) {
    display: none !important;
  }

  [data-theme="dark"] .navbar-collapse {
    background: #1A1E2A;
  }

  .navbar-nav {
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center;
    gap: 0 !important;
  }

  .navbar-collapse .nav-link {
    width: 100%;
    color: var(--text-dark) !important;
    padding: 10px 12px !important;
    border-radius: var(--radius-sm);
  }

  .navbar-collapse .nav-link:hover {
    color: var(--primary) !important;
    background: var(--primary-light);
  }

  .header-actions {
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-actions .btn-icon {
    display: none;
  }

  .header-actions #darkToggle {
    display: inline-flex;
  }

  .header-actions .btn {
    flex: 0 1 auto;
    white-space: nowrap;
  }

  .mega-dropdown .dropdown-menu {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    border-radius: var(--radius-md) !important;
    margin-top: 6px;
    padding: 12px;
  }

  .mega-menu-grid {
    grid-template-columns: 1fr;
  }

  .hero-section,
  .hero-content,
  .hero-swiper {
    width: 100%;
    max-width: 100%;
  }

  .cs-card{
    background:#fff;
    border-radius:20px;
    padding:24px;
    box-shadow:0 8px 30px rgba(0,0,0,.08);
  }
}

/* Bootstrap lg 이상에서는 기존 데스크톱 헤더 복구 */
@media (min-width: 992px) {
  .navbar-collapse {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-top: 0;
    box-shadow: none;
    overflow: visible;
  }

  .header-actions {
    width: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    flex-wrap: nowrap;
  }

  .header-actions .btn-icon {
    display: inline-flex;
  }
}
