@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

/* ========================================================
   CHUẨN FONT TIẾNG VIỆT & CHỐNG TRÀN NGANG (TOÀN TRANG)
   ======================================================== */
html,
body {
  font-family: 'Be Vietnam Pro', 'Segoe UI', Tahoma, Arial, sans-serif !important;
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

button,
input,
select,
textarea,
h1, h2, h3, h4, h5, h6,
.btn,
.tab-head button,
.detail-title,
.detail-price,
.site-search input,
.field,
.card,
.wrap {
  font-family: 'Be Vietnam Pro', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Ẩn khối giá thanh ghim đáy trên desktop (>650px) tránh hiện đúp cạnh nút Mua ngay */
.buy-row-price {
  display: none;
}

/* ========================================================
   MOBILE CỬA HÀNG & TÀI KHOẢN (ĐÃ CÓ TRƯỚC)
   ======================================================== */
/* Argon Medium: mobile Cửa hàng; scope grid rules to this layout. */
@media (max-width: 600px) {
  .shop-layout { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .shop-layout > * { min-width: 0; }
  .shop-layout .shop-sort { flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
  .shop-layout .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
  .shop-layout .products-grid > * { min-width: 0; overflow-wrap: anywhere; }
}

/* Argon Medium: mobile Tài khoản. */
@media (max-width: 600px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .account-layout,
  .account-layout :is(.account-side,.account-main,.account-person,.account-links,.profile-banner,.quick-actions,.quick-box,.personal-table),
  .account-layout :is(.account-side,.account-main,.account-person,.account-links,.profile-banner,.quick-actions,.quick-box,.personal-table) > * {
    min-width: 0; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere;
  }
  .account-layout .profile-banner { flex-direction: column; align-items: stretch; }
  .account-layout :is(.profile-banner,.account-person,.account-links,.quick-box) { flex-wrap: wrap; }
  .account-layout .quick-actions { grid-template-columns: minmax(0, 1fr); }
  .account-layout :is(a,button,input,select,textarea,th,td) {
    min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere;
  }
}

/* ========================================================
   NÂNG CẤP TRẢI NGHIỆM TRANG CHI TIẾT SẢN PHẨM TRÊN MOBILE
   (ĐẶC BIỆT KHỔ 390PX SMARTPHONE TIÊU CHUẨN)
   ======================================================== */
@media (max-width: 650px) {
  /* 1. Bố cục 1 cột, khoảng cách 16px */
  .detail-top {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* 2. Gallery ảnh: Thumbnail xếp ngang bên dưới ảnh chính, cuộn mượt */
  .detail-gallery {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .detail-gallery .thumbs {
    order: 2 !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 4px 2px !important;
    scrollbar-width: thin;
    width: 100% !important;
    min-width: 0 !important;
  }

  .detail-gallery .thumbs::-webkit-scrollbar {
    height: 4px;
  }

  .detail-gallery .thumbs button {
    flex: 0 0 64px !important;
    width: 64px !important;
    height: 64px !important;
    border-radius: 10px !important;
    border: 2px solid #dce8cf !important;
    background: #f5f8ec !important;
    padding: 4px !important;
    overflow: hidden !important;
    cursor: pointer;
    touch-action: manipulation;
  }

  .detail-gallery .thumbs button.selected {
    border-color: #f58a00 !important;
    box-shadow: 0 0 0 2px rgba(245, 138, 0, 0.35) !important;
  }

  .detail-gallery .thumbs img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  /* 3. Ảnh chính vừa vặn màn hình điện thoại (khoảng 280px - 320px) */
  .detail-mainimg {
    order: 1 !important;
    height: 295px !important;
    max-height: 310px !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px !important;
    padding: 14px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: radial-gradient(circle at 70% 10%, #d7eecb, #fbf5e3 70%) !important;
  }

  .detail-mainimg img {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }

  /* 4. Tiêu đề rõ ràng cỡ chữ 20px - 22px */
  .detail-title {
    font-size: 21px !important;
    line-height: 1.3 !important;
    margin: 10px 0 8px !important;
    color: #054c2d !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* 5. Giá 24px - 26px màu cam nổi bật, độ đậm chuẩn 700 */
  .detail-price {
    font-size: 25px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    color: #df5a14 !important;
    margin: 10px 0 !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Selector giới hạn: Mặc định không hiện nhãn */
  .detail-price::after {
    content: none !important;
  }

  /* Chỉ hiện nhãn "Giá niêm yết Huna's Home" khi sản phẩm có giá niêm yết mở bán hợp lệ (.btn-orange) */
  .detail-top:has(.buy-row .btn-orange) .detail-price::after {
    content: "Giá niêm yết Huna's Home" !important;
    font-size: 11.5px;
    font-weight: 600;
    color: #2e6644;
    background: #ebf5e7;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #c9dfbf;
    white-space: nowrap;
  }

  /* 6. Benefit tiles 4 cột mini gọn gàng hoặc 2 cột, chữ dễ đọc */
  .benefit-tiles {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    padding: 10px 4px !important;
    border-radius: 12px !important;
    background: #fbf5e6 !important;
    margin: 12px 0 !important;
  }

  .benefit-tiles div {
    text-align: center !important;
    color: #0f6735 !important;
    font-size: 10.5px !important;
    line-height: 1.25 !important;
    padding: 2px 1px !important;
    border-right: 1px solid #ded6bf !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .benefit-tiles div:last-child {
    border-right: 0 !important;
  }

  .benefit-tiles .svg-icon {
    width: 22px !important;
    height: 22px !important;
    margin: 0 auto 4px !important;
  }

  /* 7. Sticky Bottom Bar: Chốt đơn cố định ở đáy màn hình điện thoại (Gọn gàng 1 hàng, nowrap) */
  .buy-row {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99 !important;
    background: #ffffff !important;
    border-top: 1px solid #e1e7d8 !important;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08) !important;
    padding: 8px 8px !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Bỏ hoàn toàn ::before cũ để dùng trực tiếp .buy-row-price */
  .buy-row::before {
    display: none !important;
    content: none !important;
  }

  /* Khối giá vắn tắt trong thanh ghim đáy */
  .buy-row-price {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    line-height: 1.15 !important;
    min-width: 0 !important;
    padding-right: 2px !important;
  }

  .buy-row-price small {
    font-size: 9.5px !important;
    color: #486350 !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }

  .buy-row-price b {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #df5a14 !important;
    white-space: nowrap !important;
  }

  /* Nút bấm chuẩn Apple HIG: chiều cao tối thiểu 44px, độ đậm tối đa 700 */
  .buy-row .btn {
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    touch-action: manipulation;
    white-space: nowrap !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .buy-row .btn-orange {
    flex: 1.15 1 auto !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
  }

  .buy-row button.btn-soft {
    flex: 1 1 auto !important;
    padding: 0 6px !important;
  }

  .buy-row a.btn-soft {
    flex: 0 0 auto !important;
    padding: 0 6px !important;
    font-size: 10.5px !important;
  }

  .buy-row .btn[disabled] {
    flex: 1 1 auto !important;
    font-size: 11px !important;
    padding: 0 6px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .buy-row .svg-icon {
    width: 15px !important;
    height: 15px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  /* Đệm khoảng trống đáy trang (76px - 80px) để thanh đáy không che nội dung */
  body:has(.buy-row),
  #app:has(.buy-row),
  .page:has(.detail-top),
  .page-detail-wrap {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .detail-top ~ .desc-tabs {
    margin-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body {
    padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
  }
}

/* Tinh chỉnh riêng cho màn hình hẹp 360px - 380px: Đảm bảo 100% không rớt dòng */
@media (max-width: 380px) {
  .buy-row {
    padding: 7px 6px !important;
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 3px !important;
  }

  .buy-row-price small {
    display: none !important;
  }

  .buy-row-price b {
    font-size: 12.5px !important;
  }

  .buy-row .btn {
    padding: 0 5px !important;
    font-size: 11px !important;
  }

  .buy-row a.btn-soft {
    font-size: 10px !important;
    padding: 0 4px !important;
  }

  .buy-row .svg-icon {
    display: none !important;
  }

  .benefit-tiles {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .benefit-tiles div {
    border-right: none !important;
    border-bottom: 1px solid #ded6bf !important;
    padding: 4px !important;
  }

  .benefit-tiles div:nth-child(3),
  .benefit-tiles div:nth-child(4) {
    border-bottom: none !important;
  }
}

/* ========================================================
   ĐỌC DỄ TRÊN ĐIỆN THOẠI (≤ 600px) — bản 18/11/2026
   Mục tiêu: 1 cột, chữ ≥ 12px (nội dung 13–15px), nút ≥ 44px,
   không chồng chữ lên ảnh, không cắt chữ ở khối banner.
   ======================================================== */
/* Lỗi gốc: .fallback-card {display:flex} đè thuộc tính hidden → ô dự phòng hiện chồng lên ảnh thật */
[hidden] { display: none !important; }

@media (max-width: 600px) {
  body { font-size: 15px; line-height: 1.55; }

  /* Danh mục: chữ đủ đọc */
  .category-grid > * small,
  .category-grid > * span:not([data-icon]),
  .category-grid a, .category-grid button { font-size: 12px !important; line-height: 1.3; }

  /* Lưới sản phẩm: 1 cột, thẻ nằm ngang (ảnh trái, chữ phải) */
  .products-grid,
  .shop-layout .products-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }

  .products-grid .product-card {
    display: grid !important;
    grid-template-columns: 112px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    padding: 10px;
    position: relative;
    min-width: 0;
  }
  .products-grid .product-card > a:first-child { display: block; min-width: 0; }
  .products-grid .product-image {
    width: 112px; height: 112px; aspect-ratio: 1 / 1;
    border-radius: 12px; overflow: hidden; position: relative;
    display: flex; align-items: center; justify-content: center;
  }
  .products-grid .product-image img {
    width: 100% !important; height: 100% !important; max-width: 100% !important;
    object-fit: contain; display: block;
  }
  /* Ô dự phòng khi ảnh chưa có: nằm gọn trong ô, chữ xuống dòng, không tràn */
  .products-grid .fallback-card {
    position: static !important; width: 100%; height: 100%; padding: 6px;
    box-sizing: border-box; text-align: center; gap: 4px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    overflow-wrap: anywhere;
  }
  .products-grid .fallback-card b { font-size: 11.5px; line-height: 1.3; font-weight: 600; }
  .products-grid .fallback-card span { font-size: 22px; }
  .products-grid .product-flag {
    position: absolute; left: 6px; top: 6px; font-size: 11px; padding: 2px 7px; border-radius: 999px;
  }
  .products-grid .favorite { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; }

  .products-grid .product-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 0 28px 0 0; }
  .products-grid .supplier { font-size: 11px; letter-spacing: .2px; }
  .products-grid .product-name { font-size: 16px; line-height: 1.3; font-weight: 700; }
  .products-grid .product-desc {
    font-size: 13px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .products-grid .product-price { font-size: 18px; font-weight: 700; }
  .products-grid .product-price small { font-size: 12px; font-weight: 500; }
  .products-grid .product-copy .btn {
    min-height: 44px; font-size: 14px; width: 100%; justify-content: center;
  }

  /* Banner Trang chủ: xếp dọc, ảnh nằm dưới chữ, không đè chữ */
  .promo-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .promo-banner {
    display: flex !important; flex-direction: column !important; align-items: flex-start;
    height: auto !important; min-height: 0 !important; padding: 18px 16px 0 !important; overflow: hidden;
  }
  .promo-banner h3 { font-size: 19px; line-height: 1.3; margin: 0 0 8px; max-width: 100%; overflow-wrap: anywhere; }
  .promo-banner p { font-size: 14px; max-width: 100%; margin: 0 0 12px; }
  .promo-banner .btn { min-height: 44px; font-size: 14px; }
  .promo-banner img {
    position: static !important; width: calc(100% + 32px) !important; max-width: none !important;
    height: 150px !important; object-fit: cover; margin: 14px -16px 0 !important; display: block;
  }

  /* Khối giới thiệu thương hiệu */
  .brand-ribbon { grid-template-columns: minmax(0, 1fr) !important; }
  .brand-ribbon > img { width: 100% !important; height: 170px !important; object-fit: cover; }
  .brand-copy { padding: 18px 16px !important; }
  .brand-copy h2 { font-size: 22px; line-height: 1.3; }
  .brand-copy p { font-size: 14.5px; }
  .brand-copy .btn { min-height: 44px; font-size: 14px; }

  /* Nút bấm chung đủ cao để chạm */
  .btn { min-height: 44px; }

  /* Các dòng chữ nhỏ còn lại không dưới 12px */
  .pill, .tag, small { font-size: 12px; }
}
/* --- Vòng 2: cỡ chữ tối thiểu, khối Liên hệ, thanh tin cậy, bước thanh toán --- */
@media (max-width: 600px) {
  .contact-hero { grid-template-columns: minmax(0, 1fr) !important; }
  .contact-hero > * { min-width: 0; max-width: 100%; }
  .contact-hero h1 { font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
  .contact-hero p { overflow-wrap: anywhere; }
  .contact-hero .row { flex-wrap: wrap; gap: 8px; }
  .contact-hero img { width: 100%; height: auto; object-fit: cover; }

  .trustitem strong { font-size: 13px; line-height: 1.3; }
  .trustitem span { font-size: 12px; line-height: 1.4; }

  .steps .step { font-size: 12px; line-height: 1.3; }
  .footer-bottom span, .hero-family small { font-size: 12px; }
  .products-grid .supplier, .products-grid .product-flag,
  .products-grid .fallback-card b { font-size: 12px; }
}
@media (max-width: 380px) {
  .buy-row .btn, .buy-row a.btn-soft { font-size: 12px !important; padding: 0 7px !important; }
  .buy-row .btn[disabled] { font-size: 12px !important; }
}
/* ========================================================
   ĐẶC ĐIỂM SẢN PHẨM & PHÙ HỢP VỚI AI (18/11/2026)
   ======================================================== */
.info-box { background: #f6faef; border: 1px solid #dce8cf; border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.info-box > strong { display: block; color: #075e37; font-size: 15px; margin-bottom: 8px; }
.info-box .checklist-mini { margin: 0 0 8px; padding-left: 18px; font-size: 14px; line-height: 1.65; }
.info-link { color: #08623b; font-weight: 600; font-size: 14px; text-decoration: underline; }
.info-note { background: #fff7e6; border: 1px solid #eedcb5; border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: 13.5px; line-height: 1.7; }
@media (max-width: 600px) {
  .info-box { padding: 12px 14px; }
  .info-box .checklist-mini li { margin-bottom: 4px; }
  .info-note { font-size: 13px; }
}