﻿/* =============================================
   MapNexus — Mobile Responsive Styles
   เฉพาะมือถือ ไม่แตะ desktop เด็ดขาด
   ============================================= */

/* ---- Nav Logo Image — ซ่อนบนมือถือ ---- */
@media (max-width: 768px) {
  .nav-logo-img { display: none; }
}

/* =============================================
   GLOBAL — ทุกหน้า
   ============================================= */

/* ---- Navbar Mobile — ซ่อนทั้งหมด ใช้ Bottom Nav แทน ---- */
@media (max-width: 768px) {

  .navbar {
    display: none !important;
  }

  /* Hero และ page-header ไม่ต้องเว้นที่ navbar แล้ว */
  .hero { margin-top: 0 !important; }
  .page-header { margin-top: 0 !important; }
}

/* ---- Info Bar — ซ่อนบน mobile ย้ายไป bottom ---- */
@media (max-width: 768px) {
  .info-bar-header {
    display: none !important;
  }
}

/* ---- Bottom Navigation Bar ---- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(20, 20, 20, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(212,175,55,0.15);
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  }

  .mobile-bottom-nav-items {
    display: flex;
    width: 100%;
    justify-content: space-around;
    align-items: center;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    color: rgba(255,255,255,0.45);
    transition: color 0.2s;
    min-width: 56px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item.active {
    color: #d4af37;
  }

  .mobile-nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s;
  }

  .mobile-nav-item.active svg {
    transform: scale(1.1);
  }

  .mobile-nav-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: 'Noto Sans Thai', sans-serif;
  }

  /* Weather mini info ใน bottom nav */
  .mobile-nav-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
  }

  .mobile-nav-weather-val {
    font-size: 0.7rem;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
  }

  .mobile-nav-weather-label {
    font-size: 0.52rem;
    color: rgba(255,255,255,0.4);
    line-height: 1;
  }

  /* Active indicator dot */
  .mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, #b8941e, #d4af37);
    border-radius: 0 0 2px 2px;
  }

  .mobile-nav-item { position: relative; }

  /* เพิ่ม padding ล่างให้ content ไม่ถูกทับ */
  body {
    padding-bottom: calc(65px + env(safe-area-inset-bottom)) !important;
  }
}

/* ---- Hero margin — ไม่มี navbar แล้ว ---- */

