/* Scoped controls retain the existing palette and DOM contracts. */
#san-pham-section .thc-pro-top-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

#san-pham-section .thc-pro-search-row,
#san-pham-section .thc-pro-search-input-wrap,
#san-pham-section .thc-pro-sort-group {
    min-width: 0;
    width: 100%;
}

#san-pham-section .thc-pro-sort-group {
    display: flex;
    gap: 8px;
}

#san-pham-section .thc-sort-select-wrap {
    flex: 1;
    min-width: 0;
}

#productSortSelect {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
}

#productSearchInput {
    min-height: 44px;
    font-size: 16px;
}

#productTabBar {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

#thcDropdownFilterBar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#thcDropdownFilterBar .thc-dd-wrap {
    min-width: 0;
    flex: 1 1 140px;
}

#thcDropdownFilterBar .thc-dd-btn {
    width: 100%;
    min-height: 44px;
}

#thcDropdownFilterBar .thc-dd-menu {
    max-width: calc(100vw - 32px);
    max-height: min(60vh, 440px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

#thcHomeActiveFilterTags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#san-pham-section button:focus-visible,
#san-pham-section select:focus-visible,
:is(#productDetailModal, #productModal) button:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 3px;
}

.thc-v120-topbar .thc-v120-breadcrumb {
    flex: 1;
}

.thc-v120-stage {
    aspect-ratio: 4/3;
}

:is(#productDetailModal, #productModal) .thc-v72-form-row>div {
    min-width: 0;
}

:is(#productDetailModal, #productModal) .thc-v72-inp {
    max-width: 100%;
    min-width: 0;
    font-size: 16px;
}

:is(#productDetailModal, #productModal) .thc-v72-sf-btns {
    flex-wrap: wrap;
    gap: 8px;
}

:is(#productDetailModal, #productModal) .thc-v72-sticky-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

[data-theme="dark"] .thc-v120-topbar,
body.dark-mode .thc-v120-topbar,
[data-theme="dark"] .thc-v120-slider-card,
body.dark-mode .thc-v120-slider-card,
[data-theme="dark"] .thc-v120-stage,
body.dark-mode .thc-v120-stage {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .thc-v120-breadcrumb,
body.dark-mode .thc-v120-breadcrumb {
    color: #cbd5e1;
}

[data-theme="dark"] .thc-v120-breadcrumb b,
body.dark-mode .thc-v120-breadcrumb b {
    color: #93c5fd;
}

@media (min-width:768px) {
    #san-pham-section .thc-pro-top-controls {
        grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
        align-items: center;
    }
}

@media (max-width:480px) {
    .thc-v120-topbar {
        gap: 8px;
        padding: 10px;
    }

    .thc-v120-breadcrumb {
        font-size: 11px;
    }

    #thcDropdownFilterBar .thc-dd-wrap {
        flex-basis: calc(50% - 8px);
    }
}

@media (prefers-reduced-motion:reduce) {
    .thc-v120-stage img {
        transition: none;
    }
}