/* =========================================================================
   site-optimize.css
   - Chống layout shift (CLS): chừa sẵn khung ảnh theo đúng tỉ lệ ảnh thật.
   - Skeleton: nền xám nhấp nháy hiện trong lúc ảnh CHƯA tải xong.
   Nạp SAU style.css để ghi đè. Ảnh nằm ĐÈ LÊN lớp skeleton (z-index cao hơn)
   nên khi ảnh tải xong nó tự che skeleton — kể cả JS lỗi, ảnh vẫn hiện bình
   thường, giao diện cuối cùng KHÔNG đổi.
   Kích thước ảnh thật: SP 400x400 (1:1), blog 400x300 (4:3),
   banner 900x292 (~3:1), slide 1902x693.
   ========================================================================= */

/* --- 1. Chừa khung theo tỉ lệ → trình duyệt không "nhảy" khi ảnh tải --- */
.product__thumb .product-image,
.features-product-image        { aspect-ratio: 1 / 1; }
.single-smblog .blog-image     { aspect-ratio: 4 / 3; }
.banner__img                   { aspect-ratio: 900 / 292; }
.hero-slider .swiper-slide img { aspect-ratio: 1902 / 693; }

/* Ảnh phủ kín khung (ảnh vốn đúng tỉ lệ nên KHÔNG méo/cắt) */
.product__thumb .product-image img,
.features-product-image img,
.single-smblog .blog-image img,
.banner__img img { width: 100%; height: 100%; object-fit: cover; }

