<!DOCTYPE html>
<html lang="vi">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>Có lỗi xảy ra | MiHi Furniture – Nội Thất Minh Hiếu Hà Nội</title>
  <meta name="description" content="MiHi Furniture – Xưởng nội thất thiết kế, sản xuất và thi công trọn gói tại Hà Nội. Chất lượng gỗ công nghiệp cao cấp, bảo hành trọn đời."/>

  <!-- Tailwind Play CDN -->
  <script src="https://cdn.tailwindcss.com"></script>
  <script>
    tailwind.config = {
      theme: {
        extend: {
          colors: {
            /* Teal + Gold palette — Minh Hiếu brand */
            espresso:   '#151411',
            walnut:     '#518581',
            oak:        '#FFB23F',
            sand:       '#E4E4E6',
            cream:      '#F0F0EE',
            ivory:      '#F9F9F7',
            /* aliases */
            primary:        '#518581',
            'primary-dark': '#3D6968',
            accent:         '#FFB23F',
            'text-heading': '#151411',
            'text-body':    '#3C3B39',
            'text-muted':   '#636260',
            'border-light': '#E4E4E6',
            'bg-soft':      '#F3F3F3',
          },
          fontFamily: {
            serif: ['"Raleway"', 'system-ui', 'sans-serif'],
            sans:  ['"Plus Jakarta Sans"', 'system-ui', 'sans-serif'],
          },
          borderRadius: {
            '2xl': '1rem',
            '3xl': '1.5rem',
          }
        }
      }
    }
  </script>

  <!-- Google Fonts -->
  <link rel="preconnect" href="https://fonts.googleapis.com"/>
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""/>
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Raleway:wght@500;600;700;800&display=swap" rel="stylesheet"/>

  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"/>
  <link rel="stylesheet" href="/css/layout/client-layout.css"/>

  <!-- Favicon -->
  <link rel="icon" type="image/svg+xml" href="/images/favicon.svg"/>
  <meta name="theme-color" content="#518581"/>
</head>
<body class="bg-ivory text-espresso">

