/*
Theme Name: NamMinhChau Child
Template: Nam Minh Chau - Enhanced
Version: 1.0.1
*/
/* =========================
   NamMinhChau Child - Product Grid (Fixed: always 2 cols on mobile)
   ========================= */

/* Layout container */
.shop-container { padding: 30px 0 60px; background:#fafafa; }
.wrap { max-width:1180px; margin:0 auto; padding:0 20px; box-sizing:border-box; }
.breadcrumb-wrap { margin-bottom:14px; color:#6b7b86; font-size:13px; }

/* Category pills */
.category-pills-wrap { background:#fff; border-radius:8px; padding:18px; margin-bottom:22px; box-shadow:0 2px 0 rgba(0,0,0,0.03); }
.category-pills-wrap h3 { color:#0f67a3; display:inline-block; margin-right:12px; font-size:18px; }
.category-pills-wrap .pills { display:inline-flex; gap:12px; flex-wrap:wrap; vertical-align:middle; }
.category-pills-wrap .pill { background:#f6f6f6; padding:10px 14px; border-radius:16px; color:#333; font-size:14px; border:1px solid #eee; box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); text-decoration:none; }

/* Title */
.shop-category-header { margin:18px 0 8px; }
.shop-category-title { font-size:28px; color:#0b67a6; letter-spacing:0.6px; margin:0 0 14px; position:relative; padding-bottom:12px; }
.shop-category-title:after { content:""; display:block; height:3px; width:100%; background:linear-gradient(90deg,#0b67a6 20%,rgba(11,103,166,0.08) 100%); margin-top:8px; border-radius:0 0 40px 40px; }

/* Toolbar */
.shop-toolbar { display:flex; justify-content:space-between; align-items:center; margin:12px 0 24px; gap:12px; flex-wrap:wrap; }
.toolbar-left { color:#4a4a4a; font-size:14px; display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.toolbar-left label { display:inline-flex; gap:6px; align-items:center; color:#666; font-weight:400; }
.toolbar-left .hot-deal { color:#f26a14; font-weight:600; }
.toolbar-right { display:flex; gap:12px; align-items:center; }

/* -------------------------
   Product grid (single source of truth)
   ------------------------- */
.woocommerce ul.products,
ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Reset legacy floats/widths from theme/classes/inline styles */
.woocommerce ul.products li.product,
ul.products li.product {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  float: none !important;
  clear: none !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 10px 20px rgba(13,40,72,0.03);
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}
.woocommerce ul.products li.product[style] { width: auto !important; } /* kill inline widths */
.woocommerce.columns-4 ul.products li.product,
.woocommerce.columns-3 ul.products li.product,
.woocommerce.columns-2 ul.products li.product { width:auto !important; }

/* Inner structure (equal height) */
.woocommerce ul.products li.product .card-inner,
.product-card .card-inner {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  justify-content: space-between;
  box-sizing: border-box;
}

/* Thumb */
.card-thumb { position: relative; padding: 22px 18px 6px; text-align: center; background: #fff; border-top-left-radius:10px; border-top-right-radius:10px; }
.card-thumb img { width: 100%; max-width: 220px; height: 220px; object-fit: contain; display: inline-block; margin: 0 auto; border-radius:6px; }

/* Badges */
.badge-new { position: absolute; left: 18px; top: 18px; background: #ff9f3b; color: #fff; padding: 6px 8px; border-radius: 20px; font-weight:700; font-size:12px; box-shadow:0 3px 8px rgba(0,0,0,0.08); }
.badge-sale { position:absolute; left:18px; top:56px; background:#ef3a3a; color:#fff; padding:6px 10px; border-radius:14px; font-size:13px; box-shadow:0 3px 8px rgba(0,0,0,0.08); display:inline-flex; gap:8px; align-items:center; }

/* Body */
.card-body { padding:10px 18px 18px; display:flex; flex-direction:column; gap:8px; align-items:stretch; }
.product-title, .woocommerce-loop-product__title { text-align:center; font-size:16px; font-weight:600; margin:6px 0; color:#333; word-break:break-word; }

/* Mini gallery + price + actions */
.mini-gallery { display:flex; gap:8px; justify-content:center; align-items:center; margin-bottom:6px; }
.mini-thumb img { width:36px; height:36px; border-radius:50%; object-fit:cover; border:1px solid #eee; }
.card-price { text-align:center; color:#0a78b8; font-size:16px; margin-top:6px; }
.card-price del { color:#999; margin-left:10px; }
.card-actions { text-align:center; margin-top:8px; }
.card-actions .button { background:#f0eff3; border-radius:6px; padding:8px 12px; color:#333; border:0; cursor:pointer; display:inline-block; }

/* Footer separator */
.product-card .thumb-sep { height:36px; background:#e9eef2; margin:8px 12px 0; border-radius:4px; }

/* Hover */
.woocommerce ul.products li.product:hover { transform: translateY(-6px); transition: all .25s ease; box-shadow: 0 14px 28px rgba(0,0,0,.07); }

/* Images */
.woocommerce ul.products li.product img,
ul.products li.product img {
  width: 100%;
  height: auto !important;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* Buttons */
.woocommerce ul.products li.product .button,
ul.products li.product .button {
  margin-top: 10px;
  display: inline-block;
  visibility: visible;
  opacity: 1;
}

/* Single product layout (clean) */
.single-product .site-content,
.single-product .container { max-width:1150px; margin:0 auto; padding:30px 20px; box-sizing:border-box; }
.single-product .product { display:flex; gap:48px; align-items:flex-start; flex-wrap:wrap; }
.single-product .woocommerce-product-gallery { flex: 0 0 46%; max-width:46%; box-sizing:border-box; }
.single-product .summary { flex: 0 0 48%; max-width:48%; box-sizing:border-box; padding-top:6px; }
.woocommerce-product-gallery__image img,
.single-product .woocommerce-product-gallery img { width:100% !important; height:auto !important; object-fit:contain; aspect-ratio:1/1; max-height:620px; border-radius:6px; background:#fff; display:block; }

/* Tabs and details */
.woocommerce-tabs { clear: both; margin-top:28px; border-top:1px solid #e6e6e6; padding-top:18px; }
.woocommerce-Tabs-panel { padding:12px 0 28px; line-height:1.6; color:#333; }

/* Badge on single product */
.single-product .onsale,
.single-product .badge { position:absolute; left:12px; top:12px; z-index:5; font-weight:700; padding:6px 10px; border-radius:20px; background:#cfa800; color:#fff; box-shadow:0 6px 18px rgba(0,0,0,0.08); }

/* -------------------------
   RESPONSIVE
   ------------------------- */
@media (max-width:1100px) {
  .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .card-thumb img { max-width: 200px; height: 200px; }
}

@media (max-width:900px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0,1fr)); gap:18px; }
  .card-thumb img { max-width: 180px; height: 180px; }
  .single-product .product { gap:28px; }
}

/* Mobile: ALWAYS 2 columns (fix) */
@media (max-width:768px) {
  .woocommerce ul.products,
  .products,
  .product-grid,
  .woocommerce .products,
  .product-list,
  .list-product,
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 12px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
  }

  .woocommerce ul.products li.product,
  .products .product,
  .product-grid .product-item,
  .product .product-box {
    width: 100% !important;
    margin: 0 !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }

  /* Thumbnails in product gallery */
  .woocommerce-product-gallery__wrapper .flex-control-nav li { width: 56px; height:56px; }

  /* Keep all add-to-cart visible */
  .woocommerce ul.products li.product .button,
  .woocommerce ul.products li.product a.add_to_cart_button,
  .woocommerce ul.products li.product .add_to_cart_button,
  .woocommerce a.add_to_cart_button,
  .woocommerce button.single_add_to_cart_button,
  .product .product-buttons,
  .product .product-action {
    display: inline-block !important;
    visibility: visible !important;
    height: auto !important;
    margin: 6px 0 !important;
    padding: 8px 10px !important;
  }

  header .custom-logo-link img, .site-logo img { max-width:170px !important; height:auto !important; }
}

/* Very small screens — vẫn giữ 2 cột (CHỈNH SỬA QUAN TRỌNG) */
@media (max-width:480px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap:10px !important;
    padding-left:10px !important;
    padding-right:10px !important;
  }
  .single-product .product { display:block; }
  .single-product .woocommerce-product-gallery__image img { max-height:520px; }
  .single-product .product_title { font-size:22px; }
  .single-product .single_add_to_cart_button { width:100%; text-align:center; padding:12px; display:block; box-sizing:border-box; }
}
/* ẨN NÚT THÊM VÀO GIỎ HÀNG TRÊN TOÀN BỘ TRANG DANH MỤC */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.add_to_cart_button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce a.add_to_cart_button,
.product .product-buttons,
.product .product-action,
.card-actions {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Giữ khoảng cách giữa các phần không bị hụt */
.woocommerce ul.products li.product .card-body {
  padding-bottom: 12px !important;
}
/* == FIX 1: Card cân đối, chiều cao đồng đều == */

/* Vùng ảnh: khung vuông, không méo, không thay đổi chiều cao giữa các card */
.woocommerce ul.products li.product .card-thumb {
  position: relative;
  padding: 12px 12px 0 !important;
}
.woocommerce ul.products li.product .card-thumb .thumb-wrap,
.woocommerce ul.products li.product .product-thumbnail,
.woocommerce ul.products li.product a img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;         /* khung vuông để mọi card cao bằng nhau */
  object-fit: contain !important;
  height: auto !important;
  max-height: none !important;
  border-radius: 8px;
  background: #fff;
}

/* Tiêu đề: khóa 2 dòng để không kéo card quá cao */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .product-title {
  font-size: 14px !important;
  line-height: 1.3 !important;
  margin: 6px 8px 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.3em * 2); /* đảm bảo mọi card có cùng chiều cao tiêu đề */
  text-align: center;
}

/* Thân card gọn hơn */
.woocommerce ul.products li.product .card-body {
  padding: 8px 10px 10px !important;
  gap: 6px !important;
}
.woocommerce ul.products { gap: 10px !important; } /* giảm khoảng cách giữa các card */

/* == FIX 2: Badge/Tem giảm giá nhỏ lại & chuyển góc phải, không che ảnh == */

/* "NEW" giữ góc trái nhỏ gọn */
.woocommerce ul.products li.product .badge-new,
.badge-new {
  left: 10px !important; top: 10px !important;
  font-size: 11px !important; padding: 4px 8px !important; border-radius: 999px !important;
  z-index: 2; pointer-events: none;
}

/* Tem giảm giá chuyển sang góc phải, thu nhỏ để không che ảnh */
.woocommerce ul.products li.product .badge-sale,
.badge-sale,
.woocommerce ul.products li.product .onsale {
  right: 10px !important; left: auto !important; top: 10px !important;
  font-size: 11px !important; padding: 4px 8px !important; border-radius: 999px !important;
  z-index: 2; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 60%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Đảm bảo badge nằm trong vùng ảnh để không đè nội dung bên dưới */
.woocommerce ul.products li.product .card-thumb .badge-sale,
.woocommerce ul.products li.product .card-thumb .badge-new,
.woocommerce ul.products li.product .card-thumb .onsale {
  position: absolute !important;
}

/* Mobile tinh chỉnh thêm */
@media (max-width: 480px) {
  .woocommerce ul.products { gap: 8px !important; }
  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce ul.products li.product .product-title { font-size: 13px !important; }
  .woocommerce ul.products li.product .badge-sale,
  .woocommerce ul.products li.product .onsale { font-size: 10px !important; padding: 3px 7px !important; }
  .woocommerce ul.products li.product .badge-new { font-size: 10px !important; padding: 3px 7px !important; }
}
/* === COMPACT MOBILE PRODUCT CARD (fix height) === */
@media (max-width:768px){
  /* Bỏ chiều cao ép cứng của card */
  .woocommerce ul.products li.product .card-inner,
  .product-card .card-inner{
    min-height: auto !important;
  }

  /* Thu nhỏ padding & bo góc */
  .woocommerce ul.products li.product{
    padding: 8px 8px 10px !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 14px rgba(0,0,0,0.03) !important;
  }

  /* Giảm khoảng cách giữa các card */
  .woocommerce ul.products{ gap: 8px !important; }

  /* Ảnh: cố định CHIỀU CAO để mọi card thấp và đều nhau */
  .woocommerce ul.products li.product .card-thumb{
    padding: 8px 8px 0 !important;
  }
  .woocommerce ul.products li.product .card-thumb .thumb-wrap,
  .woocommerce ul.products li.product .product-thumbnail,
  .woocommerce ul.products li.product a img{
    width: 100% !important;
    height: 160px !important;        /* <-- chỉnh 150–170 tùy thích */
    object-fit: contain !important;  /* không cắt mất sản phẩm */
    aspect-ratio: auto !important;
    border-radius: 10px !important;
    background: #fff;
  }

  /* Tiêu đề gọn – khóa 2 dòng */
  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce ul.products li.product .product-title{
    font-size: 13px !important;
    line-height: 1.25 !important;
    margin: 6px 6px 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.25em * 2);
    text-align: center;
  }

  /* Ẩn mini-gallery nếu không cần để card ngắn hơn (bật lại nếu muốn) */
  .woocommerce ul.products li.product .mini-gallery{ display:none !important; }

  /* Giá gọn */
  .woocommerce ul.products li.product .card-price{
    font-size: 14px !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
  }
}

/* === Tem giảm giá: nhỏ & góc phải, không che ảnh === */
.woocommerce ul.products li.product .badge-sale,
.badge-sale,
.woocommerce ul.products li.product .onsale{
  position: absolute !important;
  top: 10px !important;
  right: 10px !important; left: auto !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  max-width: 60%;
  display:inline-flex; align-items:center; gap:6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  z-index: 2; pointer-events:none;
}
.woocommerce ul.products li.product .badge-new,
.badge-new{
  position:absolute !important;
  top: 10px !important; left: 10px !important;
  font-size: 11px !important; padding: 4px 8px !important;
  border-radius: 999px !important; z-index:2; pointer-events:none;
}
/* Ẩn input số lượng mặc định (ô nhỏ bên nút Thêm vào giỏ hàng) */
.single-product form.cart .quantity {
  display: none !important;
}

/* Chỉnh margin cho nút thêm giỏ hàng cho đẹp */
.single-product form.cart button.single_add_to_cart_button {
  margin-left: 0 !important;
}

/* Khung giống Tin tức */
.nmc-box.nmc-related-section {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    margin: 28px 0;
    border: 1px solid #f0f0f0;
}

/* Tiêu đề */
.nmc-box-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 14px 6px;
}

/* Lưới sản phẩm tương tự */
.nmc-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-items: start;
}

/* Item */
.nmc-related-item {
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.nmc-related-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 8px;
    border-radius: 8px;
    transition: transform .12s ease, box-shadow .12s ease;
}

.nmc-related-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.nmc-related-thumb {
    width: 100%;
    padding-top: 100%; /* tỉ lệ vuông */
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #f6f6f6;
}
.nmc-related-thumb img,
.nmc-related-thumb .attachment-woocommerce_thumbnail {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;   /* quan trọng: giữ crop đẹp */
    transform: translate(-50%, -50%);
}
-----------------------------------------------------------------------------------------
/* Giới thiệu Nam Minh Châu */
.intro-section {
  background: #fff;
  padding: 60px 0;
}

.intro-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

/* Hình ảnh bên trái */
.intro-left {
  flex: 1;
  text-align: center;
}
.intro-image img {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

/* Nội dung bên phải */
.intro-right {
  flex: 1;
  color: #1a1a1a;
}
.intro-title {
  color: #0056b3;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}
.intro-right p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
  color: #333;
}

/* Nút hotline */
.btn-hotline {
  display: inline-block;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  transition: background 0.3s ease;
}
.btn-hotline:hover {
  background: #084298;
}

/* Responsive */
@media (max-width: 768px) {
  .intro-container {
    flex-direction: column;
    text-align: center;
  }
  .intro-right {
    margin-top: 20px;
  }
  .intro-image img {
    max-width: 320px;
  }
}

/* ---------- Floating contact buttons ---------- */
.floating-contact {
  position: fixed;
  right: 18px;
  top: 65%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  pointer-events: none; /* allow individual buttons to control pointer-events */
}

/* common style for each button */
.floating-contact .fc-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #003A6E; /* màu viền giống ảnh */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  transition: transform .14s ease, box-shadow .14s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* hover / active */
.floating-contact .fc-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 18px rgba(0,0,0,0.12);
}

/* messenger icon background keep circular blue fill inside SVG already */
.floating-contact .fc-messenger svg { display:block; }

/* Zalo mark: white background, blue border - show text inside */
.floating-contact .fc-zalo .zalo-mark {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #003A6E;
  font-size: 13px;
}

/* phone icon: svg visible */
.floating-contact .fc-phone svg { display:block; }

/* top button: black square with up arrow (like mẫu) */
.floating-contact .fc-top {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #000;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
  cursor: pointer;
}

/* top arrow white; remove blue border for the top button */
.floating-contact .fc-top svg { display:block; }

/* Hide on small screens if desired */
@media (max-width: 760px) {
  .floating-contact { right: 10px; top: auto; bottom: 90px; transform:none; }
  /* If you want to hide entirely on mobile, uncomment next line */
  /* .floating-contact { display: none; } */
}
/* =========================
   OVERRIDES (refined) — kéo chữ & ảnh thật gọn
   Replace previous overrides with this block
   ========================= */

/* Tháo min-height cứng, căn nội dung lên trên, giảm khoảng trống */
.woocommerce ul.products li.product,
ul.products li.product {
  padding: 6px 8px !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 18px rgba(13,40,72,0.03) !important;
}

.woocommerce ul.products li.product .card-inner,
.product-card .card-inner {
  min-height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important; /* căn lên trên, tránh khoảng trắng dưới */
  align-items: stretch !important;
  gap: 6px !important;
  padding-bottom: 8px !important;
}

/* Thumb: giảm padding, thu ảnh nhỏ lại, margin-bottom nhỏ */
.woocommerce ul.products li.product .card-thumb,
.product-card .card-thumb {
  padding: 8px 10px 6px !important;
  background: transparent !important;
}

.woocommerce ul.products li.product .card-thumb img,
.woocommerce ul.products li.product .card-thumb .thumb-wrap,
.woocommerce ul.products li.product .product-thumbnail,
ul.products li.product img {
  display: block !important;
  margin: 0 auto 6px !important;
  width: auto !important;
  max-width: 160px !important;   /* nhỏ lại để không tạo khoảng trắng bên */
  height: 160px !important;      /* cố định chiều cao để hàng đều */
  object-fit: contain !important;
  border-radius: 6px !important;
  background: #fff !important;
}

/* Tiêu đề: rất sát ảnh, ít margin, 2 dòng max */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .product-title {
  margin: 4px 8px 2px !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1.15 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-align: center !important;
  color: #3b3b6f !important;
}

/* Giá: kéo sát tiêu đề, thu nhỏ khoảng cách */
.woocommerce ul.products li.product .card-price,
.woocommerce ul.products li.product .price {
  margin-top: 4px !important;
  margin-bottom: 6px !important;
  font-size: 14px !important;
  text-align: center !important;
  color: #0a78b8 !important;
}

/* Mini-gallery: ẩn trên mobile, rút gọn trên desktop */
.woocommerce ul.products li.product .mini-gallery,
ul.products li.product .mini-gallery {
  margin: 4px 0 6px !important;
  gap: 6px !important;
  justify-content: center !important;
}
.woocommerce ul.products li.product .mini-thumb img,
ul.products li.product .mini-thumb img {
  width: 34px !important;
  height: 34px !important;
  margin: 0 6px 0 0 !important;
  border-radius: 6px !important;
}

/* Card body padding gọn */
.woocommerce ul.products li.product .card-body,
.product-card .card-body {
  padding: 6px 10px 8px !important;
  gap: 6px !important;
}

/* Giảm khoảng cách giữa các card (grid gap) */
.woocommerce ul.products,
ul.products {
  gap: 14px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Badge: giữ nhỏ, không đẩy nội dung */
.woocommerce ul.products li.product .badge-new,
.woocommerce ul.products li.product .badge-sale,
.woocommerce ul.products li.product .onsale {
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  font-size: 11px !important;
  padding: 3px 7px !important;
  z-index: 5 !important;
}

/* Trước/sa sau: tránh khoảng trắng trên cùng của vùng shop */
.shop-container { padding-top: 18px !important; }

/* Mobile tweaks: ép gọn hơn */
@media (max-width: 768px) {
  .woocommerce ul.products { gap: 8px !important; }
  .woocommerce ul.products li.product .card-thumb img,
  .woocommerce ul.products li.product .card-thumb .thumb-wrap,
  .woocommerce ul.products li.product a img {
    max-width: 140px !important;
    height: 140px !important;
  }
  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce ul.products li.product .product-title {
    font-size: 13px !important;
    line-height: 1.15 !important;
    margin: 4px 6px 2px !important;
  }
  .woocommerce ul.products li.product .mini-gallery { display: none !important; }
}

/* Nếu theme vẫn ghi đè: bật các rule này để ép */
.woocommerce ul.products li.product .card-thumb img,
.woocommerce ul.products li.product .card-body,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .card-price {
  -webkit-font-smoothing: antialiased !important;
}
/* =========================
   Cân đối badge: NEW trái, Giảm/onsale phải, không chồng lấn
   Dán vào cuối Additional CSS hoặc style.css child
   ========================= */

/* 1) Reset transform / overlay gây to */
.woocommerce ul.products li.product .card-thumb * {
  transform: none !important;
  -webkit-transform: none !important;
  transition: none !important;
}

/* 2) Quy chuẩn chung cho badge trong vùng .card-thumb */
.woocommerce ul.products li.product .card-thumb [class*="badge"],
.woocommerce ul.products li.product .card-thumb [class*="onsale"],
.woocommerce ul.products li.product .card-thumb [class*="sale"],
.woocommerce ul.products li.product .card-thumb [class*="new"],
.woocommerce ul.products li.product .card-thumb [class*="hot"],
.woocommerce ul.products li.product .card-thumb [class*="flame"],
.woocommerce ul.products li.product .card-thumb [class*="overlay"],
.woocommerce ul.products li.product .card-thumb .badge,
.card-thumb .badge,
.card-thumb .onsale,
.card-thumb .badge-sale,
.card-thumb .badge-new {
  position: absolute !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  max-width: 64px !important;
  max-height: 36px !important;
  height: auto !important;
  width: auto !important;
  border-radius: 999px !important;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08) !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  z-index: 60 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  pointer-events: none !important;
  transform: none !important;
}

/* 3) Đặt badge 'new' (class chứa new) vào trái trên, badge giảm/onsale vào phải trên */
.woocommerce ul.products li.product .card-thumb [class*="new"],
.woocommerce ul.products li.product .card-thumb .badge-new,
.card-thumb .badge-new {
  left: 8px !important;
  right: auto !important;
  top: 8px !important;
  z-index: 65 !important;
}

/* sale / giảm / onsale phải trên */
.woocommerce ul.products li.product .card-thumb [class*="sale"],
.woocommerce ul.products li.product .card-thumb [class*="onsale"],
.woocommerce ul.products li.product .card-thumb .badge-sale,
.card-thumb .badge-sale,
.card-thumb .onsale {
  right: 8px !important;
  left: auto !important;
  top: 8px !important;
  z-index: 66 !important;
}

/* 4) Nếu còn overlay "hot/flame" hoặc icon khác -> thu nhỏ và đặt phía dưới badge đầu tiên */
.woocommerce ul.products li.product .card-thumb [class*="flame"],
.woocommerce ul.products li.product .card-thumb [class*="fire"],
.woocommerce ul.products li.product .card-thumb [class*="hot"],
.card-thumb [class*="flame"],
.card-thumb [class*="fire"],
.card-thumb [class*="hot"]*]()

.nmc-home-cats {
    padding: 40px 0;
    text-align: center;
}
.nmc-home-cats .nmc-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
}
.nmc-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.nmc-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    border: 1px solid #eee;
    transition: transform .18s ease, box-shadow .18s ease;
}
.nmc-cat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.nmc-cat-item img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}
.nmc-cat-item span {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}
@media(max-width:1024px){
    .nmc-cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media(max-width:768px){
    .nmc-cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media(max-width:420px){
    .nmc-cat-grid { grid-template-columns: 1fr; }
}
.nmc-category-block { margin: 40px auto; max-width:1200px; padding:0 15px; }
.nmc-category-block .nmc-category-inner { }
.nmc-category-block .nmc-title { font-size:26px; font-weight:700; margin-bottom:18px; text-align:center; }
.nmc-product-grid { display:grid; grid-template-columns: repeat(4,1fr); gap:20px; }
.nmc-item { display:block; text-decoration:none; background:#fff; border:1px solid #eee; border-radius:10px; padding:12px; transition:transform .18s, box-shadow .18s; color:inherit; }
.nmc-item:hover { transform:translateY(-6px); box-shadow:0 10px 30px rgba(0,0,0,0.07); }
.nmc-item .img-wrap img { width:100%; height:220px; object-fit:cover; border-radius:8px; display:block; }
.nmc-item .name { display:block; margin-top:10px; font-size:15px; color:#222; font-weight:600; }
.nmc-item .price { display:block; margin-top:6px; color:#0a63d1; font-weight:700; }
.nmc-block-footer { margin-top:14px; text-align:center; }
.nmc-view-all { display:inline-block; padding:8px 14px; border-radius:6px; background:#0a63d1; color:#fff; text-decoration:none; }
.nmc-no-products { text-align:center; color:#666; padding:18px 0; }

@media (max-width:1024px){ .nmc-product-grid { grid-template-columns:repeat(3,1fr); } }
@media (max-width:768px){ .nmc-product-grid { grid-template-columns:repeat(2,1fr); } .nmc-item .img-wrap img { height:160px; } }
@media (max-width:480px){ .nmc-product-grid { grid-template-columns:1fr; } .nmc-item .img-wrap img { height:180px; } }
.nmc-title {
    text-align: center;
    width: 100%;
    display: block;
}

/* ==== SECTION BALO – GRID 3x2 TONE SÁNG ==== */
.section-balo-home.section-balo-grid {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1400px;
    margin: 50px auto;
    padding: 40px 30px;
    background: #f5fbff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.section-balo-grid .balo-left {
    flex: 1.4;
}

.section-balo-grid .balo-right {
    flex: 1;
    max-width: 420px;
}

.section-balo-grid .balo-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.section-balo-grid .balo-right {
    align-self: stretch;  /* cho cột banner cao bằng cột sản phẩm */
}


/* Tiêu đề */
.balo-subtitle{
    font-family: 'Dancing Script', cursive, system-ui;
    color:#f08c8c;
    font-size:22px;
    margin-bottom:4px;
}

.balo-title{
    font-size:32px;
    font-weight:800;
    color:#1a4fa3;
    letter-spacing:2px;
    margin-bottom:24px;
    text-transform:uppercase;
}

/* Lưới sản phẩm 3x2 */
.balo-grid{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap:20px;
}

.balo-item{
    text-align:center;
    background:#ffffff;
    border-radius:14px;
    padding:12px 10px 16px;
    box-shadow:0 6px 18px rgba(0,0,0,0.05);
}

.balo-item img{
    width:100%;
    height:auto;
    margin-bottom:8px;
}

.sale-tag{
    background:#ff4747;
    color:#fff;
    padding:3px 10px;
    border-radius:999px;
    font-size:11px;
    font-weight:600;
    display:inline-block;
    margin-bottom:6px;
}

.item-title{
    font-size:14px;
    margin:6px 0;
    font-weight:600;
    color:#333;
}

.item-variant{
    font-size:12px;
    color:#888;
    margin-bottom:4px;
}

.price{
    font-size:14px;
    font-weight:700;
    color:#1a4fa3;
    margin:0;
}

.price del{
    color:#999;
    font-weight:400;
    margin-left:6px;
    font-size:12px;
}

/* Responsive */
@media (max-width: 1024px){
    .section-balo-home.section-balo-grid{
        flex-direction:column;
    }
    .section-balo-grid .balo-right{
        max-width:100%;
    }
    .balo-grid{
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px){
    .section-balo-home.section-balo-grid{
        padding:24px 16px;
    }
    .balo-grid{
        grid-template-columns: repeat(1, 1fr);
    }
    .balo-title, .balo-subtitle{
        text-align:center;
    }
}

/* Hover cho card balo 3x2 */
.balo-item{
    transition: transform .25s ease, box-shadow .25s ease;
}

.balo-item .balo-thumb img{
    transition: transform .3s ease;
}

.balo-item:hover{
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.balo-item:hover .balo-thumb img{
    transform: scale(1.04);
}
/* Hover cho các sản phẩm trong grid chung trên trang chủ */
.nmc-product-grid .nmc-item{
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.nmc-product-grid .nmc-item .img-wrap img{
    transition: transform .3s ease;
}

.nmc-product-grid .nmc-item:hover{
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.nmc-product-grid .nmc-item:hover .img-wrap img{
    transform: scale(1.04);
}

/* ===== SẢN PHẨM TƯƠNG TỰ – GRID 3 SẢN PHẨM / 1 HÀNG ===== */

/* Danh sách sản phẩm tương tự */
.nmc-related ul.products {
    list-style: none;
    margin: 10px 0 0 !important;
    padding: 0 10px 20px !important;

    /* dùng GRID để bắt buộc 3 cột */
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 18px;
}

/* Mỗi sản phẩm trong block này */
.nmc-related ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    box-sizing: border-box;

    background: #fff;
    border-radius: 16px;
    padding: 12px 10px 10px;
    text-align: center;

    display: flex !important;
    flex-direction: column;
    align-items: center;

    box-shadow: 0 3px 10px rgba(0,0,0,.06);
    overflow: hidden;                /* ảnh không tràn ra ngoài card */
    transition: transform .2s ease, box-shadow .2s ease;
}
.nmc-related ul.products li.product:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 16px rgba(0,0,0,.09);
}

/* Link bao toàn bộ */
.nmc-related ul.products li.product > a {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-decoration: none;
}

/* Khung ảnh */
.nmc-related .related-thumb {
    width: 100%;
    max-width: 220px;
    margin: 0 auto 8px;
}

/* Ảnh nằm gọn trong card */
.nmc-related .related-thumb img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 12px;
}

/* Tiêu đề */
.nmc-related .woocommerce-loop-product__title {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    margin: 6px 0 4px;
    min-height: 40px;
}

/* Giá */
.nmc-related .price {
    font-size: 14px;
    font-weight: 700;
    margin-top: 2px;
}

/* ===== RESPONSIVE ===== */
/* Tablet / mobile lớn: 2 sản phẩm 1 hàng */
@media (max-width: 991px) {
    .nmc-related ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Điện thoại nhỏ: 1 sản phẩm 1 hàng */
@media (max-width: 575px) {
    .nmc-related ul.products {
        grid-template-columns: 1fr;
    }
}

/* ===== MOBILE: DANH MỤC SẢN PHẨM = 2 CỘT ===== */
@media (max-width: 767px) {

    /* áp cho TRANG CHỦ + TRANG DANH MỤC + SHOP PAGE */
    .home ul.products,
    .woocommerce.archive ul.products,
    .tax-product_cat ul.products,
    .woocommerce-page ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* 2 sản phẩm / hàng */
        gap: 14px !important;
        padding: 0 10px !important;
    }

    .home ul.products li.product,
    .woocommerce.archive ul.products li.product,
    .tax-product_cat ul.products li.product,
    .woocommerce-page ul.products li.product {
        width: 100% !important; /* để GRID quản lý cột — không bị float phá layout */
        margin: 0 !important;
        float: none !important;
    }
}
/* MOBILE: lưới sản phẩm BALO trên trang chủ = 2 cột */
@media (max-width: 768px) {
    .section-balo-grid .balo-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important; /* 2 sản phẩm / hàng */
        gap: 16px !important;
    }
}
/* cuộn mượt khi dùng anchor # */
html {
    scroll-behavior: smooth;
}

/* Cụm floating contact */
.floating-contact {
    position: fixed;
    right: 14px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
}

.floating-contact .fc-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border: none;
    cursor: pointer;
}

/* nút lên đầu trang */
.floating-contact .fc-top {
    background: #000;
    color: #fff;
}
/* Danh mục pills: wrapper không chặn click bên dưới */
.nmc-category-pills-wrap {
  position: relative;
  z-index: 2;          /* vừa đủ, không che menu / sản phẩm */
  pointer-events: none;
}

.nmc-category-pills-wrap a,
.nmc-category-pills-wrap .nmc-cat-pill {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  touch-action: manipulation !important;
}
/* Chỉ trên màn nhỏ (mobile) mới chặn click menu khi ẩn */
@media (max-width: 768px) {
  .main-nav {
      pointer-events: none;
  }
  .main-nav.active {
      pointer-events: auto;
  }
}
/* Thu hẹp khoảng cách menu – căn đều và kéo sát thanh tìm kiếm */
@media (min-width:1024px){
    .main-header {
        justify-content: flex-start !important;
        gap: 25px !important; /* có thể giảm xuống 15 nếu muốn sát hơn */
    }

    .header-center {
        flex-grow: 1;
        max-width: 480px; /* thu gọn chiều dài input */
    }

    .main-nav {
        margin-left: 10px !important; /* giá trị quan trọng để kéo menu lại gần */
    }

    .main-nav > ul > li > a {
        padding: 0 10px !important; /* giảm khoảng giữa các mục menu */
    }
}