/* ---- Footer Mobile ---- */
@media (max-width: 768px) {

  /* ===== Newsletter ===== */
  .newsletter-compact { padding: 1rem 0 !important; }
  .newsletter-compact .newsletter-content {
    flex-direction: column !important;
    gap: 0.6rem !important;
    text-align: center;
    align-items: center;
  }
  .newsletter-compact .newsletter-title { font-size: 1rem !important; }
  .newsletter-compact .newsletter-description { font-size: 0.78rem; color: rgba(255,255,255,0.6); }
  .newsletter-compact .newsletter-form {
    max-width: 100% !important;
    flex-direction: row;
    gap: 0.4rem;
    width: 100%;
  }
  .newsletter-compact .newsletter-input {
    font-size: 0.82rem;
    padding: 0.55rem 0.875rem;
    flex: 1;
  }
  .newsletter-compact .btn-primary {
    padding: 0.55rem 0.875rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ===== Footer Main ===== */
  .footer { padding: 1.25rem 0 0.75rem !important; }

  .footer-content {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin-bottom: 0.875rem !important;
    padding-bottom: 0.875rem;
    text-align: center;
  }

  /* Brand — กึ่งกลาง */
  .footer-brand {
    max-width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .footer-logo { font-size: 0.95rem !important; }
  .footer-tagline { font-size: 0.7rem !important; margin-bottom: 0.35rem !important; }
  .footer-description {
    font-size: 0.75rem !important;
    line-height: 1.55 !important;
    text-align: center;
    max-width: 260px;
  }

  /* Links — 3 col กึ่งกลาง */
  .footer-links {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.25rem !important;
    text-align: center;
  }
  .footer-column { display: flex; flex-direction: column; align-items: center; }
  .footer-title {
    font-size: 0.65rem !important;
    margin-bottom: 0.4rem !important;
    text-align: center;
  }
  .footer-list { text-align: center; }
  .footer-list li { margin-bottom: 0.2rem !important; }
  .footer-list a { font-size: 0.7rem !important; }

  /* ===== Team Section ===== */
  .footer-team {
    padding: 0.875rem 0 !important;
    margin-bottom: 0.75rem !important;
    text-align: center;
  }

  .footer-team-header {
    margin-bottom: 0.75rem !important;
    justify-content: center;
  }
  .footer-team-title { font-size: 0.68rem !important; }

  /* นักพัฒนา 2×2 — กึ่งกลาง */
  .footer-team-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
    margin-bottom: 0.75rem !important;
    max-width: 280px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .footer-team-member {
    align-items: center;
    text-align: center;
  }

  .footer-team-avatar {
    width: 34px !important;
    height: 34px !important;
  }
  .footer-team-avatar svg { width: 16px !important; height: 16px !important; }

  .footer-team-name {
    font-size: 0.62rem !important;
    line-height: 1.3;
    word-break: keep-all;
  }
  .footer-team-role { font-size: 0.55rem !important; }

  /* อาจารย์ที่ปรึกษา — กึ่งกลาง แนวตั้ง */
  .footer-advisor-wrap {
    flex-direction: column !important;
    gap: 0.4rem !important;
    align-items: center !important;
    text-align: center;
  }

  .footer-advisor-label {
    font-size: 0.6rem !important;
    text-align: center;
  }

  .footer-advisor-list {
    flex-direction: column !important;
    gap: 0.35rem !important;
    align-items: center !important;
  }

  .footer-advisor-sep { display: none !important; }

  .footer-advisor-item { justify-content: center; }

  .footer-advisor-avatar {
    width: 20px !important;
    height: 20px !important;
  }
  .footer-advisor-avatar svg { width: 12px !important; height: 12px !important; }

  .footer-advisor-name {
    font-size: 0.68rem !important;
    text-align: center;
  }

  /* ปุ่มเกี่ยวกับเรา — เต็มความกว้าง */
  .footer-about-btn-wrap {
    margin-top: 0.875rem !important;
    width: 100%;
  }

  .footer-about-btn {
    font-size: 0.78rem !important;
    padding: 0.6rem 1.5rem !important;
    width: 100%;
    justify-content: center;
    border-radius: 12px !important;
    background: rgba(212,175,55,0.08) !important;
    border-color: rgba(212,175,55,0.3) !important;
  }

  /* ===== Footer Bottom ===== */
  .footer-bottom {
    flex-direction: column !important;
    gap: 0.35rem !important;
    text-align: center;
    padding: 0.65rem 0 0.875rem !important;
    font-size: 0.68rem !important;
    align-items: center;
  }

  .footer-legal {
    gap: 0.75rem !important;
    justify-content: center;
  }
  .footer-legal a { font-size: 0.68rem !important; }
}


/* =============================================
   INDEX.HTML
   ============================================= */

/* ---- Hero ---- */
@media (max-width: 768px) {
  .hero {
    min-height: 75vh !important;
    height: 75vh !important;
  }

  .hero-content { padding: 1rem; }

  .hero-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem) !important;
    margin-bottom: 0.75rem;
  }

  .hero-description {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    padding: 0 0.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-outline {
    width: 100%;
    max-width: 260px;
    text-align: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 70vh !important;
    height: 70vh !important;
  }
  .hero-description { display: none; }
  .hero-title { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
}

/* ---- Featured Section — SwiperJS Coverflow Mobile ---- */
@media (max-width: 768px) {
  .featured-section {
    padding: 1.25rem 0 0 !important;
    overflow: hidden !important;
  }

  .featured-section .section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.25rem !important;
    margin-bottom: 0.875rem !important;
    padding: 0 0.875rem !important;
  }

  .featured-section .section-title { font-size: 1.3rem !important; }

  /* Slide ขนาดพอดีมือถือ */
  .featured-slide {
    width: 78vw !important;
    height: 220px !important;
    border-radius: 16px !important;
  }

  /* ข้อความ */
  .fs-title { font-size: 1.05rem !important; }
  .fs-desc  { font-size: 0.72rem !important; -webkit-line-clamp: 2 !important; margin-bottom: 0.6rem !important; }
  .fs-btn   { font-size: 0.68rem !important; padding: 0.35rem 0.875rem !important; }
  .fs-info  { padding: 1rem 1.1rem 1.1rem !important; }

  /* ซ่อนปุ่ม ← → บนมือถือ */
  .featured-prev,
  .featured-next { display: none !important; }
}

/* ---- Experience Section ---- */
@media (max-width: 768px) {
  .experience-section { padding: 1.5rem 0; }
  .experience-description { font-size: 0.88rem; margin-bottom: 1.25rem; }
  .experience-stats { gap: 0.5rem; }
  .stat-number { font-size: 1.75rem !important; }
  .stat-label  { font-size: 0.75rem; }
  .stat-item   { padding: 0.875rem 0.5rem; }
  .experience-images { display: none; }
}

/* ---- Places Sections ---- */
@media (max-width: 768px) {
  .places-section { padding: 1.25rem 0; }
  .places-title { font-size: 1.2rem !important; }
  .places-description { font-size: 0.8rem; }
  .places-header { margin-bottom: 0.875rem; }

  /* ===== Carousel (คาเฟ่) — เห็น 1.5 การ์ด =====  */
  .places-carousel {
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0 0.75rem !important;
    gap: 0.75rem !important;
  }

  .places-carousel .place-card {
    flex: 0 0 58vw !important;
    min-width: 58vw !important;
    scroll-snap-align: start;
    border-radius: 14px;
  }

  .places-carousel .place-image {
    height: 130px !important;
  }

  .places-carousel .place-content {
    padding: 0.65rem 0.75rem 0.75rem !important;
  }

  .places-carousel .place-category {
    font-size: 0.65rem;
    padding: 0.18rem 0.55rem;
    margin-bottom: 0.3rem;
  }

  .places-carousel .place-title {
    font-size: 0.88rem !important;
    margin-bottom: 0.2rem;
    line-height: 1.3;
  }

  .places-carousel .place-description {
    font-size: 0.75rem !important;
    line-height: 1.45;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .places-carousel .place-footer {
    padding-top: 0.4rem;
    margin-bottom: 0.35rem;
  }

  .places-carousel .place-location,
  .places-carousel .place-reviews {
    font-size: 0.7rem;
  }

  .places-carousel .place-link {
    font-size: 0.75rem;
  }

  /* ===== Grid วัด (4 แห่ง) — 2 col compact ===== */
  .places-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    margin-top: 0.75rem !important;
  }

  .places-grid-4 .place-card {
    border-radius: 12px;
  }

  .places-grid-4 .place-image {
    height: 110px !important;
  }

  .places-grid-4 .place-content {
    padding: 0.6rem 0.65rem 0.65rem !important;
  }

  .places-grid-4 .place-category {
    font-size: 0.6rem;
    padding: 0.15rem 0.45rem;
    margin-bottom: 0.25rem;
  }

  .places-grid-4 .place-title {
    font-size: 0.82rem !important;
    margin-bottom: 0.15rem;
    line-height: 1.3;
  }

  .places-grid-4 .place-description {
    font-size: 0.72rem !important;
    line-height: 1.4;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .places-grid-4 .place-footer {
    padding-top: 0.35rem;
    margin-bottom: 0.3rem;
  }

  .places-grid-4 .place-location,
  .places-grid-4 .place-reviews {
    font-size: 0.65rem;
  }

  .places-grid-4 .place-link {
    font-size: 0.72rem;
  }

  .places-grid-4 .place-rating {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    top: 8px; right: 8px;
  }

  /* ===== Grid โรงแรม (3 แห่ง) — horizontal card ===== */
  .places-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    margin-top: 0.75rem !important;
  }

  .places-grid-3 .place-card {
    display: flex !important;
    flex-direction: row !important;
    border-radius: 14px;
    overflow: hidden;
    height: 110px;
  }

  .places-grid-3 .place-image {
    width: 120px !important;
    min-width: 120px !important;
    height: 110px !important;
    flex-shrink: 0;
  }

  .places-grid-3 .place-content {
    flex: 1;
    padding: 0.6rem 0.75rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }

  .places-grid-3 .place-category {
    font-size: 0.6rem;
    padding: 0.12rem 0.45rem;
    margin-bottom: 0.2rem;
  }

  .places-grid-3 .place-title {
    font-size: 0.85rem !important;
    margin-bottom: 0.15rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .places-grid-3 .place-description {
    font-size: 0.72rem !important;
    line-height: 1.4;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .places-grid-3 .place-footer {
    padding-top: 0.3rem;
    margin-bottom: 0.25rem;
  }

  .places-grid-3 .place-location,
  .places-grid-3 .place-reviews {
    font-size: 0.65rem;
  }

  .places-grid-3 .place-price {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
  }

  .places-grid-3 .place-link {
    font-size: 0.72rem;
  }

  .places-grid-3 .place-rating {
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
    top: 8px; right: 8px;
  }
}

@media (max-width: 480px) {
  .places-carousel .place-card {
    flex: 0 0 65vw !important;
    min-width: 65vw !important;
  }

  .places-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .places-grid-3 .place-image {
    width: 100px !important;
    min-width: 100px !important;
  }
}

/* ---- Culture Section ---- */
@media (max-width: 768px) {
  .culture-section { padding: 1.5rem 0; }
  .culture-grid { gap: 0.75rem; }
  .culture-card { padding: 1.25rem 0.875rem; }
  .culture-title { font-size: 1rem; }
  .culture-description { font-size: 0.82rem; }
  .culture-icon svg { width: 36px; height: 36px; }
}

/* ---- Newsletter ---- */
@media (max-width: 768px) {
  .newsletter-section { padding: 1.5rem 0; }
  .newsletter-title { font-size: 1.3rem !important; }
  .newsletter-description { font-size: 0.85rem; margin-bottom: 1rem; }
  .newsletter-input { font-size: 0.9rem; padding: 0.75rem 1rem; }
}

/* ---- Section headers ---- */
@media (max-width: 768px) {
  .section-title { font-size: clamp(1.25rem, 4.5vw, 1.75rem) !important; }
  .section-subtitle { font-size: 0.72rem; }
  .places-header { margin-bottom: 1rem; }
}


/* =============================================
   WEATHER.HTML
   ============================================= */

@media (max-width: 768px) {

  .weather-section { padding: 1.25rem 0; }

  .weather-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .pm25-section .section-header { align-items: center !important; }

  .pm25-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem;
  }

  .pm25-card { padding: 0.75rem; }
  .pm25-value { font-size: 1.6rem !important; }
  .district-name { font-size: 0.82rem; }

  .current-weather-grid { grid-template-columns: 1fr !important; gap: 0.75rem; }
  .weather-main-card { padding: 1.25rem; }
  .temp-value { font-size: 2.5rem !important; }
  .weather-icon-large { width: 70px; height: 70px; }

  .weather-details-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem;
  }

  .weather-detail-card { padding: 0.6rem 0.5rem; }
  .detail-value { font-size: 0.88rem !important; }
  .detail-label { font-size: 0.68rem; }

  .forecast-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.65rem !important;
    padding: 0.25rem 0 0.75rem !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
  }

  .forecast-grid::-webkit-scrollbar { display: none; }

  .forecast-card {
    flex: 0 0 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    scroll-snap-align: start;
    padding: 0.75rem 0.6rem !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07) !important;
  }

  .forecast-icon { width: 44px; height: 44px; }
  .forecast-day { font-size: 0.75rem; }
  .forecast-weather { font-size: 0.72rem; }
  .temp-max { font-size: 1rem; }
  .temp-min { font-size: 0.88rem; }
  .forecast-details { font-size: 0.68rem; }

  .rain-alert {
    position: relative !important;
    top: auto !important; right: auto !important;
    max-width: 100% !important;
    margin-bottom: 0.75rem;
  }

  .traffic-grid { grid-template-columns: 1fr !important; }

  .circular-progress.large { width: 90px !important; height: 90px !important; }

  .traffic-forecast-content { grid-template-columns: repeat(2, 1fr) !important; }

  .water-level-display {
    grid-template-columns: 1fr !important;
    text-align: center; gap: 0.75rem; padding: 0.875rem;
  }

  .water-gauge { width: 110px !important; height: 110px !important; margin: 0 auto; }
  .gauge-value { font-size: 1.4rem !important; }
  .level-status-badge { margin: 0 auto; }
  .river-details { grid-template-columns: 1fr !important; }
  .warning-levels-grid { grid-template-columns: 1fr !important; }
  .data-sources-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .pm25-grid { grid-template-columns: 1fr !important; }
  .weather-details-grid { grid-template-columns: repeat(2, 1fr) !important; }
}