<header>
  <nav id="mainNav"
       class="sticky top-0 z-50 bg-white/95 backdrop-blur border-b border-sand transition-shadow duration-300">
    <div class="max-w-7xl mx-auto px-5 lg:px-10 h-[68px] flex items-center justify-between gap-6">

      <!-- Logo -->
      <a href="/home-social" class="mihi-logo flex items-center gap-3 flex-shrink-0">
        <div class="logo-icon self-center"></div>
      </a>

      <!-- Desktop nav — items từ DB (quản lý tại /admin/menu) -->
      <ul class="hidden lg:flex items-center gap-6">
        
      </ul>

      <!-- Right actions -->
      <div class="flex items-center gap-1.5">

        <!-- Search -->
        <button id="searchToggle" class="mihi-icon-btn" aria-label="Tìm kiếm">
          <i class="fas fa-search text-sm"></i>
        </button>

        <!-- Wishlist — yêu cầu đăng nhập -->
        
        <a href="/dang-nhap" class="mihi-icon-btn relative" aria-label="Yêu thích">
          <i class="far fa-heart text-sm"></i>
        </a>

        <!-- Auth -->
        

        <!-- Customer dropdown -->
        

        <!-- Guest: link to login -->
        <a href="/dang-nhap"
           class="mihi-icon-btn hidden md:flex" aria-label="Đăng nhập">
          <i class="fas fa-user text-sm"></i>
        </a>

        <!-- CTA Báo giá — desktop -->
        <a href="/bao-gia" class="hidden md:inline-flex btn-baogia ml-1">
          Báo giá nhanh <i class="fas fa-arrow-right"></i>
        </a>

        <!-- Hamburger — mobile -->
        <button id="mobileMenuBtn" class="lg:hidden mihi-icon-btn ml-1" aria-label="Menu">
          <i class="fas fa-bars text-sm"></i>
        </button>
      </div>
    </div>

    <!-- Search bar (expand) -->
    <div id="searchBar" class="hidden border-t border-sand bg-white px-5 lg:px-10 py-3">
      <form action="/san-pham" method="get" class="flex items-center gap-3 max-w-2xl mx-auto">
        <i class="fas fa-search text-text-muted text-sm flex-shrink-0"></i>
        <input type="text" name="keyword" placeholder="Tìm sản phẩm, phòng, vật liệu..." autofocus
               class="flex-1 bg-transparent py-1 text-sm text-espresso placeholder:text-text-muted outline-none"/>
        <button type="button" id="searchClose" class="text-text-muted hover:text-espresso text-xs">
          <i class="fas fa-times"></i>
        </button>
      </form>
    </div>
  </nav>

  <!-- Mobile overlay -->
  <div id="mobileOverlay" class="fixed inset-0 bg-black/40 z-[60] hidden"></div>

  <!-- Mobile drawer -->
  <div id="mobileDrawer"
       class="fixed top-0 left-0 h-full w-72 bg-white z-[70] -translate-x-full transition-transform duration-300 ease-in-out shadow-2xl flex flex-col">

    <!-- Drawer header -->
    <div class="flex items-center justify-between px-5 py-4 border-b border-sand">
      <div class="flex items-center gap-3">
        <div class="logo-icon-sm self-center"></div>
      </div>
      <button id="mobileMenuClose" class="mihi-icon-btn">
        <i class="fas fa-times text-sm"></i>
      </button>
    </div>

    <!-- Drawer nav — items từ DB -->
    <nav class="flex-1 px-4 py-5 overflow-y-auto">
      <ul class="space-y-1">
        
      </ul>
      <div class="mt-6 pt-6 border-t border-sand space-y-3">
        <a href="/bao-gia"
           class="flex items-center justify-center gap-2 w-full bg-walnut text-white py-3 rounded-full font-semibold text-sm hover:bg-[#7a5234] transition-colors">
          <i class="fas fa-calculator text-xs"></i> Báo giá nhanh
        </a>
        <a href="/dang-nhap"
           class="flex items-center justify-center gap-2 w-full border border-sand text-text-body py-3 rounded-full font-semibold text-sm hover:border-walnut hover:text-walnut transition-colors">
          <i class="fas fa-user text-xs"></i> Đăng nhập
        </a>
      </div>
    </nav>

    <!-- Drawer footer -->
    <div class="px-5 py-4 border-t border-sand bg-ivory text-xs text-text-muted text-center">
      <i class="fas fa-phone-alt mr-1 text-walnut"></i>
      <a href="tel:0986267941" class="font-semibold text-espresso">0986.267.941</a>
      &nbsp;|&nbsp; T2–T7: 8:00–18:00
    </div>
  </div>

  <!-- Flash message slot -->
  
  
</header>

<section class="py-24">
  <div class="max-w-xl mx-auto px-5 text-center">
    <div class="w-20 h-20 bg-red-50 rounded-full flex items-center justify-center mx-auto mb-6">
      <i class="fas fa-exclamation-triangle text-red-500 text-3xl"></i>
    </div>
    <h1 class="font-serif text-3xl font-bold text-espresso mb-3">Có lỗi xảy ra</h1>
    <p class="text-text-muted mb-6">
      Hệ thống gặp sự cố không mong muốn. Chúng tôi đã ghi nhận và sẽ xử lý sớm. Vui lòng thử lại sau.
    </p>
    <p class="text-xs text-text-muted mb-8">
      Đường dẫn: <span class="font-mono">/sitemap.xml</span>
    </p>
    <a href="/"
       class="inline-flex items-center gap-2 bg-walnut hover:bg-[#3D6968] text-white font-semibold text-sm px-7 py-3 rounded-full transition-colors">
      <i class="fas fa-home text-xs"></i> Về trang chủ
    </a>
  </div>
</section>

