/* Custom overrides for the original site CSS. Loaded after css/media.css. Keep original files untouched. */

/* Home slider: reserve the 16:9 box and show only the first slide until owl-carousel initialises (no layout shift).
   Nothing is reserved when there are no slides. */
.slideshow:has(.slideshow-item) { aspect-ratio: 16 / 9; }
.slideshow .owl-carousel:not(.owl-loaded) .slideshow-item:not(:first-child) { display: none; }

/* Product list sidebar, "Thương hiệu" box: ~80 brands scroll inside a fixed-height list with a quick filter. */
.product-total-brand-search { display: block; padding: 8px 8px 4px; }
.product-total-brand-search-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.product-total-brand-search-input { display: block; width: 100%; height: 36px !important; padding: 0 10px; border: 1px solid #d5d5d5; border-radius: 5px; background: #fff; font-size: 14px; }
.product-total-brand-search-input:focus-visible { outline: 2px solid var(--color-main); outline-offset: 1px; }
.product-total-left .product-total-brand-list { position: relative; max-height: 18rem; overflow-y: scroll; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--color-main) transparent;
    /* scroll shadows: a fade at the edge that still has hidden items */
    background: linear-gradient(#eaeaea 30%, rgba(234,234,234,0)) top / 100% 24px no-repeat local,
                linear-gradient(rgba(234,234,234,0), #eaeaea 70%) bottom / 100% 24px no-repeat local,
                linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,0)) top / 100% 8px no-repeat scroll,
                linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.18)) bottom / 100% 8px no-repeat scroll; }
.product-total-brand-list::-webkit-scrollbar { width: 6px; }
.product-total-brand-list::-webkit-scrollbar-thumb { background: var(--color-main); border-radius: 3px; }
.product-total-brand-list li[hidden] { display: none; }
.product-total-brand-list a.active { color: var(--color-main); font-weight: 700; }
.product-total-brand-empty, .product-total-brand-status { margin: 0; padding: 5px 8px; font-size: 14px; color: #4a4a4a; }
.product-total-brand-empty[hidden], .product-total-brand-status:empty { display: none; }
@media (max-width: 768px) {
    .product-total-left .product-total-brand-list { max-height: 12rem; }
}

/* Breadcrumb on small screens: one scrollable row instead of wrapping onto several lines. */
@media (max-width: 768px) {
    .breadCrumbs .center .breadcrumb { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .breadCrumbs .center .breadcrumb::-webkit-scrollbar { display: none; }
    .breadCrumbs .center .breadcrumb-item { flex: 0 0 auto; }
}

/* Pagination of the lists: wrap onto several rows on small screens instead of widening the page. */
@media (max-width: 768px) {
    .pagination-home .pagination { flex-wrap: wrap; justify-content: center; }
}