/* =============================================
   EXPLORE.HTML — Carousel smooth scroll
   ============================================= */

@media (max-width: 768px) {

  .filter-section { padding: 0.75rem 0; }

  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
  }

  .filter-tabs {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    gap: 0.4rem;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
  }

  .filter-tabs::-webkit-scrollbar { display: none; }

  .filter-tab {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .filter-controls { display: flex; gap: 0.5rem; }

  .filter-select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .explore-category-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
  }

  .explore-category-title { font-size: 1.1rem !important; }

  /* Smooth touch carousel */
  .explore-carousel {
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    gap: 0.65rem !important;
    padding: 0.25rem 0 0.75rem !important;
  }

  /* Landscape cards — 58vw เห็น 1.5 การ์ด */
  .explore-place-card,
  .ec-card-landscape {
    flex: 0 0 58vw !important;
    min-width: 58vw !important;
    scroll-snap-align: start;
    border-radius: 14px;
  }

  .explore-place-image,
  .ec-img-landscape {
    height: 120px !important;
  }

  /* Portrait cards — 48vw เห็น 2 การ์ด */
  .ec-card-portrait {
    flex: 0 0 48vw !important;
    min-width: 48vw !important;
    scroll-snap-align: start;
    border-radius: 14px;
  }

  .ec-img-portrait { height: 120px !important; }

  /* EPC cards */
  .epc-card {
    flex: 0 0 58vw !important;
    min-width: 58vw !important;
    scroll-snap-align: start;
    border-radius: 14px;
  }

  .epc-image { height: 120px !important; }

  /* Card body text */
  .ec-title, .epc-title, .explore-place-title {
    font-size: 0.85rem !important;
    line-height: 1.3;
  }

  .ec-desc, .epc-desc, .explore-place-desc {
    font-size: 0.72rem !important;
    -webkit-line-clamp: 2;
    line-height: 1.4;
  }

  .ec-category, .epc-category, .explore-place-category {
    font-size: 0.62rem;
  }

  .ec-location, .epc-location, .explore-place-location {
    font-size: 0.68rem;
  }

  .ec-link, .epc-link, .explore-place-link {
    font-size: 0.72rem;
  }

  .ec-body, .epc-body, .explore-place-content {
    padding: 0.65rem 0.75rem 0.75rem !important;
  }

  .map-container { height: 240px !important; }
}