/* --- 2. Skeleton shimmer (chỉ cho ảnh chụp: SP / blog / banner) --- */
.product__thumb .product-image,
.features-product-image,
.single-smblog .blog-image,
.banner__img { position: relative; overflow: hidden; background-color: #eeeeee; }

.product__thumb .product-image::before,
.features-product-image::before,
.single-smblog .blog-image::before,
.banner__img::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background: linear-gradient(90deg, #ececec 25%, #f6f6f6 37%, #ececec 63%);
    background-size: 400% 100%;
    animation: site-skel 1.4s ease infinite;
}

/* Ảnh luôn nằm trên skeleton */
.product__thumb .product-image img,
.features-product-image img,
.single-smblog .blog-image img,
.banner__img img { position: relative; z-index: 1; }

/* Khi ảnh đã tải xong → tắt hiệu ứng cho đỡ tốn CPU */
.is-loaded::before { display: none; }
.is-loaded { background-color: transparent; }

@keyframes site-skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* --- 3. Hero slider (Swiper, hiệu ứng SLIDE) --------------------------------
   Bỏ âm lề -15px của theme (slider ở <main> không có container padding → tràn
   ngang 30px khiến header lệch). Slider vốn full-width nên margin 0 là đúng.
   Swiper tự clip slide (overflow hidden) nên KHÔNG bị "giật xếp chồng" như slippry. */
.slider-area { background-color: #eceff3; margin-left: 0 !important; margin-right: 0 !important; overflow: hidden; }
.hero-slider { position: relative; overflow: hidden; }
.hero-slider .swiper-slide { }
.hero-slider .swiper-slide a { display: block; }
.hero-slider .swiper-slide img,
.hero-slider .swiper-slide picture { display: block; width: 100%; height: auto; }
/* Trước khi Swiper init: chừa đúng khung tỉ lệ (chống CLS), chỉ hiện slide đầu.
   LƯU Ý: Swiper 6 thêm class `swiper-container-initialized` (KHÔNG phải swiper-initialized). */
.hero-slider:not(.swiper-container-initialized) .swiper-wrapper { display: block; }
.hero-slider:not(.swiper-container-initialized) .swiper-slide + .swiper-slide { display: none; }

/* Nút điều hướng */
.hero-slider__nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
    width: 42px; height: 42px; border: none; border-radius: 50%;
    background: rgba(255,255,255,.85); color: #c63437; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.14); transition: background .18s, color .18s, opacity .18s;
    opacity: 0;
}
.hero-slider:hover .hero-slider__nav { opacity: 1; }
.hero-slider__nav:hover { background: #c63437; color: #fff; }
.hero-slider__nav svg { width: 22px; height: 22px; display: block; }
.hero-slider__prev { left: 16px; }
.hero-slider__next { right: 16px; }
.hero-slider__nav.swiper-button-disabled { opacity: 0; }
@media (max-width: 767px) { .hero-slider__nav { display: none; } }

/* Pagination dots */
.hero-slider__pagination { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 6; text-align: center; }
.hero-slider__pagination .swiper-pagination-bullet {
    width: 9px; height: 9px; background: #fff; opacity: .65; margin: 0 4px !important; transition: opacity .18s, width .18s;
}
.hero-slider__pagination .swiper-pagination-bullet-active { opacity: 1; width: 22px; border-radius: 5px; background: #c63437; }

/* Category slider (Quà tặng Hải Phòng): bỏ shadow khi hover, GIỮ hiệu ứng nâng.
   .category-slider có overflow:hidden (Swiper) → card nâng translateY(-3px) bị cắt
   mép trên. Chừa đệm trên bằng padding-top + margin-top âm bù lại (vị trí card KHÔNG
   đổi, nhưng vùng overflow rộng thêm 12px phía trên → không còn cắt bo góc). */
.category-slider { padding-top: 12px; margin-top: -12px; }
.category-slider .menu-bg-item:hover { box-shadow: none; }

/* --- Nhịp khoảng cách giữa các section trang chủ (chống dính) ---------------
   Category không có padding-bottom + .cat-block đầu không margin-top → dính.
   pagination bị khoá khi đủ item nên KHÔNG dựa vào mb-30 của nó nữa. */
/* Nhịp đều 45px: category-product-area ↔ cat-block ↔ cat-block ↔ section kế */
.category-product-area { padding-top: 45px; padding-bottom: 45px; }
.cat-block:last-child { margin-bottom: 45px; }

/* --- 4. Breadcrumb: ép kiểu "Viết Hoa Chữ Cái Đầu" -----------------------------
   text-transform:capitalize KHÔNG hạ được chữ HOA có sẵn (vd "CÔNG TY" giữ nguyên).
   Kèm JS hạ toàn bộ về chữ thường (xem _Layout) → capitalize mới ép được ALL-CAPS. */
.title__breadcrumb .breadcrumb-item,
.title__breadcrumb .breadcrumb-item a,
.title__breadcrumb .breadcrumb-item span,
.title__breadcrumb .breadcrumb-item h1 { text-transform: capitalize; }

/* =========================================================================
   5. POPUP TÌM KIẾM (autocomplete) — port UI demo Zendecor.
   Overlay giữa màn hình + gợi ý sản phẩm (ảnh · danh mục · tên · giá).
   Biến demo (--orange/--text-dark…) thay bằng giá trị cụ thể của site.
   ========================================================================= */
.search-popup {
    position: fixed; inset: 0; z-index: 2100;
    display: flex; align-items: flex-start; justify-content: center;
    /* Bù chiều rộng scrollbar (biến --sbw do JS đặt) → panel KHÔNG lệch khi ẩn thanh cuộn */
    padding: 8vh calc(20px + var(--sbw, 0px)) 20px 20px; pointer-events: none;
}
.search-popup-bd {
    position: absolute; inset: 0;
    background: rgba(9,21,32,.72);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; transition: opacity .25s ease;
}
.search-popup.is-open { pointer-events: auto; }
.search-popup.is-open .search-popup-bd { opacity: 1; }

.search-popup-panel {
    position: relative; z-index: 1;
    width: min(740px, 100%); background: #fff;
    border-radius: 14px; overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,.22);
    transform: translateY(-18px) scale(.97); opacity: 0;
    transition: transform .32s cubic-bezier(.34,1.3,.64,1), opacity .22s ease;
    pointer-events: none;
}
.search-popup.is-open .search-popup-panel { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

.search-popup-form {
    display: flex; align-items: center; gap: 10px;
    padding: 0 18px; height: 62px; border-bottom: 1px solid #f0ede8;
}
.search-popup-icon { flex-shrink: 0; color: #e60000; }
.search-popup-input {
    flex: 1; border: none; outline: none;
    font-size: 16px; color: #212529; caret-color: #212529; background: transparent; padding: 0;
}
.search-popup-input::placeholder { color: #bbb; }
.search-popup-clear {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; border: none;
    background: #ede9e3; color: #777; cursor: pointer; flex-shrink: 0;
    transition: background .15s, color .15s;
}
.search-popup-clear:hover { background: #e0dbd4; color: #333; }
.search-popup-sep { width: 1px; height: 20px; background: #e8e4de; flex-shrink: 0; }
.search-popup-close {
    display: flex; align-items: center; gap: 4px; border: none; background: transparent;
    color: #aaa; cursor: pointer; font-size: 10px; font-weight: 600; letter-spacing: .07em;
    padding: 6px 8px; border-radius: 6px; flex-shrink: 0; text-transform: uppercase;
    transition: color .15s, background .15s;
}
.search-popup-close:hover { color: #1c1c1c; background: #f5f2ef; }

.search-popup-results {
    max-height: min(64vh, 520px); overflow-y: auto;
    padding: 16px 20px 22px; overscroll-behavior: contain;
}
.search-popup-loading {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 36px 0; color: #777; font-size: 15px;
}
.search-popup-spinner {
    display: inline-block; flex-shrink: 0; width: 18px; height: 18px;
    border: 2px solid rgba(224,133,26,.2); border-top-color: #e0851a;
    border-radius: 50%; animation: spSpin .7s linear infinite;
}
@keyframes spSpin { to { transform: rotate(360deg); } }
.search-popup-empty { padding: 36px 0; text-align: center; color: #777; }
.search-popup-empty i { font-size: 38px; display: block; margin-bottom: 12px; opacity: .18; }
.search-popup-empty-title { font-size: 15px; font-weight: 500; color: #1c1c1c; margin-bottom: 4px; }
.search-popup-empty p { font-size: 14px; }

.sp-results-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sp-results-count { font-size: .8rem; color: #aaa; }
.sp-view-all {
    display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
    color: #e60000; text-decoration: none; transition: gap .18s;
}
.sp-view-all:hover { gap: 8px; color: #c00000; text-decoration: none; }
.sp-view-all-footer { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0ede8; text-align: center; }

.sp-list { display: flex; flex-direction: column; }
.sp-item {
    display: flex; align-items: center; gap: 16px; padding: 11px 12px; margin: 0 -12px;
    border-radius: 10px; text-decoration: none; color: inherit; transition: background .15s;
}
.sp-item:hover { background: #f8f6f3; }
.sp-item + .sp-item { border-top: 1px solid #f5f2ef; }
.sp-item:hover, .sp-item:hover + .sp-item { border-top-color: transparent; }
.sp-item-img {
    flex-shrink: 0; position: relative; width: 96px; height: 72px;
    border-radius: 8px; overflow: hidden; background: #ede9e3;
}
.sp-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.sp-item:hover .sp-item-img img { transform: scale(1.05); }
.sp-item-img-ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #ccc; font-size: 22px; }
.sp-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sp-item-cat { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #212529; }
.sp-item-name {
    font-size: 15px; font-weight: 600; color: #1c1c1c; line-height: 1.25;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    text-transform: uppercase;
}
.sp-item-price { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.sp-item-price .sp-price-now { color: #e60000; font-weight: 700; font-size: 15px; }
.sp-item-price .sp-price-old { color: #999; font-size: 13px; text-decoration: line-through; }

@media (max-width: 640px) {
    .search-popup { padding: 5vh 12px 12px; }
    .search-popup-panel { border-radius: 10px; }
    .search-popup-form { height: 54px; padding: 0 14px; gap: 8px; }
    .search-popup-close span { display: none; }
    .sp-item { gap: 12px; padding: 10px; margin: 0 -10px; }
    .sp-item-img { width: 76px; height: 57px; }
}

/* =========================================================================
   6. HEADER MOBILE + DRAWER (clone UI zendecor) + tinh chỉnh topbar/breadcrumb
   ========================================================================= */

/* Logo cao tối đa 70px (theo yêu cầu) */
.logo .logo-image img { max-height: 70px !important; }

/* Popup tìm kiếm phải nổi TRÊN drawer (z 9000) khi mở từ drawer */
.search-popup { z-index: 9600; }

/* --- Header mobile: icon tìm kiếm + icon menu (thay ô input) --- */
.mobile-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.mobile-hd-btn {
    background: none; border: none; width: 44px; height: 44px; padding: 0;
    font-size: 20px; color: #222; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.mobile-hd-btn:hover { color: #c00; }

/* Mobile: ẩn topbar, thêm shadow cho header */
@media (max-width: 991.98px) {
    .header { position: relative; z-index: 20; box-shadow: 0 3px 12px rgba(0,0,0,.10); }
    .header-mid { padding: 4px 0; }
    /* Chặn tràn ngang (drawer off-screen / phần tử 100vw) gây khoảng trắng bên phải */
    body { overflow-x: hidden; }
    .header-mid .row { margin-left: 0; margin-right: 0; }
    .header-mid .row > [class*="col"] { padding-left: 0; padding-right: 0; }
}

/* --- Dropdown gợi ý NGAY DƯỚI ô tìm kiếm (desktop, không dùng modal) --- */
.header__search-box { position: relative; }
.header-suggest {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1200;
    background: #fff; border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.18);
    max-height: min(70vh, 480px); overflow-y: auto; padding: 12px 14px; display: none;
}
.header-suggest.is-open { display: block; }

/* --- Breadcrumb mobile: bỏ nền, thu gọn, màu #515151 --- */
@media (max-width: 991.98px) {
    .title__breadcrumb { background-color: transparent; padding-top: 8px; padding-bottom: 8px; }
    .title__breadcrumb .breadcrumb { padding: 4px 0; }
    .title__breadcrumb .breadcrumb-item { font-size: 12px; line-height: 20px; }
    .title__breadcrumb .breadcrumb-item a,
    .title__breadcrumb .breadcrumb-item a h1 { color: #515151 !important; font-size: 12px; font-weight: 400; margin: 0; }
    .title__breadcrumb .breadcrumb-item.active a h1 { font-size: 12px; display: inline; }
    .title__breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: #999; }
}

/* ═══ DRAWER (nav-drawer) — nền tối, port từ zendecor ═══ */
.nav-drawer {
    display: none; position: fixed; top: 0; left: 0; bottom: 0;
    width: 100%; max-width: 400px; background: #0a1722; flex-direction: column;
    transform: translateX(-100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
    z-index: 9000; border-right: 1px solid rgba(235,128,31,.2); height: 100vh; height: 100dvh;
}
@media (max-width: 991.98px) { .nav-drawer { display: flex; } }
.nav-drawer.is-open { transform: translateX(0); box-shadow: 6px 0 40px rgba(0,0,0,.6); }

.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 8900; }
.nav-overlay.is-open { display: block; }

.nav-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: rgba(0,0,0,.3); border-bottom: 1px solid rgba(235,128,31,.15); flex-shrink: 0;
}
.nav-drawer-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 6px; padding: 6px 10px; max-height: 56px; }
.nav-drawer-logo-img { height: 40px; width: auto; object-fit: contain; }
.nav-drawer-close {
    display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    background: rgba(255,255,255,.1); border: none; border-radius: 50%; cursor: pointer; color: #fff; flex-shrink: 0;
    font-size: 16px; transition: background .2s;
}
.nav-drawer-close:hover { background: #eb801f; }

.nav-drawer-search { flex-shrink: 0; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-drawer-search-form {
    display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.09);
    border-radius: 6px; padding: 9px 12px; color: rgba(255,255,255,.5); cursor: pointer;
}
.nav-drawer-search-icon { flex-shrink: 0; font-size: 14px; }
.nav-drawer-search-input { flex: 1; background: transparent; border: none; outline: none; color: #fff; font-size: 13px; cursor: pointer; }
.nav-drawer-search-input::placeholder { color: rgba(255,255,255,.5); }

.nav-drawer-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.nav-drawer-menu { flex: 0 0 auto; list-style: none; margin: 0; padding: 0; }
.nav-drawer-menu > li { border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-drawer-menu > li:last-child { border-bottom: none; }
.nav-drawer-item {
    display: flex; align-items: center; justify-content: space-between; padding: 13px 18px;
    font-size: 14px; font-weight: 500; color: rgba(255,255,255,.82); text-transform: uppercase;
    letter-spacing: .03em; text-decoration: none; transition: color .2s, background .2s; cursor: pointer;
}
.nav-drawer-item:hover { color: #eb801f; background: rgba(255,255,255,.04); }
.nav-chevron { font-size: 13px; transition: transform .3s; flex-shrink: 0; margin-left: 8px; }
.nav-sub-toggle { justify-content: space-between; }
.nav-sub-toggle > span { flex: 1; min-width: 0; }

.nav-drawer-dropdown {
    list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden;
    transition: max-height .35s ease; background: rgba(0,0,0,.25);
}
/* max-height mở do JS đặt = scrollHeight thật (animation mượt, không giật). */
.nav-has-dropdown.is-open-sub > a .nav-chevron { transform: rotate(180deg); }
/* Nền tối dần theo cấp lồng nhau để phân biệt cấp */
.nav-drawer-dropdown .nav-drawer-dropdown { background: rgba(0,0,0,.35); }
.nav-drawer-sub-item {
    display: flex; align-items: center; gap: 4px; padding: 10px 18px 10px 22px;
    color: rgba(255,255,255,.7); font-size: 13px; text-decoration: none; transition: color .2s;
}
.nav-drawer-sub-item:hover { color: #eb801f; }
.nav-drawer-sub-item i { font-size: 13px; color: #eb801f; opacity: .75; flex-shrink: 0; }

.nav-drawer-cta-wrap { border-bottom: none !important; padding: 14px 18px 4px; }
.nav-drawer-cta {
    background: #eb801f !important; color: #fff !important; border-radius: 3px !important;
    justify-content: center !important; padding: 12px 20px !important; text-transform: uppercase !important;
}
.nav-drawer-cta:hover { background: #c96a12 !important; color: #fff !important; }

.nav-drawer-foot { flex-shrink: 0; padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.07); background: rgba(0,0,0,.2); }
.nav-drawer-contacts { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.nav-drawer-biz-name {
    font-size: 13px; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: .03em;
    padding-bottom: 6px; border-bottom: 1px solid rgba(235,128,31,.2); margin-bottom: 2px;
}
.nav-drawer-contact-item {
    display: flex; align-items: flex-start; gap: 9px; color: rgba(255,255,255,.72);
    font-size: 13px; text-decoration: none; transition: color .2s; line-height: 1.4;
}
.nav-drawer-contact-item:hover { color: #eb801f; }
.nav-drawer-contact-item i { color: #eb801f; font-size: 13px; flex-shrink: 0; margin-top: 3px; }
.nav-drawer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-social-link {
    display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    background: rgba(255,255,255,.09); border-radius: 50%; color: rgba(255,255,255,.8);
    text-decoration: none; font-size: 14px; transition: background .2s, color .2s;
}
.nav-social-link:hover { background: #eb801f; color: #fff; }
.nav-social-zalo { font-size: 11px; font-weight: 700; }

/* =========================================================================
   7. Trang DANH MỤC SẢN PHẨM: page header (hero) + tab drill-down + nội dung
   ========================================================================= */

/* Breadcrumb xám (chỉ PC) — cách 30px tới nội dung, font 14px */
.cat-crumb-pc { margin-bottom: 30px; }
.cat-crumb-pc .title__breadcrumb { margin-bottom: 0; }

/* PC head: H1 + mô tả + pill danh mục con (điều hướng server).
   Nhịp: cat-pc-head có margin-bottom cố định trước sản phẩm; phần tử CUỐI margin 0
   → trang LÁ (chỉ h1) cũng cách sản phẩm đều như trang có pill. */
.cat-pc-head { margin-bottom: 32px; }
.cat-pc-head > *:last-child { margin-bottom: 0; }
.cat-pc-head .section__menu__title { margin-bottom: 20px; }
.cat-pc-head .section__menu__sub__title { margin-bottom: 22px; }
.cat-pc-head .product-lists-top {
    list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
    gap: 10px; margin: 0; padding: 0;
}
.cat-pc-head .product-lists-top li { margin: 0; padding: 0; border: none; }
.cat-pc-head .product-lists-top li a {
    display: inline-flex; align-items: center; padding: 9px 18px;
    border: 1px solid #dddddd; border-radius: 6px; background: #fff; color: #333;
    font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
    transition: color .16s, border-color .16s, box-shadow .16s;
}
.cat-pc-head .product-lists-top li a:hover {
    color: #c63437; border-color: #c63437; box-shadow: 0 3px 10px rgba(198,52,55,.12);
}
.cat-crumb-pc .breadcrumb-item,
.cat-crumb-pc .breadcrumb-item a,
.cat-crumb-pc .breadcrumb-item span,
.cat-crumb-pc .breadcrumb-item h1 { font-size: 14px; font-weight: 500; line-height: 1.4; margin: 0; }

/* --- Page header (hero): ảnh nền cover hoặc SVG hoa phượng mặc định --- */
.cat-hero {
    position: relative; min-height: 220px; display: flex; align-items: center;
    background-size: cover; background-position: center; background-color: #7d181d; overflow: hidden;
}
.cat-hero--default { background-image: url('/assets/img/phuong-hero.svg'); }
.cat-hero-ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,6,7,.5) 0%, rgba(18,6,7,.72) 100%); }
.cat-hero .container { position: relative; z-index: 1; }
.cat-hero-inner { padding: 40px 0; text-align: center; }
.cat-hero-title { color: #fff; font-size: 34px; font-weight: 700; margin: 0 0 10px; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.cat-hero-crumb { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; font-size: 14px; }
.cat-hero-crumb a { color: rgba(255,255,255,.85); text-decoration: none; transition: color .15s; }
.cat-hero-crumb a:hover { color: #fff; }
.cat-hero-crumb .chc-home i { font-size: 15px; }
.cat-hero-crumb .chc-sep { color: rgba(255,255,255,.5); }
.cat-hero-crumb .chc-cur { color: #fff; font-weight: 600; }
@media (max-width: 767px) {
    .cat-hero { min-height: 150px; }
    .cat-hero-inner { padding: 22px 0; }
    .cat-hero-title { font-size: 24px; }
    .cat-hero-crumb { font-size: 12.5px; }
}

/* --- Tab danh mục cấp 2 — kiểu GẠCH CHÂN (underline) như demo -----------------
   Text in hoa, tab "active" (Tất cả) gạch chân đỏ; cấp có con → drill-down. */
.cat-tabs-wrap { margin: 0 0 24px; border-bottom: 1px solid #e6e6e6; }
.cat-tabs {
    list-style: none; display: flex; flex-wrap: nowrap; gap: 2px; margin: 0; padding: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs li { flex: 0 0 auto; }
.cat-tab {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    padding: 14px 18px; background: none; border: none; cursor: pointer; font-family: inherit;
    color: #2b2b2b; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
    white-space: nowrap; text-decoration: none; transition: color .16s;
}
.cat-tab::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
    background: #c63437; border-radius: 2px 2px 0 0; transform: scaleX(0); transition: transform .2s ease;
}
.cat-tab:hover { color: #c63437; }
.cat-tab.is-active { color: #c63437; }
.cat-tab.is-active::after { transform: scaleX(1); }
/* Nút back (SVG mũi tên trái) — không gạch chân */
.cat-tab-back { color: #888; padding: 12px 12px; }
.cat-tab-back::after { display: none; }
.cat-tab-back:hover { color: #c63437; }
.cat-tab-back svg { width: 18px; height: 18px; display: block; }
@media (max-width: 575px) {
    .cat-tab { padding: 12px 13px; font-size: 13px; }
    .cat-tab::after { left: 10px; right: 10px; }
    .cat-tab-back { padding: 12px 9px; }
}

/* --- Nội dung mô tả danh mục (dưới phân trang): clamp 6 dòng + Xem thêm smooth --- */
.category-content-wrap { margin-top: 34px; padding-top: 24px; border-top: 1px solid #eee; }
.category-content {
    position: relative; font-size: 15px; line-height: 1.75; color: #444;
    overflow: hidden; transition: max-height .45s ease;
}
.category-content.is-clamped { max-height: 10.5em; }            /* ~6 dòng (1.75em × 6) */
.category-content.is-clamped::after {                            /* mờ dần đáy khi đang thu gọn */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3.4em;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 92%); pointer-events: none;
}
.category-content :where(h1,h2,h3,h4) { line-height: 1.4; }
.category-content img { max-width: 100%; height: auto; border-radius: 6px; }
.category-content p:last-child { margin-bottom: 0; }

.category-content-toggle { text-align: center; margin-top: 16px; }
.category-content-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 24px; border: 1px solid #c63437; border-radius: 30px;
    background: #fff; color: #c63437; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: color .18s, background .18s, box-shadow .18s;
}
.category-content-btn:hover { background: #c63437; color: #fff; box-shadow: 0 4px 12px rgba(198,52,55,.22); }
.category-content-btn .ccb-ico { transition: transform .25s ease; }
.category-content-btn.is-open .ccb-ico { transform: rotate(90deg); }

/* =========================================================================
   8. AN TOÀN NỘI DUNG RICH-TEXT (bài viết / giới thiệu / điều khoản / sản phẩm)
   Nội dung do trình soạn thảo tạo có thể chứa iframe/bảng khổ cố định gây
   TRÀN NGANG, vỡ layout trên mobile. Ảnh đã được xử lý sẵn ở style.css.
   ========================================================================= */
/* iframe (YouTube, Google Maps, nhúng…) không vượt quá bề rộng cột */
.about-detalis-content iframe,
.news-detalis-content iframe,
.category-content iframe,
.product__details-des-wrapper iframe { max-width: 100%; }

/* --- Nhịp dọc ĐỒNG NHẤT giữa các khối (p / heading / ul / ol / table / blockquote…) ---
   Trước đây mỗi loại thẻ có margin khác nhau (p mặc định trình duyệt, ul 15px,
   table 30px, heading dùng margin UA lớn) → khoảng cách không đều. Chuẩn hoá:
     • Khối văn bản: cách đáy 16px.
     • Tiêu đề: cách trên 28px / dưới 12px (margin gộp nên không bị dồn 2 lần).
   Loại trừ tiêu đề bài viết (.news-detalis-title) và ul header (.blog-meta) vì là
   cấu trúc cố định, không phải nội dung soạn thảo. :is() giữ đúng độ ưu tiên để
   ghi đè rule cũ trong style.css. */
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) > :first-child { margin-top: 0; }
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) > :last-child { margin-bottom: 0; }
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) p,
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) ul:not(.blog-meta),
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) ol,
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) table,
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) figure,
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) blockquote,
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) pre { margin: 0 0 16px; }
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) :is(h1, h2, h3, h4, h5, h6):not(.news-detalis-title) { margin: 28px 0 12px; line-height: 1.35; }
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) li { margin-bottom: 6px; }
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) li:last-child { margin-bottom: 0; }
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) li > ul,
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) li > ol { margin: 6px 0 0; }
:is(.about-detalis-content, .news-detalis-content, .category-content, .product__details-des-wrapper) .blog-meta li { margin-bottom: 0; }
/* Dòng meta (lượt xem · ngày) là header cố định, không nằm trong rhythm nên có
   margin:0 (reset toàn cục *{margin:0}). Cần margin đáy để tách khỏi nội dung. */
.news-detalis-content .blog-meta { margin-bottom: 18px; }

/* Bảng rộng: cho cuộn ngang trong khung thay vì đẩy tràn cả trang (chỉ mobile) */
@media (max-width: 767px) {
    .about-detalis-content table,
    .news-detalis-content table,
    .product__details-des-wrapper table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================================================
   9. SIDEBAR DÍNH KHI CUỘN (PC ≥992px)
   Sidebar (danh mục + sản phẩm nổi bật) trượt theo khi cuộn và dừng ở đáy
   cột → hết khoảng trắng bên phải khi nội dung cột trái dài hơn.
   Chỉ bật ≥992px: dưới mức đó body có overflow-x:hidden (phá vỡ sticky) và
   sidebar nằm xuống dưới nội dung nên không cần dính.
   top:80px = chừa chỗ cho thanh menu #header-sticky (JS thêm .fixed-top khi
   cuộn >100px, cao ~48px) + khoảng thoáng, tránh sidebar dán sát nav. */
@media (min-width: 992px) {
    .news-sidebar {
        position: sticky;
        top: 80px;
    }
}