<footer>
  <!-- Newsletter bar -->
  <div class="bg-espresso py-10">
    <div class="max-w-7xl mx-auto px-5 lg:px-10 flex flex-col md:flex-row items-center justify-between gap-6">
      <div>
        <h3 class="text-white font-serif text-xl font-bold mb-1">Đăng ký nhận bảng giá & ưu đãi</h3>
        <p class="text-white/60 text-sm">Cập nhật mẫu mới và khuyến mãi độc quyền từ MiHi Furniture</p>
      </div>
      <a href="/bao-gia"
         class="inline-flex items-center gap-2 bg-walnut text-white font-semibold text-sm px-7 py-3 rounded-full hover:bg-[#7a5234] transition-colors flex-shrink-0">
        Nhận báo giá miễn phí <i class="fas fa-arrow-right text-xs"></i>
      </a>
    </div>
  </div>

  <!-- Main footer body -->
  <div class="bg-white border-t border-sand">
    <div class="max-w-7xl mx-auto px-5 lg:px-10 py-14">
      <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-10">

        <!-- Brand col -->
        <div class="lg:col-span-1">
          <div class="flex items-center gap-3 mb-4">
            <div class="logo-icon-sm self-center"></div>
          </div>
          <p class="text-sm text-text-muted leading-relaxed mb-5">
            Xưởng nội thất chuyên <strong class="text-text-body font-semibold">thiết kế – sản xuất – thi công</strong> trọn gói tại Hà Nội. Hơn 20 năm kinh nghiệm, bảo hành chọn đời.
          </p>
          <div class="flex gap-2.5">
            <a href="#" class="footer-social" aria-label="Facebook"><i class="fab fa-facebook-f text-sm"></i></a>
            <a href="#" class="footer-social" aria-label="Zalo"><i class="fas fa-comment-dots text-sm"></i></a>
            <a href="#" class="footer-social" aria-label="YouTube"><i class="fab fa-youtube text-sm"></i></a>
            <a href="#" class="footer-social" aria-label="TikTok"><i class="fab fa-tiktok text-sm"></i></a>
          </div>
        </div>

        <!-- Sản phẩm col -->
        <div>
          <h4 class="footer-col-title">Sản phẩm</h4>
          <ul class="space-y-2.5">
            <li><a href="/san-pham?phong=phong-ngu"   class="footer-link">Phòng ngủ</a></li>
            <li><a href="/san-pham?phong=phong-khach" class="footer-link">Phòng khách</a></li>
            <li><a href="/san-pham?phong=phong-an"    class="footer-link">Phòng ăn</a></li>
            <li><a href="/san-pham?phong=phong-bep"   class="footer-link">Phòng bếp</a></li>
            <li><a href="/san-pham?phong=van-phong"   class="footer-link">Phòng làm việc</a></li>
          </ul>
        </div>

        <!-- Về chúng tôi col -->
        <div>
          <h4 class="footer-col-title">Về chúng tôi</h4>
          <ul class="space-y-2.5">
            <li><a href="/ve-chung-toi"               class="footer-link">Giới thiệu MiHi</a></li>
            <li><a href="/cong-trinh"                 class="footer-link">Công trình thực tế</a></li>
            <li><a href="/ve-chung-toi#quy-trinh"   class="footer-link">Quy trình thi công</a></li>
            <li><a href="/ve-chung-toi#bao-hanh"    class="footer-link">Chính sách bảo hành</a></li>
            <li><a href="/bao-gia"         class="footer-link">Báo giá nhanh</a></li>
          </ul>
        </div>

        <!-- Liên hệ col -->
        <div>
          <h4 class="footer-col-title">Kết nối</h4>
          <ul class="space-y-3 text-sm text-text-muted">
            <li class="flex items-start gap-2.5">
              <i class="fas fa-map-marker-alt mt-0.5 text-walnut flex-shrink-0"></i>
              <span>Đường Miếu Đinh Nguyên, xã Liên Minh, TP. Hà Nội</span>
            </li>
            <li class="flex items-center gap-2.5">
              <i class="fas fa-phone-alt text-walnut flex-shrink-0"></i>
              <a href="tel:0986267941" class="footer-link font-semibold text-espresso">0986.267.941</a>
            </li>
            <li class="flex items-center gap-2.5">
              <i class="fas fa-comment-dots text-walnut flex-shrink-0"></i>
              <a href="#" class="footer-link">Zalo: 0986.267.941</a>
            </li>
            <li class="flex items-center gap-2.5">
              <i class="fas fa-envelope text-walnut flex-shrink-0"></i>
              <span class="footer-link">hieuvm28@gmail.com</span>
            </li>
            <li class="flex items-center gap-2.5">
              <i class="far fa-clock text-walnut flex-shrink-0"></i>
              <span>Thứ 2 – Thứ 7: 8:00 – 18:00</span>
            </li>
          </ul>
        </div>
      </div>
    </div>

    <!-- Bottom bar -->
    <div class="border-t border-sand py-5">
      <div class="max-w-7xl mx-auto px-5 lg:px-10 flex flex-col md:flex-row items-center justify-between gap-3 text-xs text-text-muted">
        <p>© 2026 Nội Thất Minh Hiếu – MiHi Furniture. All rights reserved.</p>
        <div class="flex items-center gap-4">
          <a href="#" class="hover:text-espresso transition-colors">Điều khoản dịch vụ</a>
          <span class="text-sand">|</span>
          <a href="#" class="hover:text-espresso transition-colors">Chính sách bảo mật</a>
        </div>
      </div>
    </div>
  </div>

  <!-- Floating Zalo -->
  <a href="https://zalo.me/0986267941" target="_blank" rel="noopener"
     class="float-zalo" aria-label="Chat Zalo">
    <svg width="22" height="22" viewBox="0 0 48 48" fill="none">
      <path d="M24 4C13 4 4 12.06 4 22c0 5.5 2.74 10.42 7.08 13.78L9 44l9.16-2.84C19.97 41.7 21.94 42 24 42c11 0 20-8.06 20-18S35 4 24 4z" fill="#fff"/>
      <text x="13" y="30" font-size="16" font-weight="bold" fill="#0068FF" font-family="Arial">Z</text>
    </svg>
  </a>