@media (max-width: 480px) {
  .explore-place-card,
  .ec-card-landscape {
    flex: 0 0 65vw !important;
    min-width: 65vw !important;
  }

  .ec-card-portrait {
    flex: 0 0 52vw !important;
    min-width: 52vw !important;
  }
}


/* =============================================
   CHECKIN.HTML
   ============================================= */

@media (max-width: 1024px) {
  .checkin-layout { grid-template-columns: 1fr !important; }
  .checkin-feed-col { position: static !important; }
  .checkin-feed {
    max-height: none !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .checkin-main-section { padding: 1.25rem 0 1.5rem; }
  .checkin-card { padding: 1rem; border-radius: 12px; }
  .checkin-card-title { font-size: 1.1rem; }

  .ci-input, .ci-textarea {
    font-size: 16px !important;
    padding: 0.65rem 0.75rem;
  }

  .ci-star svg { width: 30px !important; height: 30px !important; }

  .ci-privacy-row { flex-wrap: wrap !important; gap: 0.4rem !important; }

  .ci-actions { flex-direction: column-reverse; gap: 0.5rem; }

  .ci-actions .btn-primary,
  .ci-actions .btn-outline {
    width: 100%;
    text-align: center;
    padding: 0.75rem;
  }

  .checkin-feed { grid-template-columns: 1fr !important; }
  .ci-feed-img { height: 160px !important; }
  .ci-upload-area { padding: 0.875rem; }
}

@media (max-width: 480px) {
  .checkin-card { padding: 0.875rem; }
  .ci-tag-suggest { font-size: 0.72rem; padding: 0.18rem 0.55rem; }
}


/* =============================================
   LOGIN.HTML
   ============================================= */

@media (max-width: 600px) {
  html, body { overflow: auto !important; height: auto !important; }
  .wrapper { min-height: auto !important; margin: 0.75rem auto; }
}

@media (max-width: 480px) {
  .wrapper {
    border-radius: 14px !important;
    margin: 0.5rem;
    width: calc(100% - 1rem) !important;
    max-width: none !important;
  }
  .card { padding: 1rem !important; }
}

@media (max-width: 375px) {
  .wrapper { margin: 0; border-radius: 0 !important; }
  .card { padding: 0.875rem !important; }
}


/* =============================================
   PAGE HEADER
   ============================================= */

@media (max-width: 768px) {
  .page-header {
    height: 28vh !important;
    min-height: 180px !important;
  }
  .page-title { font-size: clamp(1.5rem, 5.5vw, 2.2rem) !important; }
  .page-subtitle { font-size: 0.75rem; }
  .page-description { font-size: 0.82rem; }
}

@media (max-width: 480px) {
  .page-header {
    height: 24vh !important;
    min-height: 160px !important;
  }
}


/* =============================================
   CONTAINER PADDING
   ============================================= */

@media (max-width: 768px) {
  .container, .container-wide, .container-narrow {
    padding: 0 0.875rem !important;
  }
}


/* =============================================
   USER PROFILE POPUP — bottom sheet
   ============================================= */

@media (max-width: 768px) {
  .profile-popup {
    position: fixed !important;
    top: auto !important;
    bottom: calc(65px + env(safe-area-inset-bottom)) !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    border-radius: 16px !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.25) !important;
  }
}


/* =============================================
   EVENT NOTIFICATION POPUP — กลางจอเสมอ
   ============================================= */

.enp-overlay {
  align-items: center !important;
  justify-content: center !important;
  padding: 1.25rem !important;
}

.enp-modal {
  border-radius: 24px !important;
  max-height: 72vh !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  position: relative !important;
  overflow: hidden !important;
}

@media (max-width: 480px) {
  .enp-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
  }

  .enp-modal {
    border-radius: 22px !important;
    max-height: 70vh !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .enp-card { padding: 0.875rem; }
  .enp-card-title { font-size: 1rem; }
}


/* =============================================
   MOBILE AUTH BUTTON — ลบออกแล้ว ไม่ใช้
   ============================================= */

.mobile-auth-btn { display: none !important; }


/* =============================================
   MOBILE PROFILE POPUP
   ============================================= */

@media (max-width: 768px) {
  .mobile-profile-popup {
    position: fixed;
    top: 56px;
    right: 0.75rem;
    width: 260px;
    background: #1a1a1a;
    border-radius: 16px;
    border: 1px solid rgba(212,175,55,0.2);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    z-index: 9999;
    overflow: hidden;
    animation: mppSlideIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
  }

  @keyframes mppSlideIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  .mpp-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
    border-bottom: 1px solid rgba(212,175,55,0.1);
  }

  .mpp-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(212,175,55,0.5);
    flex-shrink: 0;
  }

  .mpp-avatar-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b8941e, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    flex-shrink: 0;
  }

  .mpp-info { flex: 1; min-width: 0; }

  .mpp-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mpp-email {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.1rem;
  }

  .mpp-badge {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.1rem 0.5rem;
    background: rgba(212,175,55,0.15);
    color: #d4af37;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1px solid rgba(212,175,55,0.3);
    letter-spacing: 0.04em;
  }

  .mpp-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
  }

  .mpp-body {
    padding: 0.5rem 0;
  }

  .mpp-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: background 0.15s;
  }

  .mpp-row svg { color: rgba(212,175,55,0.7); flex-shrink: 0; }

  .mpp-link:hover, .mpp-link:active {
    background: rgba(212,175,55,0.08);
    color: #d4af37;
  }

  .mpp-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem;
    background: rgba(220,38,38,0.08);
    border: none;
    border-top: 1px solid rgba(220,38,38,0.15);
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .mpp-logout:active { background: rgba(220,38,38,0.15); }
}


