/* ==========================================================================
   Xanh Tara brand overrides on top of Ochaka styles.css
   - Đổi màu chủ đạo qua biến --primary (chuẩn CSS của mẫu)
   - Muốn đổi theme nhanh: thay class primary-* ở <body> (primary, primary-2..6)
   - Font giữ stack của mẫu + fallback hệ thống (hỗ trợ tiếng Việt)
   ========================================================================== */
:root {
  --primary: #FF6D3A;
  --bg-10: #FF6D3A12;
}

body {
  font-family: "Afacad", "BT-BeauSans", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.tp-ff-heading {
  font-family: "Sora", "BT-BeauSans", -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Logo Xanh Tara trong header mẫu */
.logo-site img {
  max-height: 44px;
  width: auto;
}

/* Ảnh sản phẩm/bài viết: cover đồng đều */
.card-product .product-img img,
.product-img img {
  object-fit: cover;
}

/* Page title lồng trong layout row phải full-bleed như mẫu */
.layout-row .s-page-title,
.layout-row .page-title-blog {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  max-width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
}
/* Page title gọn: mẫu desktop padding 111+110px quá cao, trang chi tiết thành dải trống */
.layout-row .s-page-title {
  padding: 40px 0;
}
/* Menu 1 dòng (label tiếng Việt dài): không wrap, co gap + cỡ chữ ở desktop */
@media (min-width: 1200px) {
  .box-nav-menu {
    gap: 20px;
    flex-wrap: nowrap;
  }
  .box-nav-menu .menu-item {
    white-space: nowrap;
  }
  .box-nav-menu .item-link {
    font-size: 16px;
    gap: 6px;
  }
}
@media (min-width: 1400px) {
  .box-nav-menu {
    gap: 28px;
  }
  .box-nav-menu .item-link {
    font-size: 17px;
  }
}
html, body {
  overflow-x: clip;
}

/* Giỏ hàng mini dùng chung */
.mz-cart-count-text,
.cart-count-text,
.cart-count-menu {
  font-variant-numeric: tabular-nums;
}

/* Drawer giỏ hàng: chuỗi flex/grid cần min-height:0 để vùng scroll
   (absolute) không co về 0 — khớp cấu trúc HTML mẫu */
.popup-shopping-cart .canvas-wrapper {
  min-height: 0;
}
.popup-shopping-cart .canvas-wrapper > .wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#mz-mini-cart-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.popup-shopping-cart .tf-mini-cart-wrap {
  flex: 1 1 auto;
  min-height: 0;
}
.popup-shopping-cart .tf-mini-cart-main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

/* Stepper số lượng riêng (tránh đụng JS mẫu) */
.mz-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.mz-qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.mz-qty-input {
  width: 56px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
}
.wg-quantity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Gallery thumbs trang chi tiết */
.tf-gallery-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
}
.tf-gallery-thumb.active {
  border-color: var(--primary);
}
.tf-gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

/* Card SP grid mẫu: không có nút sẵn, hover mới hiện */
.card-product.grid .card-product_info .tf-btn {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
.card-product.grid:hover .card-product_info .tf-btn {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Article row: khung ảnh đều nhau, không thò thụt (đúng cấu trúc mẫu:
   a.entry_image flex-1 trực tiếp, không bọc .blog-image) */
.article-blog.style-row > .entry_image {
  overflow: hidden;
  min-width: 0;
}
.article-blog.style-row > .entry_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sort dropdown tự đóng/mở (không phụ thuộc plugin Bootstrap) */
.tf-control-sorting .tf-dropdown-sort {
  position: relative;
}
.tf-control-sorting .tf-dropdown-sort .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
}
.tf-control-sorting .tf-dropdown-sort.show .dropdown-menu {
  display: block;
}

/* Sort dropdown dùng link (giữ param, reset về trang 1) thay vì div+JS mẫu */
.tf-dropdown-sort a.select-item {
  display: block;
}

/* Quick view: #mz-quickview-wrap là con trực tiếp của .modal-content (flex),
   nên nó phải là flex-row để media (45%) + info (55%) nằm cạnh nhau như mẫu.
   Không có rule này, 2 khối sẽ xếp chồng dọc (xuống hàng). */
.modal-quick-view .modal-content > #mz-quickview-wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  min-width: 0;
}
@media (min-width: 768px) {
  .modal-quick-view .modal-content > #mz-quickview-wrap {
    flex-direction: row;
    align-items: flex-start;
  }
}
.modal-quick-view .tf-single-slide .single-slide-prev,
.modal-quick-view .tf-single-slide .single-slide-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line, #e9e9e9);
  color: var(--black, #111);
  cursor: pointer;
  transition: all 0.3s ease;
}
.modal-quick-view .tf-single-slide .single-slide-prev { left: 12px; }
.modal-quick-view .tf-single-slide .single-slide-next { right: 12px; }
.modal-quick-view .tf-single-slide .single-slide-prev:hover,
.modal-quick-view .tf-single-slide .single-slide-next:hover {
  background: var(--black, #111);
  color: var(--white, #fff);
}
.modal-quick-view .tf-single-slide .single-slide-prev.swiper-button-disabled,
.modal-quick-view .tf-single-slide .single-slide-next.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Quick view: thông tin không tràn màn hình khi summary dài */
.modal-quick-view .tf-product-info-inner {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
@media (min-width: 768px) {
  .modal-quick-view .tf-product-info-inner {
    max-height: 640px;
  }
}