</footer>

<script>
  /* --- Sticky nav shadow --- */
  const nav = document.getElementById('mainNav');
  window.addEventListener('scroll', () => {
    nav?.classList.toggle('shadow-md', window.scrollY > 8);
  }, { passive: true });

  /* --- Mobile drawer --- */
  const overlay   = document.getElementById('mobileOverlay');
  const drawer    = document.getElementById('mobileDrawer');
  const btnOpen   = document.getElementById('mobileMenuBtn');
  const btnClose  = document.getElementById('mobileMenuClose');

  function openDrawer()  { drawer.classList.remove('-translate-x-full'); overlay.classList.remove('hidden'); document.body.style.overflow='hidden'; }
  function closeDrawer() { drawer.classList.add('-translate-x-full');    overlay.classList.add('hidden');    document.body.style.overflow=''; }

  btnOpen?.addEventListener('click', openDrawer);
  btnClose?.addEventListener('click', closeDrawer);
  overlay?.addEventListener('click', closeDrawer);

  /* --- Search bar toggle --- */
  const searchBar   = document.getElementById('searchBar');
  const searchToggle= document.getElementById('searchToggle');
  const searchClose = document.getElementById('searchClose');

  searchToggle?.addEventListener('click', () => {
    searchBar.classList.toggle('hidden');
    if (!searchBar.classList.contains('hidden')) searchBar.querySelector('input')?.focus();
  });
  searchClose?.addEventListener('click', () => searchBar.classList.add('hidden'));

  /* --- Flash auto-dismiss --- */
  setTimeout(() => {
    document.querySelectorAll('.flash-message').forEach(el => {
      el.style.transition = 'opacity .4s';
      el.style.opacity = '0';
      setTimeout(() => el.remove(), 400);
    });
  }, 4000);

  /* --- Active nav highlight --- */
  const path = window.location.pathname;
  document.querySelectorAll('.mihi-nav-link').forEach(a => {
    if (a.getAttribute('href') === path || (path.startsWith(a.getAttribute('href')) && a.getAttribute('href') !== '/')) {
      a.classList.add('active');
    }
  });
</script>

</body>
</html>