/* =============================================
   HERO STATUS WIDGET — ย้ายไปเป็น fixed แล้ว
   ============================================= */

.hero-status-widget { display: none !important; }


/* =============================================
   BOTTOM NAV — AUTH BUTTON
   ============================================= */

@media (max-width: 768px) {

  .mobile-nav-auth {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-auth:active { opacity: 0.7; }

  /* Icon wrapper */
  .bnav-auth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
  }

  /* Avatar วงกลมทอง */
  .bnav-avatar {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(184,148,30,0.25), rgba(212,175,55,0.35));
    border: 1.5px solid rgba(212,175,55,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d4af37;
  }

  /* Online dot */
  .bnav-online-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 7px;
    height: 7px;
    background: #4caf50;
    border-radius: 50%;
    border: 1.5px solid rgba(20,20,20,0.95);
  }
}


/* =============================================
   BOTTOM NAV — LOGO CENTER BUTTON
   ============================================= */

@media (max-width: 768px) {

  /* Logo วงกลมกลาง */
  .mobile-nav-logo-btn {
    position: relative;
    padding: 0 0.5rem;
    margin-top: -18px; /* ล้นขึ้นเหนือ bottom nav */
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-logo-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid rgba(212,175,55,0.7);
    box-shadow:
      0 0 0 3px rgba(20,20,20,0.95),
      0 4px 16px rgba(0,0,0,0.4),
      0 0 12px rgba(212,175,55,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .mobile-nav-logo-btn:active .mobile-nav-logo-circle {
    transform: scale(0.93);
  }

  /* Active state — glow ทอง */
  .mobile-nav-logo-btn.active .mobile-nav-logo-circle {
    border-color: #d4af37;
    box-shadow:
      0 0 0 3px rgba(20,20,20,0.95),
      0 4px 20px rgba(212,175,55,0.5),
      0 0 20px rgba(212,175,55,0.4);
  }

  .mobile-nav-logo-circle img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
  }

  .mobile-nav-logo-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b8941e, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif Thai', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
  }

  /* ไม่มี label ใต้ Logo */
  .mobile-nav-logo-btn .mobile-nav-label {
    display: none;
  }

  /* ปรับ bottom nav ให้รองรับ Logo ที่ล้นขึ้น */
  .mobile-bottom-nav {
    padding-top: 0.25rem;
    overflow: visible !important;
  }

  .mobile-bottom-nav-items {
    overflow: visible !important;
    align-items: flex-end;
    padding-bottom: 0.1rem;
  }
}


/* =============================================
   BOTTOM NAV — PROFILE POPUP
   ============================================= */

@media (max-width: 768px) {

  #bnav-profile-popup {
    display: none; /* ซ่อนบน desktop เสมอ */
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom));
    right: 0.75rem;
    width: 280px;
    background: #1a1a1a;
    border-radius: 18px;
    border: 1px solid rgba(212,175,55,0.2);
    box-shadow: 0 -4px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.08);
    z-index: 9998;
    overflow: hidden;
    /* ซ่อนโดย default */
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
  }

  #bnav-profile-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  /* Header */
  .bnav-pp-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.03));
    position: relative;
  }

  .bnav-pp-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b8941e, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    flex-shrink: 0;
    border: 2px solid rgba(212,175,55,0.4);
  }

  .bnav-pp-info {
    flex: 1;
    min-width: 0;
  }

  .bnav-pp-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bnav-pp-email {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.1rem;
  }

  .bnav-pp-rank {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.1rem 0.5rem;
    background: rgba(205,127,50,0.2);
    color: #cd7f32;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    border: 1px solid rgba(205,127,50,0.35);
    letter-spacing: 0.03em;
  }

  .bnav-pp-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
  }

  .bnav-pp-close:active { background: rgba(255,255,255,0.15); }

  /* Divider */
  .bnav-pp-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
  }

  /* Body rows */
  .bnav-pp-body {
    padding: 0.4rem 0;
  }

  .bnav-pp-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: background 0.15s;
  }

  .bnav-pp-row svg { color: rgba(212,175,55,0.65); flex-shrink: 0; }

  .bnav-pp-row-label {
    color: rgba(255,255,255,0.4);
    font-size: 0.72rem;
    flex-shrink: 0;
  }

  .bnav-pp-row-val {
    margin-left: auto;
    color: rgba(255,255,255,0.75);
    font-size: 0.72rem;
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
  }

  .bnav-pp-reset {
    color: #d4af37 !important;
  }

  .bnav-pp-link:active { background: rgba(212,175,55,0.06); }

  /* Logout */
  .bnav-pp-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem;
    background: rgba(220,38,38,0.07);
    border: none;
    border-top: 1px solid rgba(220,38,38,0.12);
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
  }

  .bnav-pp-logout:active { background: rgba(220,38,38,0.15); }
}


/* =============================================
   GLOBAL HIDE — ซ่อน mobile-only elements บน desktop
   ============================================= */

/* ซ่อน bottom nav profile popup บน desktop */
#bnav-profile-popup {
  display: none !important;
}

/* ซ่อน fixed status widget บน desktop เท่านั้น */
@media (min-width: 769px) {
  #fixed-status-widget {
    display: none !important;
  }
}

/* เปิดใช้บนมือถือ */
@media (max-width: 768px) {
  #bnav-profile-popup {
    display: block !important;
    opacity: 0;
    pointer-events: none;
  }

  #bnav-profile-popup.open {
    opacity: 1;
    pointer-events: auto;
  }
}


/* =============================================
   EXPLORE — Filter Bar Mobile
   ============================================= */

