/* Bổ sung nhỏ ngoài CSS gốc (uikit.min.css, ec.min.css, library.css, style.css,
   style_search.css) đã copy nguyên vẹn từ themes/echula/css/ — KHÔNG ghi đè style gốc. */

.breadcrumb { padding: 8px 0; font-size: 13px; color: #888; }
.breadcrumb ol { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.breadcrumb a { color: #888; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Ép style rõ ràng cho nút báo giá — không phụ thuộc cascade .uk-button-primary
   (có thể bị CSS cũ ghi đè mất màu nền ở 1 số ngữ cảnh). */
.btn-quote { display: inline-block; margin: 16px 0; padding: 8px 20px; background: #1e87f0; color: #fff !important; border-radius: 3px; text-decoration: none; font-size: 14px; }
.btn-quote:hover { background: #0e6dcd; }

/* Khu vực thuộc tính/cam kết trên trang sản phẩm — bỏ nền/viền ngoài ý muốn, giữ layout gọn như bản gốc */
.overview { background: none; border: none; padding: 0; }
.overview .attribute, .overview .commitment { background: none; border: none; }
.overview .uk-list { margin: 0; padding: 0; list-style: none; }
.overview .attribute li { margin-bottom: 4px; font-size: 13px; }
.overview .attribute .label { font-weight: bold; margin-right: 4px; }
.overview .commitment li { margin-bottom: 4px; font-size: 13px; color: #2ecc71; }
.overview .commitment i { margin-right: 6px; }

/* Khối Hotline — thiết kế dạng thẻ nổi bật, số điện thoại là link bấm gọi ngay (tối ưu mobile/CTR) */
.fami-hotline-block { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
@media (max-width: 480px) { .fami-hotline-block { grid-template-columns: 1fr; } }
.fami-hotline-card { border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.fami-hotline-card__header { background: linear-gradient(135deg, #1e87f0, #0e6dcd); color: #fff; font-weight: bold; font-size: 13px; padding: 8px 12px; text-transform: uppercase; letter-spacing: .3px; }
.fami-hotline-card__header i { margin-right: 6px; }
.fami-hotline-card__number { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 15px; font-weight: 600; color: #222; text-decoration: none; border-top: 1px solid #f2f2f2; transition: background .15s ease, color .15s ease; }
.fami-hotline-card__number:hover { background: #eef6ff; color: #1e87f0; }
.fami-hotline-card__number i { color: #2ecc71; font-size: 15px; flex: 0 0 auto; }

/* Đánh giá sản phẩm */
.fami-reviews { margin-top: 8px; }
.fami-review-list { list-style: none; margin: 12px 0; padding: 0; }
.fami-review-item { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.fami-review-item__stars { color: #f5a623; letter-spacing: 2px; }
.fami-review-item__author { font-weight: bold; font-size: 13px; margin: 2px 0; }
.fami-review-item__author span { font-weight: normal; color: #999; margin-left: 6px; }
.fami-review-item__content { font-size: 14px; color: #444; }

.fami-review-form { margin-top: 16px; }
.fami-review-form textarea, .fami-review-form input[type="text"], .fami-review-form input[type="email"] { border: 1px solid #ddd; border-radius: 3px; padding: 8px 10px; font-size: 14px; }
.fami-review-form__stars { margin-bottom: 14px; }
.fami-review-form__stars label { display: block; font-size: 13px; margin-bottom: 4px; color: #666; }
.fami-star-picker { font-size: 26px; letter-spacing: 4px; cursor: pointer; }
.fami-star { color: #ddd; transition: color .1s ease; }
.fami-star.is-active { color: #f5a623; }

.fami-captcha { margin: 4px 0 10px; }
.fami-captcha label { display: block; font-size: 13px; margin-bottom: 4px; color: #666; }
.fami-captcha__input { width: 100px; }
.fami-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Ngăn cách nội dung chính và footer — áp dụng đồng bộ mọi trang (footer.php dùng chung) */
.site-main { display: block; padding-bottom: 40px; }
.fami-footer-wrap {
  position: relative;
  margin-top: 24px;
  padding-top: 32px;
  background: #f7f8fa;
  border-top: 3px solid #1e87f0;
}
.fami-footer-wrap::before {
  content: "";
  position: absolute;
  top: -3px; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e87f0, #e53333);
}
.fami-footer-wrap .uk-panel-title { color: #222; }
.fami-footer-wrap .contact a, .fami-footer-wrap .uk-list a { color: #444; }

/* Khối tiêu đề + đánh giá + giá trên trang sản phẩm — tinh chỉnh đẹp hơn bản gốc */
.fami-rating-summary { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: 13px; }
.fami-rating-summary__stars { color: #f5a623; letter-spacing: 2px; font-size: 15px; }
.fami-rating-summary a { color: #888; text-decoration: none; }
.fami-rating-summary a:hover { color: #1e87f0; text-decoration: underline; }

.fami-price-box { background: #fff7f7; border: 1px solid #ffe1e1; border-radius: 6px; padding: 12px 16px; margin: 14px 0; }
.fami-price-box__market { font-size: 13px; color: #999; }
.fami-price-box__market del { color: #999; }
.fami-price-box__sale { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.fami-price-box__sale .sale { font-size: 26px; font-weight: bold; color: #e53333; }
.fami-price-box__sale small { color: #999; font-size: 12px; }
.fami-price-box__badge { background: #e53333; color: #fff; font-size: 11px; font-weight: bold; padding: 2px 8px; border-radius: 10px; }

/* Widget "Hàng mới nhất" — lưới 2 cột gọn cho sidebar, đẹp hơn bản gốc (lưới 4 cột chật, không giá) */
.fami-latest-products { margin-top: 16px; }
.fami-latest-products__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fami-latest-products__item {
  display: flex; flex-direction: column; text-decoration: none; color: #333;
  border: 1px solid #eee; border-radius: 6px; padding: 8px; background: #fff;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.fami-latest-products__item:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,.08); border-color: #1e87f0; }
.fami-latest-products__thumb { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 4px; margin-bottom: 6px; background: #f7f7f7; }
.fami-latest-products__thumb img { width: 100%; height: 100%; object-fit: cover; }
.fami-latest-products__name { font-size: 12.5px; line-height: 1.35; height: 2.7em; overflow: hidden; margin-bottom: 4px; }
.fami-latest-products__price { font-size: 13px; font-weight: bold; color: #e53333; margin-top: auto; }

/* Khối tiêu đề trang danh mục — thiết kế lại thay cho danh sách "/" phẳng lặng lẽ */
.fami-category-hero {
  background: linear-gradient(135deg, #f7fafd, #fff);
  border: 1px solid #eaeef2;
  border-left: 4px solid #1e87f0;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 16px 0 24px;
}
.fami-category-hero__title { margin: 0 0 14px; font-size: 24px; font-weight: 700; color: #1a1a1a; text-transform: uppercase; }
.fami-category-hero__siblings { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fami-category-chip {
  display: inline-block; padding: 6px 14px; font-size: 13px; border-radius: 20px;
  background: #fff; border: 1px solid #dde3ea; color: #555; text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.fami-category-chip:hover { border-color: #1e87f0; color: #1e87f0; }
.fami-category-chip.is-current { background: #1e87f0; border-color: #1e87f0; color: #fff; font-weight: 600; }
.fami-category-hero__intro { font-size: 14px; line-height: 1.7; color: #444; border-top: 1px dashed #e0e6ec; padding-top: 14px; }
.fami-category-hero__intro p:first-child { margin-top: 0; }
.fami-category-hero__intro p:last-child { margin-bottom: 0; }

/* Fallback ảnh bài viết khi không có ảnh đại diện (255/306 bài gốc vốn không có) */
.fami-thumb-img { width: 100%; height: auto; display: block; }
.fami-thumb-img--placeholder { object-fit: contain; background: #f7f7f7; padding: 20%; box-sizing: border-box; opacity: .6; }

/* Danh sách bài viết dạng hàng ngang (trang danh mục bài viết) */
.fami-article-list { display: flex; flex-direction: column; gap: 18px; }
.fami-article-row { display: flex; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid #f0f0f0; }
.fami-article-row__thumb { flex: 0 0 180px; width: 180px; height: 130px; overflow: hidden; border-radius: 4px; background: #f7f7f7; }
.fami-article-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.fami-article-row__body { flex: 1 1 auto; min-width: 0; }
.fami-article-row__title { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }
.fami-article-row__title a { color: #222; text-decoration: none; }
.fami-article-row__title a:hover { color: #1e87f0; }
.fami-article-row__date { font-size: 12.5px; color: #999; margin-bottom: 8px; }
.fami-article-row__date i { margin-right: 4px; }
.fami-article-row__excerpt { font-size: 14px; color: #555; line-height: 1.6; margin: 0 0 6px; }
.fami-article-row__more { font-size: 13px; color: #1e87f0; text-decoration: none; font-weight: 600; }
.fami-article-row__more i { margin-left: 3px; }
.fami-article-row__more:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .fami-article-row { flex-direction: column; }
  .fami-article-row__thumb { width: 100%; height: 180px; }
}

/* Phân trang — dạng ô vuông đánh số, trang hiện tại tô nổi bật */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 24px 0; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 6px;
  border: 1px solid #e0e0e0; border-radius: 4px;
  background: #fff; color: #1e87f0; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background .15s ease, border-color .15s ease;
}
.pagination .page-numbers:hover { border-color: #1e87f0; background: #eef6ff; }
.pagination .page-numbers.current { background: #2ecc71; border-color: #2ecc71; color: #fff; }
.pagination .page-numbers.dots { border: none; background: none; color: #aaa; }
.pagination .page-numbers.next, .pagination .page-numbers.prev { color: #555; font-weight: bold; }

.form-success { color: #2ecc71; }
.form-error { color: #e74c3c; }

.product-specs table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.product-specs td, .product-specs th { border: 1px solid #eee; padding: 6px 10px; }

.category-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 10px; border: 1px solid #ddd; border-radius: 3px; font-size: 13px; text-decoration: none; color: #333; }

/* Slideshow trang chủ — tự viết (không phụ thuộc UIkit JS cũ), crop bằng object-fit qua background-size.
   width:100vw + margin-left:-50vw = kỹ thuật "full-bleed" để tràn đúng hết chiều ngang viewport,
   không phụ thuộc padding/margin của các thẻ cha (tránh lệch trái/phải do CSS cũ). */
html { overflow-x: hidden; }
.fami-slideshow { position: relative; width: 100vw; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; height: 460px; max-height: 46vw; overflow: hidden; background: #eee; }
.fami-slide { position: absolute; inset: 0; background-position: center; background-size: cover; background-repeat: no-repeat; opacity: 0; transition: opacity .6s ease; }
.fami-slide.is-active { opacity: 1; }
.fami-slideshow__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.fami-slideshow__dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; background: rgba(255,255,255,.5); padding: 0; cursor: pointer; }
.fami-slideshow__dot.is-active { background: #fff; }
@media (max-width: 640px) { .fami-slideshow { height: 220px; max-height: none; } }

/* Search-suggest — .ket_qua_search (container) đã có CSS gốc trong library.css,
   phần dưới đây chỉ style nội dung bên trong (chưa có sẵn trong CSS cũ đã copy). */
.ket_qua_search { border: 1px solid #eee; box-shadow: 0 4px 10px rgba(0,0,0,.08); max-height: 420px; overflow-y: auto; }
.fami-search-results { list-style: none; margin: 0; padding: 0; }
.fami-search-item a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-decoration: none; border-bottom: 1px solid #f2f2f2; color: #333; }
.fami-search-item a:hover { background: #f7f7f7; }
.fami-search-item img { width: 48px; height: 48px; object-fit: cover; flex: 0 0 auto; }
.fami-search-item__name { flex: 1 1 auto; font-size: 13px; }
.fami-search-item__price { color: #e53333; font-weight: bold; font-size: 13px; white-space: nowrap; }
.fami-search-footer { padding: 8px 12px; font-size: 13px; text-align: right; background: #fafafa; }
.fami-search-empty { padding: 12px; font-size: 13px; color: #888; }

/* Gallery ảnh trang chi tiết sản phẩm */
.product-gallery { border: none; background: none; box-shadow: none; padding: 0; }
.product-gallery .main-image { display: block; cursor: zoom-in; border: 1px solid #eee; }
.product-gallery .main-image img { width: 100%; height: auto; }
.gallery-thumbs { list-style: none; margin: 8px 0 0; padding: 0; }
.gallery-thumbs .thumb { display: block; border: 1px solid #eee; cursor: pointer; }
.gallery-thumbs .thumb img { width: 100%; height: auto; display: block; }
.gallery-thumbs .thumb.is-active { border-color: #1e87f0; }

.fami-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 9999; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.fami-lightbox img { max-width: 90vw; max-height: 90vh; }
.fami-lightbox__close { position: absolute; top: 16px; right: 24px; color: #fff; font-size: 32px; line-height: 1; cursor: pointer; }

/* Sidebar "Sản phẩm cùng danh mục" — dạng list gọn (thumb nhỏ + text bên cạnh), giống bản gốc */
.lazyaside .product-catalogue > ul { list-style: none; margin: 0; padding: 0; }
.lazyaside .product-catalogue .product { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.lazyaside .product-catalogue .thumb { flex: 0 0 64px; width: 64px; }
.lazyaside .product-catalogue .thumb img { width: 64px; height: 64px; object-fit: cover; }
.lazyaside .product-catalogue .body { flex: 1 1 auto; min-width: 0; }
.lazyaside .product-catalogue .title { font-size: 13px; line-height: 1.4; margin-bottom: 2px; }
.lazyaside .product-catalogue .price .sale { font-size: 13px; }
