/* ============================================================
   WEB NHANH — responsive.css
   Tối ưu hiển thị hoàn hảo trên Mobile, Tablet & Desktop
   ============================================================ */

/* ---------- 1. TABLET (max-width: 1024px) ---------- */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.6rem;
  }
  .values-grid,
  .demos-grid,
  .pricing-grid,
  .articles-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .timeline-steps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 2. MOBILE (max-width: 768px) ---------- */
@media (max-width: 768px) {
  /* Chống tràn ngang tuyệt đối trên điện thoại */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .container {
    padding: 0 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .bg-blob {
    max-width: 100vw;
    overflow: hidden;
  }

  /* Header & Menu Navbar */
  .navbar {
    padding: 10px 0;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: none;
    gap: 16px;
    z-index: 999;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-actions .btn-nav {
    display: none;
  }

  /* Hero Section */
  .hero-section {
    padding: 36px 0 24px 0;
  }
  .hero-title {
    font-size: 1.95rem;
    line-height: 1.28;
    margin-bottom: 12px;
  }
  .hero-intro {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
    font-size: 0.98rem;
  }
  .hero-trust {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    margin-top: 22px;
  }
  .hero-trust-item {
    justify-content: center;
    font-size: 0.85rem;
    padding: 6px 12px;
    text-align: center;
  }

  /* Tiêu đề phân đoạn cân đối cho mắt nhìn trên điện thoại */
  .section-header {
    margin-bottom: 20px;
    text-align: center;
  }
  .section-tag {
    font-size: 0.78rem;
    padding: 4px 12px;
    margin-bottom: 8px;
    display: inline-block;
  }
  .section-title {
    font-size: 1.55rem;
    line-height: 1.3;
    margin-bottom: 8px;
    text-align: center;
  }
  .section-sub {
    font-size: 0.9rem;
    line-height: 1.55;
    text-align: center;
    max-width: 360px;
    margin: 0 auto;
    color: var(--ink-secondary);
  }

  /* ============================================================
     HỆ THỐNG KHUNG SLIDER TRƯỢT CHUẨN TRÊN MOBILE
     ============================================================ */
  .values-slider-wrap,
  .slider-section-wrap {
    position: relative;
    width: 100%;
    max-width: 410px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .values-slider-viewport,
  .slider-viewport {
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 22px 6px 16px 6px; /* Khoảng thở trên đủ cho huy hiệu không bị cắt */
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    box-sizing: border-box;
  }
  .values-slider-viewport:active,
  .slider-viewport:active {
    cursor: grabbing;
  }

  /* Track trượt: ngang cố định, không nhảy, không tràn */
  .values-grid,
  .demos-grid,
  .pricing-grid,
  .articles-grid,
  .testimonials-grid,
  .timeline-steps-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }

  /* Từng thẻ chiếm chuẩn xác 100% chiều rộng khung nhìn */
  .values-grid .value-card,
  .demos-grid .demo-card,
  .pricing-grid .pricing-card,
  .articles-grid .article-card,
  .testimonials-grid .testimonial-card,
  .timeline-steps-grid .timeline-step-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
  }

  /* ---------- 1. KHUNG 6 CAM KẾT GIÁ TRỊ (Icon phác thảo cân đối, không lệch) ---------- */
  .values-grid .value-card {
    padding: 28px 20px;
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 2px solid var(--secondary-border);
    box-shadow: 0 4px 16px rgba(56, 169, 209, 0.08);
  }
  .values-grid .value-card .value-card-badge {
    margin-bottom: 12px;
  }
  .values-grid .value-card .value-icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 14px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .values-grid .value-card .value-icon-box svg {
    width: 76px;
    height: 76px;
    display: block;
    margin: 0 auto;
  }
  .values-grid .value-card .value-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: 0.05em;
    text-align: center;
  }
  .values-grid .value-card .value-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--ink-secondary);
    text-align: center;
    max-width: 320px;
    margin: 0 auto;
  }

  /* ---------- 2. KHUNG MẪU WEBSITE (Phom ảnh 16:10 chuẩn chỉnh, không méo) ---------- */
  .demos-grid .demo-card {
    background: #ffffff;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(42, 46, 55, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    justify-content: space-between;
  }
  .demos-grid .demo-card .demo-thumb-wrap {
    width: 100%;
    height: 200px;
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
    border-radius: calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px) 0 0;
    background: #f3eee6;
    flex-shrink: 0;
  }
  .demos-grid .demo-card .demo-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border: none;
  }
  .demos-grid .demo-card .demo-tag-badge {
    top: 12px;
    left: 12px;
  }
  .demos-grid .demo-card .demo-body {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
  }
  .demos-grid .demo-card .demo-name {
    font-size: 1.22rem;
    font-weight: 800;
    margin-bottom: 8px;
  }
  .demos-grid .demo-card .demo-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ink-secondary);
    margin-bottom: 14px;
  }
  .demos-grid .demo-card .demo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.88rem;
  }
  .demos-grid .demo-card .demo-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
  }

  /* ---------- 3. KHUNG QUY TRÌNH 4 BƯỚC (Chiều cao đều nhau, cân đối) ---------- */
  .timeline-steps-grid .timeline-step-card {
    padding: 24px 20px;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(42, 46, 55, 0.06);
  }
  .timeline-steps-grid .timeline-step-card .step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  .timeline-steps-grid .timeline-step-card .step-number-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.35rem;
    flex-shrink: 0;
  }
  .timeline-steps-grid .timeline-step-card .step-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink-secondary);
    margin-bottom: 12px;
    flex: 1;
  }
  .timeline-steps-grid .timeline-step-card .step-highlight {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    width: fit-content;
    margin-top: auto;
  }

  /* ---------- 4. KHUNG BẢNG GIÁ (Huy hiệu phổ biến nhất chuẩn giữa, không che mép) ---------- */
  .pricing-grid .pricing-card {
    padding: 34px 22px 28px 22px;
    min-height: 485px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    background: #ffffff;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(42, 46, 55, 0.06);
    transform: none !important;
  }
  .pricing-card.featured {
    transform: none !important;
    background: #ffffff;
  }
  .pricing-card .pricing-badge-top {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    padding: 4px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(232, 93, 38, 0.35);
    z-index: 3;
  }
  .pricing-card .pricing-name {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }
  .pricing-card .pricing-amount {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
  }
  .pricing-card .pricing-features {
    margin: 16px 0;
    font-size: 0.88rem;
  }
  .pricing-card [data-choose-pkg] {
    width: 100%;
    margin-top: auto;
    text-align: center;
    justify-content: center;
  }

  /* ---------- 5. KHUNG BÀI VIẾT CẨM NANG (Phom ảnh 16:9 sắc nét, text đều đặn) ---------- */
  .articles-grid .article-card {
    background: #ffffff;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(42, 46, 55, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    justify-content: space-between;
  }
  .articles-grid .article-card .article-thumb-wrap {
    width: 100%;
    height: 195px;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    border-radius: calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px) 0 0;
    background: #f3eee6;
    flex-shrink: 0;
  }
  .articles-grid .article-card .article-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border: none;
  }
  .articles-grid .article-card .article-body {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
  }
  .articles-grid .article-card .article-title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .articles-grid .article-card .article-excerpt {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--ink-secondary);
    margin-bottom: 14px;
    min-height: 64px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .articles-grid .article-card .article-link {
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  /* ---------- 6. KHUNG ĐÁNH GIÁ KHÁCH HÀNG ---------- */
  .testimonials-grid .testimonial-card {
    padding: 26px 20px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border: 2px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(42, 46, 55, 0.06);
  }
  .testimonials-grid .testimonial-card .testimonial-content {
    font-size: 0.95rem;
    line-height: 1.55;
    font-style: italic;
    color: var(--ink);
    margin: 10px 0 16px 0;
    flex: 1;
  }
  .testimonials-grid .testimonial-card .testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
  }
  .testimonials-grid .testimonial-card .testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }

  /* Trạng thái Active khi thẻ đang hiển thị: Đổi màu viền và đổ bóng êm, không lệch kích thước */
  .values-grid .value-card.active,
  .demos-grid .demo-card.active,
  .pricing-grid .pricing-card.active,
  .articles-grid .article-card.active,
  .testimonials-grid .testimonial-card.active,
  .timeline-steps-grid .timeline-step-card.active {
    border-color: var(--primary) !important;
    box-shadow: 0 10px 26px rgba(232, 93, 38, 0.16) !important;
  }

  /* Điều khiển chung cho Slider: Căn giữa hoàn hảo, nút bấm & Chấm dots */
  .values-slider-controls,
  .slider-controls {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
  }
  .values-slider-btn,
  .slider-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--secondary-border);
    background: #ffffff;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    -webkit-tap-highlight-color: transparent;
  }
  .values-slider-btn:active,
  .slider-btn:active {
    transform: scale(0.92);
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
  }
  .values-slider-dots,
  .slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .values-dot,
  .slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .values-dot.active,
  .slider-dot.active {
    width: 24px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(232, 93, 38, 0.4);
  }
  .values-slider-meta,
  .slider-meta {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
  }
  .values-slider-badge,
  .slider-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--ink-secondary);
    font-weight: 600;
    background: rgba(232, 93, 38, 0.06);
    padding: 3px 12px;
    border-radius: 999px;
    border: 1px solid rgba(232, 93, 38, 0.15);
  }
  .badge-live-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(232, 93, 38, 0.7);
    animation: pulse-live 1.8s infinite;
  }
  .badge-hint {
    color: var(--ink-muted);
    font-size: 0.75rem;
  }
  .values-timer-bar-wrap,
  .slider-progress-track {
    width: 120px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
  }
  .values-timer-bar-fill,
  .slider-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 999px;
    transition: width 0.1s linear;
  }

  /* Banner Lộ trình tên lửa & CTA */
  .rocket-timeline-section svg {
    max-width: 100%;
    height: auto;
    overflow: visible;
  }
  .rocket-banner {
    flex-direction: column;
    text-align: center;
    padding: 26px 18px;
    gap: 16px;
  }
  .rocket-banner-text h4 {
    font-size: 1.2rem;
    line-height: 1.35;
    margin-bottom: 6px;
  }

  /* Form & Footer & Chat */
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .chat-panel {
    width: 100%;
    right: 0;
    bottom: 0;
    max-width: 100vw;
    height: 85vh;
    border-radius: 20px 20px 0 0;
  }

  /* FAQ Accordion trên Mobile */
  .faq-section {
    padding: 50px 0 60px 0;
  }
  .faq-title {
    font-size: 1.85rem;
    margin-top: 8px;
    margin-bottom: 8px;
  }
  .faq-sub {
    font-size: 0.94rem;
  }
  .faq-item-header {
    padding: 16px 18px;
    gap: 12px;
  }
  .faq-item-question {
    font-size: 0.96rem;
    line-height: 1.4;
  }
  .faq-toggle-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 1.35rem;
  }
  .faq-item-content {
    padding: 0 18px 18px 18px;
    font-size: 0.92rem;
    line-height: 1.6;
  }
  .faq-cta-box {
    padding: 20px 16px;
    margin-top: 26px;
  }
}