@media (max-width: 768px) {

  /* ซ่อน dropdown เรียงลำดับ */
  #filter-controls-desktop {
    display: none !important;
  }

  /* Filter section */
  .filter-section {
    padding: 0.6rem 0 !important;
    background: #fff;
    border-bottom: 1px solid #e8e6e1;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .filter-section .container {
    padding: 0 !important;
  }

  /* Filter bar — แถวเดียว scroll ได้ */
  .filter-bar {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
    overflow: hidden;
  }

  /* Tabs — scroll แนวนอน */
  .filter-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.4rem !important;
    padding: 0.35rem 0.875rem !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .filter-tabs::-webkit-scrollbar { display: none; }

  /* ปุ่มแต่ละอัน */
  .filter-tab {
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    padding: 0.38rem 0.875rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    border-radius: 50px !important;
    border: 1.5px solid #e8e6e1 !important;
    background: #fff !important;
    color: #555 !important;
    white-space: nowrap;
    transition: all 0.18s;
    -webkit-tap-highlight-color: transparent;
  }

  .filter-tab.active {
    background: linear-gradient(135deg, #b8941e, #d4af37) !important;
    color: #fff !important;
    border-color: #d4af37 !important;
    box-shadow: 0 2px 8px rgba(212,175,55,0.3) !important;
  }

  .filter-tab:active {
    transform: scale(0.96);
  }
}

@media (max-width: 480px) {
  .filter-tab {
    padding: 0.32rem 0.75rem !important;
    font-size: 0.74rem !important;
  }
}


/* =============================================
   WEATHER — Circular Progress Mobile (REPLACED)
   ============================================= */


/* =============================================
   WEATHER — Circular Progress & Traffic Mobile
   (แก้ไขใหม่ — viewBox-based, ไม่เบี้ยว)
   ============================================= */

