/* ================================================================
   RESPONSIVE.CSS — Complete Mobile-First Responsive System
   Breakpoints:
   - Mobile:   < 480px
   - Mobile+:  < 640px
   - Tablet:   < 768px
   - Laptop:   < 1024px
   - Desktop:  >= 1024px
================================================================ */

/* ---- MOBILE MENU DRAWER ELEMENTS ---- */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: #fdfaf4;
  z-index: 950;
  overflow-y: auto;
  transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}
.mobile-menu-drawer.open { left: 0; }
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #ebdcc5;
  background: #f7f0e3;
}
.mobile-menu-logo {
  font-family: 'Playfair Display', serif;
  color: #5c472d;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mobile-menu-close {
  color: #5c472d;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}
.mobile-menu-links a {
  display: block;
  padding: 16px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #2b2b2b;
  border-bottom: 1px solid #ebdcc5;
  transition: color 0.2s, background 0.2s;
}
.mobile-menu-links a:hover, .mobile-menu-links a.active {
  color: #8c6b32;
  background: rgba(201, 169, 110, 0.12);
}
.mobile-menu-footer {
  padding: 20px 24px;
  border-top: 1px solid #ebdcc5;
  font-size: 0.72rem;
  color: #8c7b68;
  letter-spacing: 0.05em;
  background: #fdfaf4;
}

/* ================================================================
   LAPTOP — max-width: 1024px
================================================================ */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }
  .hero-title { font-size: 2.75rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .category-card { height: 380px; }
  .news-grid { grid-template-columns: 1fr; gap: 24px; }
  .featured-news-card { height: auto; }
  .featured-news-img-wrap, .featured-news-bg { height: 260px; }
  .side-news-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .side-news-item {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0;
    border-bottom: none;
  }
  .side-news-thumb { width: 100%; height: 160px; }
  .top-listing { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-listing { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-top-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* ================================================================
   TABLET — max-width: 768px
================================================================ */
@media (max-width: 768px) {
  /* Top bar */
  .top-bar { display: none; }

  /* Header — fixed + frosted glass light */
  .main-header {
    position: fixed;
    top: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #ebdcc5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 10px 0;
  }
  .header-container { gap: 12px; }
  .nav-menu-links { display: none; }
  .mobile-menu-overlay { display: block; }
  .brand-avatar-ring { width: 38px; height: 38px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
  .brand-logo { font-size: 1.05rem; color: #183024; }
  .brand-tagline { font-size: 0.52rem; color: #8c6b32; }
  .menu-toggle-btn { color: #183024; }

  /* Hero — Mobile clean layout (photo top, text card bottom) */
  .hero-section {
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding-top: 54px !important;
    background: #fdfaf4 !important;
    overflow: visible !important;
  }
  .hero-slider-wrap {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    height: 250px !important;
    width: 100% !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    z-index: 1 !important;
  }
  .hero-slide {
    position: absolute !important;
    inset: 0 !important;
  }
  .hero-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.35) 100%) !important;
  }
  .hero-minh-hoa-tag {
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
    font-size: 0.62rem !important;
    padding: 3px 8px !important;
    border-radius: 3px !important;
    background: rgba(0,0,0,0.7) !important;
    color: #e0e0e0 !important;
    backdrop-filter: blur(4px) !important;
    z-index: 10 !important;
  }
  .hero-bottom-controls {
    display: flex !important;
    position: absolute !important;
    left: 8px !important;
    bottom: 8px !important;
    right: auto !important;
    padding: 4px 8px !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(6px) !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    z-index: 20 !important;
    gap: 10px !important;
  }
  .hero-btn {
    font-size: 0.88rem !important;
    padding: 2px 6px !important;
  }
  .hero-content {
    position: relative !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 20px 24px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e8e3d9 !important;
    color: #111111 !important;
    justify-content: flex-start !important;
    z-index: 5 !important;
  }
  .hero-title {
    font-family: var(--font-serif) !important;
    font-size: 1.52rem !important;
    line-height: 1.32 !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
    text-shadow: none !important;
    color: #111111 !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
  }
  .hero-subtitle {
    font-family: var(--font-sans) !important;
    font-size: 0.92rem !important;
    color: #333333 !important;
    line-height: 1.65 !important;
    margin-top: 0 !important;
    text-shadow: none !important;
  }
  .hero-subtitle strong {
    color: #111111 !important;
    font-weight: 700 !important;
  }
  .hero-cta-btns {
    margin-top: 18px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .hero-cta-zalo, .hero-cta-car {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 12px 10px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    line-height: 1.35 !important;
    gap: 6px !important;
    min-height: 48px !important;
  }
  .hero-cta-zalo {
    background: #0068FF !important;
    color: #ffffff !important;
    border: none !important;
  }
  .hero-cta-car {
    background: #18221b !important;
    color: #ffffff !important;
    border: 1px solid #18221b !important;
  }
  .hero-cta-zalo i, .hero-cta-car i {
    font-size: 0.85rem !important;
    flex-shrink: 0 !important;
  }

  /* Section */
  :root { --section-padding: 48px 0; }
  .section-title { font-size: clamp(1.6rem, 3.2vw, 2.1rem) !important; margin-bottom: 20px !important; }
  .section-header-flex { flex-wrap: wrap !important; gap: 12px !important; }

  /* Tab Intro Banners — Pure luxury dark card without photo overlay clash */
  .tab-intro-banner {
    background: linear-gradient(135deg, #18221b 0%, #121814 100%) !important;
    background-image: linear-gradient(135deg, #18221b 0%, #121814 100%) !important;
    padding: 22px 18px !important;
    border-radius: 8px !important;
    margin-bottom: 22px !important;
    border: 1px solid rgba(201,169,110,0.35) !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25) !important;
    text-align: center !important;
  }
  .tab-intro-tag {
    background: #c9a96e !important;
    color: #000 !important;
    font-size: 0.72rem !important;
    padding: 4px 14px !important;
    border-radius: 20px !important;
    letter-spacing: 0.08em !important;
    display: inline-block !important;
  }
  .tab-intro-title {
    font-size: 1.3rem !important;
    color: #ffffff !important;
    margin: 12px 0 8px !important;
    line-height: 1.35 !important;
  }
  .tab-intro-desc {
    font-size: 0.88rem !important;
    color: #dddddd !important;
    line-height: 1.6 !important;
  }

  /* Estate Cards Mobile Structure (Photo top, clean text below) */
  .estate-card {
    background: #ffffff !important;
    border: 1px solid #dfd7c5 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
  }
  .estate-card__img {
    height: 190px !important;
    width: 100% !important;
    position: relative !important;
    background: #f0ece3 !important;
    overflow: hidden !important;
  }
  .estate-card__img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  .estate-card__body {
    padding: 16px 14px 18px !important;
  }

  /* Categories */
  .categories-grid { grid-template-columns: 1fr; gap: 12px; }
  .category-card { height: 260px; }

  /* Trending */
  .trending-card { width: 210px; }
  .trending-img-wrapper { height: 148px; }

  /* News — Featured card with top image + bottom content box (Huỳnh Hoàng Thịnh style) */
  .featured-news-card {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #ebe6df;
    overflow: hidden;
    padding: 0;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  }
  .featured-news-img-wrap,
  .featured-news-bg {
    position: relative;
    height: 220px;
    width: 100%;
    inset: auto;
    flex-shrink: 0;
  }
  .featured-news-overlay {
    display: none;
  }
  .featured-news-body {
    position: relative;
    z-index: 5;
    padding: 18px 18px 22px;
    background: #ffffff;
  }
  .news-date-badge {
    color: #8a6d3b;
    font-size: 0.72rem;
    margin-bottom: 8px;
    display: inline-block;
  }
  .featured-news-title {
    font-size: 1.25rem;
    line-height: 1.38;
    color: #1a1a1a;
    margin-bottom: 10px;
  }
  .featured-news-excerpt {
    font-size: 0.88rem;
    color: #666666;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .side-news-list { display: flex; flex-direction: column; gap: 14px; }
  .side-news-item { flex-direction: row; padding-bottom: 14px; border-bottom: 1px solid var(--color-border); }
  .side-news-thumb { width: 110px; height: 78px; }

  /* Podcast */
  .podcast-section-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .podcast-list { grid-template-columns: 1fr; gap: 16px; }
  .podcast-card-box { padding: 20px; }
  .podcast-title { font-size: 1.1rem; }

  /* Tabs */
  .tabs-header { gap: 2px; overflow-x: auto; padding-bottom: 0; }
  .tab-btn { padding: 12px 14px; font-size: 0.82rem; }

  /* Top listing */
  .top-listing { grid-template-columns: 1fr; gap: 16px; }
  .top-listing-card { height: auto; }

  /* Grid listing — 2 col */
  .grid-listing { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-card { height: auto; }
  .grid-card h5 { font-size: 0.98rem; }
  .car-price { font-size: 0.76rem !important; }

  /* Footer */
  .footer-top-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom-bar { flex-direction: column; gap: 10px; text-align: center; }

  /* Zalo */
  .zalo-floating-btn { width: 52px; height: 52px; bottom: 20px; right: 16px; }
  .zalo-icon { font-size: 1.5rem; }
}

/* ================================================================
   MOBILE — max-width: 480px
================================================================ */
@media (max-width: 480px) {
  .container { padding: 0 14px; }

  /* Hero */
  .hero-slider-wrap { height: 235px !important; }
  .hero-content { padding: 20px 16px 22px !important; background: #ffffff !important; }
  .hero-title { font-size: 1.36rem !important; line-height: 1.3 !important; color: #111111 !important; }
  .hero-subtitle { font-size: 0.88rem !important; color: #333333 !important; }
  .hero-subtitle strong { color: #111111 !important; }
  .hero-cta-btns {
    margin-top: 15px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .hero-cta-zalo, .hero-cta-car {
    padding: 10px 6px !important;
    font-size: 0.76rem !important;
    min-height: 44px !important;
    gap: 5px !important;
    line-height: 1.3 !important;
  }
  .hero-cta-car {
    background: #18221b !important;
    color: #ffffff !important;
    border: 1px solid #18221b !important;
  }
  .hero-cta-zalo i, .hero-cta-car i {
    font-size: 0.8rem !important;
  }

  /* Logo & Brand */
  .brand-avatar-ring { width: 34px; height: 34px; }
  .brand-logo { font-size: 0.92rem; letter-spacing: 0.08em; }
  .brand-tagline { font-size: 0.48rem; }

  /* Section */
  .section-title { font-size: clamp(1.45rem, 4.5vw, 1.85rem) !important; }

  /* Tab Intro Banners */
  .tab-intro-banner { padding: 18px 14px !important; }
  .tab-intro-title { font-size: 1.18rem !important; }
  .tab-intro-desc { font-size: 0.84rem !important; }

  /* Categories */
  .category-card { height: 210px; }
  .category-card-title { font-size: 1.25rem; }

  /* Trending */
  .trending-card { width: 165px; }
  .trending-img-wrapper { height: 125px; }
  .trending-price { font-size: 0.88rem; }
  .trending-title { font-size: 0.76rem; }

  /* Tabs */
  .tab-btn { padding: 10px 11px; font-size: 0.76rem; }

  /* Top listing → single */
  .top-listing-card { height: auto; }
  .top-listing-info h4 { font-size: 1.1rem; }

  /* Grid listing → single col */
  .grid-listing { grid-template-columns: 1fr; gap: 14px; }
  .grid-card { height: auto; }

  /* News */
  .featured-news-img-wrap,
  .featured-news-bg { height: 185px; }
  .featured-news-body { padding: 15px 14px 18px; }
  .featured-news-title { font-size: 1.12rem; }
  .featured-news-excerpt { font-size: 0.84rem; }

  /* Side news */
  .side-news-thumb { width: 88px; height: 68px; }
  .side-news-title { font-size: 0.83rem; }
  .side-news-excerpt { display: none; }

  /* Sub-tabs */
  .sub-tabs-header { flex-wrap: wrap; gap: 8px; }
  .sub-tab-btn { font-size: 0.76rem; padding: 6px 13px; }

  /* Podcast */
  .podcast-card-box { padding: 18px 14px; }
  .podcast-desc { font-size: 0.76rem; }

  /* Footer */
  .footer-bottom-bar { font-size: 0.68rem; }

  /* Zalo */
  .zalo-floating-btn { width: 46px; height: 46px; bottom: 14px; right: 12px; }
  .zalo-icon { font-size: 1.25rem; }
}

/* ================================================================
   ARTICLE PAGES & EDITORIAL DETAIL — MOBILE OPTIMIZATION
   (Tối ưu toàn diện cho bài viết, bảng so sánh & lưới ảnh trên mobile)
================================================================ */
@media (max-width: 768px) {
  .article-header { padding: 80px 0 28px !important; }
  .article-title { font-size: 1.6rem !important; line-height: 1.3 !important; }
  .article-body { font-size: 0.98rem !important; line-height: 1.75 !important; }
  
  /* Article Containers & Content Padding */
  .article-container {
    padding: 0 12px !important;
    margin: 16px auto 36px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .article-content-body {
    padding: 22px 14px !important;
    border-radius: 8px !important;
  }
  .article-content {
    font-size: 0.98rem !important;
    line-height: 1.75 !important;
    max-width: 100% !important;
  }
  .article-content p,
  .article-content-body p {
    font-size: 0.96rem !important;
    line-height: 1.72 !important;
    margin-bottom: 18px !important;
  }
  .article-content h2,
  .article-content-body h2 {
    font-size: 1.32rem !important;
    line-height: 1.38 !important;
    margin: 32px 0 14px !important;
  }
  .article-content h3,
  .article-content-body h3 {
    font-size: 1.15rem !important;
    line-height: 1.4 !important;
    margin: 24px 0 10px !important;
  }

  /* Multi-column Grids inside articles stacked to 1 column on mobile */
  .article-content div[style*="grid-template-columns"],
  .article-content-body div[style*="grid-template-columns"],
  .article-container div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Responsive Tables Wrapper — Eliminates narrow vertical noodles */
  .table-scroll-wrapper,
  div[style*="overflow-x: auto"],
  .article-table-wrap,
  .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 22px 0 !important;
    border: 1px solid #dfc89f !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    position: relative !important;
    display: block !important;
    box-shadow: 0 4px 16px rgba(194, 155, 83, 0.08) !important;
  }

  /* Mobile scroll hint banner */
  .table-scroll-wrapper::before,
  div[style*="overflow-x: auto"]::before {
    content: "← Vuốt sang ngang để xem đầy đủ bảng so sánh →";
    display: block;
    background: #faf4e8;
    color: #8c6b32;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    padding: 6px 10px;
    border-bottom: 1px dashed #dfc89f;
    letter-spacing: 0.02em;
    position: sticky;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 2;
  }

  /* Force comfortable minimum width on tables so words never break awkwardly */
  .table-scroll-wrapper table,
  div[style*="overflow-x: auto"] > table,
  .article-content table,
  .article-content-body table {
    min-width: 620px !important;
    width: 100% !important;
    font-size: 0.86rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
  }

  /* Table Header cells */
  .table-scroll-wrapper th,
  div[style*="overflow-x: auto"] th,
  .article-content th,
  .article-content-body th {
    padding: 12px 14px !important;
    font-size: 0.82rem !important;
    letter-spacing: 0.03em !important;
    white-space: nowrap !important;
    text-align: left !important;
    line-height: 1.3 !important;
  }

  /* Table Body cells */
  .table-scroll-wrapper td,
  div[style*="overflow-x: auto"] td,
  .article-content td,
  .article-content-body td {
    padding: 12px 14px !important;
    font-size: 0.86rem !important;
    line-height: 1.55 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  /* Quotes and figures */
  .magazine-quote {
    font-size: 1.05rem !important;
    padding: 18px 16px !important;
    margin: 20px auto !important;
    max-width: 100% !important;
  }
  .magazine-dropcap::first-letter {
    font-size: 2.6rem !important;
    padding-right: 6px !important;
  }
  .magazine-figure { margin: 20px 0 !important; }

  /* Images inside articles */
  .article-content img,
  .article-content-body img {
    max-width: 100% !important;
    height: auto !important;
  }
}

@media (max-width: 480px) {
  .article-header { padding: 75px 0 24px !important; }
  .article-title { font-size: 1.35rem !important; line-height: 1.25 !important; }
  .article-content-body { padding: 18px 12px !important; }
  .magazine-quote { font-size: 0.92rem !important; padding: 14px 12px !important; }
  .article-content-body h2 { font-size: 1.2rem !important; }

  .table-scroll-wrapper table,
  div[style*="overflow-x: auto"] > table,
  .article-content table,
  .article-content-body table {
    min-width: 580px !important;
    font-size: 0.84rem !important;
  }
}


/* ================================================================
   TOUCH DEVICE — disable hover transforms for performance
================================================================ */
@media (hover: none) {
  .category-card:hover .category-card-bg,
  .featured-news-card:hover .featured-news-bg,
  .trending-card:hover .trending-img-wrapper img,
  .grid-card:hover .grid-img img,
  .top-listing-card:hover .top-listing-img,
  .side-news-item:hover .side-news-thumb img { transform: none !important; }
}

/* ================================================================
   UTILITIES — Scroll-smooth, scrollbar hide on mobile tab headers
================================================================ */
.tabs-header::-webkit-scrollbar { display: none; }
.tabs-header { -ms-overflow-style: none; scrollbar-width: none; }

/* Location Section Responsive */
@media (max-width: 992px) {
  .location-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .map-container-frame, .location-map-wrap {
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  .location-section {
    padding: 35px 0 60px;
  }
  .location-info-card {
    padding: 24px 18px;
  }
  .location-name {
    font-size: 1.4rem;
  }
  .map-container-frame, .location-map-wrap {
    min-height: 350px;
  }
  .location-cta-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .transit-item {
    gap: 10px;
    padding: 10px 12px;
  }
  .transit-time {
    font-size: 0.76rem;
    padding: 3px 8px;
  }
}