@media (max-width: 768px) {

  /* SVG วงกลม — ใช้ width/height % เพื่อ responsive */
  .circular-progress {
    display: block;
    overflow: visible;
  }

  .circular-progress.large {
    width: 96px !important;
    height: 96px !important;
  }

  .circular-progress.small {
    width: 60px !important;
    height: 60px !important;
  }

  /* พื้นหลังวงกลม */
  .progress-bg {
    stroke: #ebebeb !important;
    stroke-width: 8 !important;
  }

  /* เส้น progress */
  .progress-fill {
    stroke-width: 8 !important;
    stroke-linecap: round !important;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1) !important;
  }

  /* สีสถานะ */
  .progress-fill.smooth  { stroke: #16a34a !important; }
  .progress-fill.moderate{ stroke: #d97706 !important; }
  .progress-fill.heavy   { stroke: #dc2626 !important; }

  /* ตัวเลข % */
  .progress-text {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    font-family: 'Noto Sans Thai', sans-serif !important;
    color: #1a1a1a !important;
    background: none !important;
    -webkit-text-fill-color: #1a1a1a !important;
    letter-spacing: -0.01em;
  }

  .circular-progress.small + .progress-text {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
  }

  /* Container — ไม่มี border-radius: 50% เพราะทำให้ clip */
  .circular-progress-container {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ===== Traffic Section Layout ===== */
  .traffic-section { padding: 1rem 0 !important; }

  .traffic-grid { grid-template-columns: 1fr !important; gap: 0.75rem !important; }

  .traffic-card {
    border-radius: 16px !important;
    padding: 1rem 0.875rem !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07) !important;
  }

  .traffic-header {
    margin-bottom: 0.75rem !important;
  }

  .traffic-header h3 { font-size: 0.9rem !important; }
  .traffic-time { font-size: 0.68rem !important; }

  .traffic-status-display {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1.25rem !important;
    margin-bottom: 0.5rem !important;
    text-align: left !important;
  }

  .traffic-status-text { text-align: left; }
  .traffic-level { font-size: 1rem !important; margin-bottom: 0.1rem !important; }
  .traffic-description { font-size: 0.72rem !important; }

  /* Forecast 2×2 */
  .traffic-forecast-content {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .forecast-item {
    padding: 0.55rem 0.4rem !important;
    border-radius: 10px !important;
    background: #f8f7f4 !important;
    gap: 0.25rem !important;
  }

  .forecast-time { font-size: 0.65rem !important; margin-bottom: 0.25rem !important; }
  .forecast-status { font-size: 0.68rem !important; margin-top: 0.25rem !important; }

  /* ===== Water Gauge ===== */
  .water-gauge {
    width: 110px !important;
    height: 110px !important;
  }

  /* gauge SVG ก็ต้องมี viewBox — แก้ใน JS แล้ว */
  .gauge-bg {
    stroke: #ebebeb !important;
    stroke-width: 10 !important;
  }

  .gauge-fill {
    stroke-width: 10 !important;
    stroke-linecap: round !important;
  }

  /* Gauge colors */
  .gauge-fill.normal       { stroke: #16a34a !important; }
  .gauge-fill.rising       { stroke: #d97706 !important; }
  .gauge-fill.warning      { stroke: #ea580c !important; }
  .gauge-fill.critical-high{ stroke: #dc2626 !important; }
  .gauge-fill.low          { stroke: #2563eb !important; }
  .gauge-fill.very-low     { stroke: #7c3aed !important; }
  .gauge-fill.critical-low { stroke: #6b7280 !important; }

  .gauge-value {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: #1a1a1a !important;
    background: none !important;
    -webkit-text-fill-color: #1a1a1a !important;
  }

  .gauge-unit { font-size: 0.65rem !important; }

  .water-gauge-container {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .water-level-display {
    padding: 0.875rem !important;
    gap: 1rem !important;
  }
}


/* =============================================
   LOCAL FOOD SECTION — Mobile
   เฉพาะมือถือ ไม่แตะ desktop
   ============================================= */

@media (max-width: 768px) {

  /* Section padding กระชับ */
  .local-food-section {
    padding: 1.5rem 0 2rem !important;
  }

  /* Header กึ่งกลาง */
  .local-food-section .lf-header {
    margin-bottom: 1rem !important;
    padding: 0 0.875rem;
  }

  .local-food-section .lf-header .section-subtitle {
    font-size: 0.7rem !important;
  }

  .local-food-section .lf-header .section-title {
    font-size: 1.3rem !important;
  }

  /* ===== Horizontal Scroll Carousel ===== */
  .local-food-grid {
    /* ยกเลิก grid — เปลี่ยนเป็น flex scroll */
    display: flex !important;
    grid-template-columns: unset !important;
    gap: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
    /* padding ซ้ายขวาให้เห็นขอบการ์ดถัดไป */
    padding: 0.25rem 0.875rem 0.875rem !important;
    gap: 0.75rem !important;
    /* ป้องกัน container ตัด */
    margin: 0 !important;
  }

  .local-food-grid::-webkit-scrollbar { display: none !important; }

  /* การ์ด — แนวนอน เห็น 1.15 การ์ด */
  .lf-card {
    flex: 0 0 82vw !important;
    min-width: 82vw !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 16px !important;
    scroll-snap-align: start !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18) !important;
    transform: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
  }

  /* tap feedback */
  .lf-card:active {
    opacity: 0.9 !important;
    transform: scale(0.98) !important;
  }

  /* รูปแสดงเต็ม aspect ratio */
  .lf-card-img {
    object-fit: cover !important;
    object-position: center center !important;
    filter: brightness(0.9) saturate(1.05) !important;
    transition: none !important;
  }

  .lf-card:active .lf-card-img {
    transform: none !important;
  }

  /* overlay เบา — รูปชัด */
  .lf-card-overlay {
    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.03) 0%,
      rgba(0,0,0,0.05) 55%,
      rgba(0,0,0,0.2) 100%
    ) !important;
  }

  /* เส้น accent ด้านบน — แสดงตลอด */
  .lf-card::after {
    opacity: 0.75 !important;
    height: 2.5px !important;
  }

  /* Number badge */
  .lf-num-badge {
    top: 0.65rem !important;
    right: 0.65rem !important;
    font-size: 0.62rem !important;
    padding: 0.15rem 0.5rem !important;
  }
}

@media (max-width: 480px) {
  .lf-card {
    flex: 0 0 86vw !important;
    min-width: 86vw !important;
    border-radius: 14px !important;
  }

  .local-food-section {
    padding: 1.25rem 0 1.75rem !important;
  }
}


/* =============================================
   FOOD.HTML — Tab Bar Mobile
   เฉพาะมือถือ ไม่แตะ desktop
   ============================================= */

@media (max-width: 768px) {

  /* Sticky tab bar */
  .food-tabs-wrap {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  }

  /* Tab container — scroll แนวนอน */
  .food-tabs {
    padding: 0 0.875rem !important;
    gap: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    /* ไม่ wrap — เลื่อนได้ */
    flex-wrap: nowrap !important;
  }

  .food-tabs::-webkit-scrollbar { display: none !important; }

  /* แต่ละ tab */
  .food-tab {
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    padding: 0.75rem 0.875rem !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    gap: 0.3rem !important;
    border-bottom-width: 2px !important;
    -webkit-tap-highlight-color: transparent;
  }

  .food-tab svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
  }

  /* Active tab */
  .food-tab.active {
    color: var(--gold-dark) !important;
    border-bottom-color: var(--gold-dark) !important;
  }

  /* Page header บน food.html — ลดความสูง */
  .food-page-header {
    height: 200px !important;
    margin-top: 0 !important;
  }

  .food-page-header-content {
    padding: 1.25rem 0.875rem !important;
  }

  .food-page-title {
    font-size: 1.4rem !important;
  }

  /* Content area */
  .food-content-wrap {
    padding: 1.25rem 0.875rem 3rem !important;
  }

  /* ===== Menu Cards — Mobile Redesign ===== */

  /* Grid → 1 คอลัมน์ กระชับ */
  .food-menu-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    margin-bottom: 0 !important;
  }

  /* การ์ด — vertical compact */
  .food-menu-card {
    flex-direction: column !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.09) !important;
    transition: opacity 0.18s ease !important;
    transform: none !important;
  }

  .food-menu-card:active {
    opacity: 0.88 !important;
    transform: scale(0.99) !important;
  }

  /* รูป — 16:9 เต็ม ไม่ตัด */
  .fmc-img-wrap {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    flex-shrink: 0 !important;
  }

  .fmc-img {
    object-fit: cover !important;
    object-position: center center !important;
    transition: none !important;
  }

  .food-menu-card:active .fmc-img {
    transform: none !important;
    filter: brightness(0.92) !important;
  }

  /* badge มุมซ้ายบน */
  .fmc-cat-badge {
    top: 0.6rem !important;
    left: 0.6rem !important;
    font-size: 0.58rem !important;
    padding: 0.18rem 0.55rem !important;
  }

  /* body กระชับ */
  .fmc-body {
    padding: 0.75rem 0.875rem 0.875rem !important;
    gap: 0 !important;
  }

  /* ชื่อเมนู — 1 บรรทัด */
  .fmc-menu-name {
    font-size: 0.92rem !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
    margin-bottom: 0.2rem !important;
  }

  /* ชื่อร้าน */
  .fmc-shop-name {
    font-size: 0.72rem !important;
    margin-bottom: 0 !important;
  }

  /* เส้นคั่น */
  .fmc-divider {
    margin: 0.5rem 0 !important;
  }

  /* meta — แนวตั้ง ที่อยู่ truncate 1 บรรทัด */
  .fmc-meta {
    gap: 0.3rem !important;
    margin-top: 0 !important;
  }

  .fmc-meta-item {
    font-size: 0.68rem !important;
    line-height: 1.3 !important;
    /* truncate 1 บรรทัด */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
  }

  .fmc-meta-item svg {
    flex-shrink: 0 !important;
    margin-top: 0 !important;
    width: 11px !important;
    height: 11px !important;
  }

  /* ปุ่มดูรายละเอียด */
  .fmc-detail-btn {
    font-size: 0.72rem !important;
    padding-top: 0.6rem !important;
    margin-top: 0.5rem !important;
  }

  /* เส้น accent ด้านบน — แสดงตลอด */
  .food-menu-card::after {
    opacity: 0.8 !important;
    height: 2px !important;
  }

  /* Category intro cards — 1 คอลัมน์ */
  .food-category-intro {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    margin-bottom: 1.5rem !important;
  }

  .food-cat-card {
    padding: 1rem !important;
    border-radius: 14px !important;
  }

  .food-cat-icon {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    margin-bottom: 0.65rem !important;
    font-size: 1.2rem !important;
  }

  .food-cat-name {
    font-size: 0.95rem !important;
  }

  .food-cat-desc {
    font-size: 0.75rem !important;
    margin-bottom: 0.6rem !important;
  }

  /* Coming soon */
  .food-coming-soon {
    padding: 3rem 1rem !important;
  }

  .food-coming-icon {
    width: 64px !important;
    height: 64px !important;
    margin-bottom: 1rem !important;
  }

  .food-coming-title {
    font-size: 1.2rem !important;
  }

  .food-coming-desc {
    font-size: 0.82rem !important;
  }
}


/* =============================================
   FOOD.HTML — Shop Detail Modal Mobile
   ============================================= */

@media (max-width: 768px) {

  /* Overlay padding แคบลง */
  #sdm-overlay {
    padding: 0.75rem !important;
    align-items: flex-end !important;
  }

  /* Modal — bottom sheet style */
  .sdm-modal {
    max-width: 100% !important;
    max-height: 90vh !important;
    border-radius: 20px 20px 16px 16px !important;
  }

  /* รูป — สูงพอดี */
  .sdm-gallery-img {
    max-height: 220px !important;
  }

  /* Content padding กระชับ */
  .sdm-content {
    padding: 1rem 1rem 1.25rem !important;
  }

  /* ชื่อร้าน */
  .sdm-shop-name {
    font-size: 1.15rem !important;
    margin-bottom: 0.2rem !important;
  }

  /* ชื่อเมนู */
  .sdm-menu-label {
    font-size: 0.78rem !important;
    margin-bottom: 0.875rem !important;
    padding-bottom: 0.875rem !important;
  }

  /* Info grid — 2 col กระชับ */
  .sdm-info-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 0.875rem !important;
  }

  .sdm-info-item {
    padding: 0.65rem 0.75rem !important;
    gap: 0.5rem !important;
    border-radius: 10px !important;
  }

  .sdm-info-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  .sdm-info-icon svg {
    width: 14px !important;
    height: 14px !important;
  }

  .sdm-info-label {
    font-size: 0.58rem !important;
    margin-bottom: 0.15rem !important;
  }

  /* ค่าข้อมูล — ไม่ wrap */
  .sdm-info-value {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
  }

  /* ประวัติ */
  .sdm-about-title {
    font-size: 0.62rem !important;
    margin-bottom: 0.35rem !important;
  }

  .sdm-about-text {
    font-size: 0.8rem !important;
    line-height: 1.65 !important;
  }
}


/* =============================================
   DISNEY LAYOUT — Mobile (เที่ยวนครพนมไลฟ์สไตล์)
   เฉพาะมือถือ ไม่แตะ desktop
   ============================================= */

@media (max-width: 768px) {

  .featured-section {
    padding: 1.25rem 0 1.5rem !important;
  }

  .featured-section .section-header {
    align-items: center !important;
    text-align: center !important;
    margin-bottom: 0.875rem !important;
    padding: 0 0.875rem !important;
  }

  .featured-section .section-title {
    font-size: 1.25rem !important;
  }

  .disney-layout {
    gap: 0.55rem !important;
    padding: 0 0.875rem !important;
  }

  .disney-hero {
    grid-template-columns: 1fr !important;
    grid-template-rows: 180px auto !important;
    height: auto !important;
    border-radius: 14px !important;
  }

  .disney-hero-img {
    grid-row: 1 !important;
    height: 180px !important;
  }

  .disney-hero-text {
    grid-row: 2 !important;
    padding: 0.875rem 1rem 1rem !important;
    border-radius: 0 0 14px 14px !important;
  }

  .disney-hero-title {
    font-size: 1.1rem !important;
    margin-bottom: 0.35rem !important;
  }

  .disney-hero-desc {
    font-size: 0.72rem !important;
    margin-bottom: 0.65rem !important;
    -webkit-line-clamp: 2 !important;
  }

  .disney-hero-btn {
    font-size: 0.72rem !important;
    padding: 0.42rem 1rem !important;
  }

  .disney-cards {
    display: flex !important;
    grid-template-columns: unset !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
    gap: 0.55rem !important;
    padding-bottom: 0.25rem !important;
  }

  .disney-cards::-webkit-scrollbar { display: none !important; }

  .disney-card {
    flex: 0 0 62vw !important;
    min-width: 62vw !important;
    height: 150px !important;
    border-radius: 12px !important;
    scroll-snap-align: start !important;
  }

  .disney-card-title {
    font-size: 0.85rem !important;
  }
}

@media (max-width: 480px) {
  .disney-card {
    flex: 0 0 68vw !important;
    min-width: 68vw !important;
    height: 140px !important;
  }
}


/* =============================================
   PLACE DETAIL PAGE — Mobile
   เฉพาะมือถือ ไม่แตะ desktop
   ============================================= */

@media (max-width: 768px) {

  /* Wrap padding กระชับ */
  .place-detail-wrap {
    padding: 1rem 0.875rem 3rem !important;
    max-width: 100% !important;
    margin-top: 0 !important;
  }

  /* Gallery สูงพอดี */
  .place-gallery-section {
    border-radius: 14px !important;
    margin-bottom: 1.25rem !important;
  }

  .place-gallery-scroll,
  .place-gallery-img {
    height: 240px !important;
  }

  /* Back bar */
  .place-back-bar {
    margin-bottom: 1rem !important;
  }

  /* 2 col → 1 col */
  #place-content {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* ชื่อสถานที่ */
  #place-name {
    font-size: 1.5rem !important;
    margin-bottom: 0.4rem !important;
  }

  /* Category badge */
  #place-category {
    font-size: 0.65rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Location + reviews */
  #place-location-badge,
  #place-reviews-badge {
    font-size: 0.78rem !important;
  }

  /* ปุ่มนำทาง */
  #place-nav-btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.875rem !important;
    display: flex !important;
  }

  /* ปุ่ม Prev / Next */
  #prev-place-btn,
  #next-place-btn {
    flex: 1 !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    padding: 0.55rem 0.75rem !important;
  }

  /* Info card ด้านขวา */
  #place-content > div:last-child {
    padding: 1rem !important;
    border-radius: 14px !important;
  }
}
