/* ==========================================================================
   Trang Bán hàng Doanh nghiệp & Đại lý B2B - Thanh Hương Technology
   Phiên bản: 3.0 - Hệ thống 2 tab, mobile-first 4 cột
   Tông màu: Xanh da trời (Sky Blue) đồng bộ với base.css
   ========================================================================== */

/* =======================================================
   1. BIẾN MÀU
   ======================================================= */
:root {
    --th-primary-about: #09297b;
    --th-primary-dark: #003D73;
    --th-primary-light: #E6F2FB;
    --th-primary-soft: #D1E6F5;
    --th-accent: #38B6FF;
    --th-text-dark: #1E2A38;
    --th-text-body: #4B5563;
    --th-text-muted: #6B7280;
    --th-bg-page: #F4F8FC;
    --th-bg-white: #FFFFFF;
    --th-border: #E5EBF1;
    --th-warning: #FBBF24;
    --th-success: #10B981;
    --th-danger: #EF4444;
    --th-radius: 12px;
    --th-radius-sm: 8px;
    --th-shadow-sm: 0 2px 8px rgba(1, 89, 160, 0.06);
    --th-shadow-md: 0 8px 24px rgba(1, 89, 160, 0.08);
    --th-shadow-lg: 0 18px 40px rgba(1, 89, 160, 0.12);
    --th-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--th-bg-page);
    color: var(--th-text-body);
    -webkit-font-smoothing: antialiased;
}

.th-text-center {
    text-align: center;
}

/* =======================================================
   2. WRAPPER & KHOẢNG CÁCH HEADER (3 NỀN TẢNG)
   ======================================================= */
.th-b2b-wrapper {
    background-color: var(--th-bg-page);
    margin-bottom: 30px;
    min-height: 60vh;
    margin-top: 100px;
    /* mobile */
}

@media (min-width: 768px) {
    .th-b2b-wrapper {
        margin-top: 118px;
    }
}

/* tablet */
@media (min-width: 992px) {
    .th-b2b-wrapper {
        margin-top: -15px;
    }
}

/* pc/laptop */

.th-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

/* =======================================================
   3. BREADCRUMB
   ======================================================= */
.th-breadcrumb {
    padding: 12px 0;
    background: var(--th-bg-white);
    border-bottom: 1px solid var(--th-border);
}

.th-breadcrumb ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
}

.th-breadcrumb li {
    color: var(--th-text-muted);
    display: flex;
    align-items: center;
}

.th-breadcrumb li+li::before {
    content: "/";
    margin: 0 6px;
    opacity: 0.5;
}

.th-breadcrumb a {
    color: var(--th-primary-about);
    text-decoration: none;
    font-weight: 500;
}

.th-breadcrumb a:hover {
    color: var(--th-primary-dark);
    text-decoration: underline;
}

/* =======================================================
   4. HERO BANNER
   ======================================================= */
.th-hero-banner {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--th-primary-light), var(--th-bg-white));
}

.th-hero-banner img {
    width: 100%;
    display: block;
}

.th-hero-banner .th-hero-img-mobile {
    display: none;
}

@media (max-width: 767px) {
    .th-hero-banner .th-hero-img-desktop {
        display: none;
    }

    .th-hero-banner .th-hero-img-mobile {
        display: block;
    }
}

/* =======================================================
   5. HEADING + TAB NAVIGATION
   ======================================================= */
.th-tabs-wrapper {
    padding: 28px 0 36px;
}

.th-tabs-heading {
    text-align: center;
    margin-bottom: 22px;
    padding: 22px 20px;
    background: linear-gradient(135deg, var(--th-primary-light), var(--th-bg-white));
    border-radius: var(--th-radius);
    border: 1px solid var(--th-primary-soft);
}

.th-tabs-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--th-primary-about);
    text-transform: uppercase;
    margin: 0 0 8px;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.th-tabs-tagline {
    font-size: 14px;
    color: var(--th-primary-dark);
    font-style: italic;
    margin: 0 0 14px;
    font-weight: 500;
}

.th-tabs-lead {
    font-size: 13.5px;
    color: var(--th-text-body);
    line-height: 1.6;
    margin: 0;
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}

.th-tabs-readmore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--th-accent);
    font-weight: 600;
    margin-left: 4px;
    text-decoration: none;
}

.th-tabs-readmore:hover {
    color: var(--th-primary-dark);
    text-decoration: underline;
}

@media (min-width: 768px) {
    .th-tabs-title {
        font-size: 26px;
    }

    .th-tabs-tagline {
        font-size: 15px;
    }

    .th-tabs-lead {
        font-size: 14.5px;
    }
}

/* ----- TAB NAV ----- */
.th-b2b-tabs {
    display: flex;
    gap: 4px;
    border: none;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
    background: transparent;
}

.th-b2b-tabs .nav-item {
    margin-bottom: 0;
    flex: 1;
}

.th-b2b-tabs .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    width: 100%;
    padding: 14px 12px;
    background: var(--th-bg-white);
    color: var(--th-text-muted);
    border: 1px solid var(--th-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    transition: var(--th-transition);
    cursor: pointer;
}

.th-b2b-tabs .nav-link i {
    font-size: 22px;
    color: var(--th-text-muted);
    transition: var(--th-transition);
}

.th-b2b-tabs .nav-link .th-tab-label {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--th-text-dark);
    line-height: 1.2;
    display: block;
}

.th-b2b-tabs .nav-link small {
    font-size: 13px;
    font-weight: 500;
    color: var(--th-text-muted);
    line-height: 1.3;
    display: block;
}

.th-b2b-tabs .nav-link:hover {
    background: var(--th-primary-light);
    border-color: var(--th-primary-soft);
    color: var(--th-primary-about);
}

.th-b2b-tabs .nav-link.active {
    background: var(--th-primary-about) !important;
    color: var(--th-bg-white) !important;
    border-color: var(--th-primary-about) !important;
    border-bottom-color: var(--th-primary-about) !important;
}

.th-b2b-tabs .nav-link.active i,
.th-b2b-tabs .nav-link.active .th-tab-label {
    color: var(--th-bg-white);
}

.th-b2b-tabs .nav-link.active small {
    color: #BFDBFE;
}

/* ----- TAB CONTENT ----- */
.th-b2b-tab-content {
    background: var(--th-bg-white);
    border: 1px solid var(--th-primary-soft);
    border-radius: 0 0 12px 12px;
    padding: 24px 18px;
}

@media (min-width: 768px) {
    .th-b2b-tab-content {
        padding: 32px 28px;
    }
}

.th-tabs-subheading {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--th-primary-soft);
}

.th-tabs-subtitle {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--th-primary-about);
    margin: 0 0 6px;
    letter-spacing: 0.3px;
}

.th-tabs-subheading p {
    margin: 0;
    font-size: 13.5px;
    color: var(--th-text-muted);
}

/* =======================================================
   6. 4 CỘT GIÁ TRỊ (tab 1 + tab 2) - MOBILE FIRST
   ======================================================= */
.th-value-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .th-value-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
}

@media (min-width: 992px) {
    .th-value-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

/* ---- CARD ---- */
.th-value-card {
    background: var(--th-bg-white);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
    padding: 18px 18px 16px;
    transition: var(--th-transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.th-value-card:hover {
    border-color: var(--th-primary-soft);
    box-shadow: var(--th-shadow-md);
    transform: translateY(-3px);
}

/* ---- HEAD: icon + title ---- */
.th-value-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--th-border);
}

.th-value-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--th-primary-about), var(--th-primary-dark));
    color: var(--th-bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.th-value-card-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--th-primary-about);
    margin: 0;
    line-height: 1.25;
}

/* ---- LIST ---- */
.th-value-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.th-value-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: var(--th-text-body);
    line-height: 1.55;
}

.th-value-list li i.fa-check-circle {
    color: var(--th-success);
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 13px;
}

.th-value-list li strong {
    color: var(--th-text-dark);
}

.th-value-link {
    color: var(--th-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 11.5px;
    margin-left: 2px;
}

.th-value-link:hover {
    text-decoration: underline;
}

/* ---- CTA inline (ghi chú in nghiêng) ---- */
.th-value-cta {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--th-border);
}

.th-value-cta i {
    color: var(--th-primary-about);
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 13px;
}

.th-value-cta em {
    font-size: 12px;
    color: var(--th-text-dark);
    font-weight: 500;
    line-height: 1.5;
    font-style: italic;
}

/* =======================================================
   7. SECTION HEADER (PHẦN 2 - COMMERCIAL)
   ======================================================= */
.th-section-inner {
    padding: 24px 0 0;
    margin-top: 18px;
}

.th-section-header--inline {
    background: var(--th-bg-page);
    border: 1px solid var(--th-border);
}

.th-section-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--th-accent);
    margin-bottom: 6px;
}

.th-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--th-primary-about);
    text-transform: uppercase;
    margin: 0 0 8px;
    line-height: 1.25;
}

.th-section-title--dark {
    color: var(--th-text-dark);
}

.th-section-subtitle {
    color: var(--th-text-muted);
    font-size: 13.5px;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.55;
}

@media (min-width: 768px) {
    .th-section-title {
        font-size: 24px;
    }

    .th-section-subtitle {
        font-size: 14.5px;
    }
}

/* =======================================================
   8. COMMERCIAL GRID (8 tiêu chí)
   ======================================================= */
.th-commercial-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

@media (min-width: 768px) {
    .th-commercial-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

.th-commercial-card {
    background: var(--th-bg-white);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
    padding: 16px 14px;
    text-align: center;
    transition: var(--th-transition);
}

.th-commercial-card:hover {
    border-color: var(--th-primary-soft);
    transform: translateY(-3px);
    box-shadow: var(--th-shadow-md);
}

.th-commercial-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--th-primary-soft);
    color: var(--th-primary-about);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--th-transition);
}

.th-commercial-card:hover .th-commercial-icon {
    background: var(--th-primary-about);
    color: var(--th-bg-white);
}

.th-commercial-card h3 {
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--th-text-dark);
    margin: 0 0 6px;
    line-height: 1.3;
}

.th-commercial-card p {
    font-size: 12.5px;
    color: var(--th-text-muted);
    line-height: 1.5;
    margin: 0;
}

@media (min-width: 768px) {
    .th-commercial-card {
        padding: 20px 16px;
    }

    .th-commercial-card h3 {
        font-size: 14px;
    }
}

/* =======================================================
   9. BRANDS
   ======================================================= */
.th-section {
    padding: 32px 0;
}

.th-section--white {
    background: var(--th-bg-white);
}

.th-brands-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.th-brand-img {
    width: 30%;
    height: 40px;
    object-fit: contain;
    filter: grayscale(0%);
    background: var(--th-bg-page);
    padding: 6px;
    border-radius: 6px;
}

@media (min-width: 768px) {
    .th-brand-img {
        width: 190px;
        height: 60px;
    }
}

.th-brands-row--color .th-brand-img {
    opacity: 1;
}

/* =======================================================
   10. FORM BÁO GIÁ + AJAX TÌM SẢN PHẨM
   ======================================================= */
.th-quote-section {
    padding: 32px 0;
    background: linear-gradient(135deg, #E6F2FB 0%, #F4F8FC 100%);
}

.th-quote-card {
    background: var(--th-bg-white);
    border-radius: 16px;
    box-shadow: var(--th-shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .th-quote-card {
        flex-direction: row;
    }
}

.th-quote-form {
    width: 100%;
    padding: 24px;
}

@media (min-width: 768px) {
    .th-quote-form {
        padding: 30px;
    }
}

@media (min-width: 992px) {
    .th-quote-form {
        width: 60%;
        padding: 32px 28px;
    }
}

.th-quote-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--th-primary-about);
    margin: 0 0 6px;
}

.th-quote-title i {
    color: var(--th-accent);
    margin-right: 6px;
}

@media (min-width: 768px) {
    .th-quote-title {
        font-size: 22px;
    }
}

.th-quote-desc {
    color: var(--th-text-muted);
    font-size: 13px;
    margin: 0 0 18px;
    line-height: 1.55;
}

.th-gender-row {
    display: flex;
    gap: 22px;
    margin-bottom: 12px;
}

.th-gender-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--th-text-dark);
    font-size: 14px;
}

.th-gender-row input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--th-primary-about);
}

.th-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

@media (min-width: 576px) {
    .th-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.th-input,
.th-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-sm);
    font-size: 14px;
    background: #F9FBFD;
    color: var(--th-text-dark);
    transition: var(--th-transition);
    outline: none;
    font-family: inherit;
}

.th-input:focus,
.th-textarea:focus {
    border-color: var(--th-primary-about);
    background: var(--th-bg-white);
    box-shadow: 0 0 0 3px rgba(1, 89, 160, 0.1);
}

.th-input::placeholder {
    color: #9CA3AF;
}

.th-input-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%236B7280' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 8px;
    padding-right: 28px;
    cursor: pointer;
}

.th-mb-3 {
    margin-bottom: 12px;
}

.th-mb-4 {
    margin-bottom: 18px;
}

.th-btn-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--th-primary-about), var(--th-primary-dark));
    color: var(--th-bg-white);
    border: none;
    border-radius: var(--th-radius-sm);
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    transition: var(--th-transition);
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.th-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(1, 89, 160, 0.35);
}

.th-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.th-secure-note {
    text-align: center;
    color: var(--th-success);
    font-size: 11.5px;
    margin: 10px 0 0;
    font-weight: 500;
}

/* ----- AJAX TÌM SẢN PHẨM ----- */
.th-product-search-wrap {
    position: relative;
}

.th-search-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--th-text-dark);
    margin-bottom: 6px;
}

.th-search-label i {
    color: var(--th-primary-about);
    margin-right: 4px;
}

.th-search-input-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 6px;
}

@media (max-width: 575px) {
    .th-search-input-row {
        grid-template-columns: 1fr;
    }
}

.th-btn-search {
    padding: 0 16px;
    border: none;
    border-radius: var(--th-radius-sm);
    background: var(--th-primary-about);
    color: var(--th-bg-white);
    cursor: pointer;
    font-size: 14px;
    transition: var(--th-transition);
}

.th-btn-search:hover:not(:disabled) {
    background: var(--th-primary-dark);
}

.th-btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.th-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: var(--th-bg-white);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-sm);
    box-shadow: var(--th-shadow-lg);
    z-index: 100;
    max-height: 360px;
    overflow-y: auto;
}

.th-search-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--th-primary-light);
    border-bottom: 1px solid var(--th-border);
    font-size: 12px;
    color: var(--th-text-muted);
    font-weight: 600;
}

.th-search-clear {
    font-size: 12px;
    color: var(--th-primary-about);
    text-decoration: none;
}

.th-search-clear:hover {
    color: var(--th-primary-dark);
}

.th-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.th-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--th-border);
    cursor: pointer;
    transition: var(--th-transition);
}

.th-search-item:hover,
.th-search-item.is-selected {
    background: var(--th-primary-light);
}

.th-search-item:last-child {
    border-bottom: none;
}

.th-search-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: var(--th-bg-page);
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--th-border);
}

.th-search-info {
    flex: 1;
    min-width: 0;
}

.th-search-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--th-text-dark);
    margin: 0 0 2px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.th-search-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--th-text-muted);
    margin: 0;
}

.th-search-price {
    color: var(--th-primary-about);
    font-weight: 700;
}

.th-search-add {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--th-primary-soft);
    color: var(--th-primary-about);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: var(--th-transition);
}

.th-search-add:hover {
    background: var(--th-primary-about);
    color: var(--th-bg-white);
}

.th-search-add.is-added {
    background: var(--th-success);
    color: var(--th-bg-white);
}

.th-search-empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--th-text-muted);
    font-size: 13px;
}

.th-search-empty i {
    display: block;
    font-size: 26px;
    margin-bottom: 6px;
    opacity: 0.4;
}

/* ----- SẢN PHẨM ĐÃ CHỌN ----- */
.th-selected-wrap {
    margin-top: 14px;
}

.th-selected-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--th-text-dark);
    margin-bottom: 8px;
}

.th-selected-label i {
    color: var(--th-primary-about);
}

.th-selected-count {
    background: var(--th-primary-about);
    color: var(--th-bg-white);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
}

.th-selected-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    flex-direction: column;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
}

.th-selected-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--th-bg-page);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-sm);
}

.th-selected-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: var(--th-bg-white);
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--th-border);
}

.th-selected-info {
    flex: 1;
    min-width: 0;
}

.th-selected-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--th-text-dark);
    margin: 0 0 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.th-selected-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--th-border);
    border-radius: 6px;
    background: var(--th-bg-white);
    overflow: hidden;
}

.th-qty-btn {
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--th-primary-about);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.th-qty-btn:hover {
    background: var(--th-primary-light);
}

.th-qty-input {
    width: 36px;
    height: 22px;
    border: none;
    text-align: center;
    font-size: 12px;
    color: var(--th-text-dark);
    -moz-appearance: textfield;
}

.th-qty-input::-webkit-outer-spin-button,
.th-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.th-selected-remove {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--th-danger);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--th-transition);
}

.th-selected-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ----- CỘT LIÊN HỆ ----- */
.th-contact-info {
    width: 100%;
    color: var(--th-bg-white);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(1, 89, 160, 0.96), rgba(0, 61, 115, 0.96)),
        url('/templates/laptop/anh/bg-chuyen-vien-b2b.jpg') center / cover;
}

@media (min-width: 768px) {
    .th-contact-info {
        padding: 30px;
    }
}

@media (min-width: 992px) {
    .th-contact-info {
        width: 40%;
        padding: 32px;
    }
}

.th-contact-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--th-warning);
    margin: 0 0 18px;
}

.th-contact-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.th-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.th-contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.th-contact-role {
    font-size: 11px;
    text-transform: uppercase;
    color: #BFDBFE;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
}

.th-contact-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--th-bg-white);
    text-decoration: none;
    transition: var(--th-transition);
    display: inline-block;
}

.th-contact-value:hover {
    color: var(--th-warning);
    transform: translateX(3px);
}

.th-contact-value--small {
    font-size: 14px;
    font-weight: 600;
}

/* =======================================================
   11. ACCESSIBILITY
   ======================================================= */
.th-btn-submit:focus-visible,
.th-btn-search:focus-visible,
.th-search-add:focus-visible,
.th-selected-remove:focus-visible,
.th-qty-btn:focus-visible,
.th-input:focus-visible,
.th-b2b-tabs .nav-link:focus-visible {
    outline: 2px solid var(--th-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* =======================================================
   12. RESPONSIVE FINE-TUNE
   ======================================================= */
@media (max-width: 767px) {
    .th-tabs-title {
        font-size: 18px;
    }

    .th-tabs-tagline {
        font-size: 13px;
    }

    .th-tabs-lead {
        font-size: 12.5px;
    }

    .th-b2b-tabs .nav-link {
        padding: 12px 8px;
    }

    .th-b2b-tabs .nav-link i {
        font-size: 18px;
    }

    .th-b2b-tabs .nav-link .th-tab-label {
        font-size: 12.5px;
    }

    .th-b2b-tabs .nav-link small {
        font-size: 10.5px;
    }

    .th-section-title {
        font-size: 18px;
    }

    .th-commercial-grid {
        grid-template-columns: 1fr 1fr;
    }

    .th-quote-title {
        font-size: 18px;
    }

    .th-quote-form,
    .th-contact-info {
        padding: 20px;
    }

    .th-contact-value {
        font-size: 16px;
    }

    .th-value-card {
        padding: 16px;
    }

    .th-value-card-icon {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    .th-value-card-title {
        font-size: 13.5px;
    }

    .th-value-list li {
        font-size: 12px;
    }
}

@media (max-width: 575px) {
    .th-commercial-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =======================================================
   13. MODAL — Bài viết chi tiết & Chi tiết công nợ
   ======================================================= */

.th-modal .modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 61, 115, 0.18);
    overflow: hidden;
}

.th-modal .modal-header {
    background: linear-gradient(135deg, var(--th-primary-about) 0%, var(--th-primary-dark) 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 24px;
    align-items: center;
}

.th-modal .modal-header .modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.th-modal .modal-header .modal-title i {
    background: rgba(255, 255, 255, 0.16);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.th-modal .modal-header .close {
    color: #fff;
    opacity: 0.9;
    text-shadow: none;
    font-size: 26px;
    font-weight: 300;
    padding: 0 4px;
    margin-left: 8px;
    transition: opacity 0.2s ease;
}

.th-modal .modal-header .close:hover {
    opacity: 1;
    color: #fff;
}

.th-modal .modal-body {
    padding: 24px 28px 28px;
    color: #1f2933;
    line-height: 1.65;
    font-size: 14.5px;
}

.th-modal .modal-body p {
    margin-bottom: 12px;
    color: #1f2933;
}

.th-modal .modal-body strong {
    color: var(--th-primary-dark);
}

.th-modal .modal-body em {
    color: var(--th-primary-about);
    font-style: italic;
}

.th-modal .modal-footer {
    border-top: 1px solid var(--th-border, #e3eaf2);
    padding: 14px 24px;
    background: #fafcff;
}

.th-modal .modal-footer .btn {
    border-radius: 8px;
    font-size: 13px;
    padding: 8px 18px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.th-modal .modal-footer .btn-default {
    background: #fff;
    color: var(--th-primary-dark);
    border: 1px solid var(--th-border, #d6e0eb);
}

.th-modal .modal-footer .btn-default:hover {
    background: #f1f5fb;
    color: var(--th-primary-about);
}

.th-modal .modal-footer .btn-primary,
.th-modal .modal-footer .th-modal-scroll {
    background: var(--th-primary-about);
    border-color: var(--th-primary-about);
    color: #fff;
    cursor: pointer;
}

.th-modal .modal-footer .btn-primary:hover,
.th-modal .modal-footer .btn-primary:focus {
    background: var(--th-primary-dark);
    border-color: var(--th-primary-dark);
    color: #fff;
}

/* ---------- Hero image inside article modal ---------- */
.th-modal-hero {
    margin: 0 -8px 18px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 61, 115, 0.08);
}

.th-modal-hero img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 280px;
}

/* ---------- Headings ---------- */
.th-modal-h2 {
    font-size: 19px;
    font-weight: 700;
    color: var(--th-primary-dark);
    margin: 18px 0 12px;
    line-height: 1.35;
}

.th-modal-h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--th-primary-about);
    margin: 22px 0 10px;
    position: relative;
    padding-left: 14px;
}

.th-modal-h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: linear-gradient(180deg, var(--th-primary-about), var(--th-accent));
    border-radius: 2px;
}

/* ---------- Feature grid (4 cards inside article modal) ---------- */
.th-modal-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0 18px;
}

.th-modal-feature {
    background: linear-gradient(135deg, var(--th-primary-light) 0%, #f4faff 100%);
    border: 1px solid var(--th-primary-soft, #d1e6f5);
    border-radius: 10px;
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.th-modal-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(1, 89, 160, 0.1);
}

.th-modal-feature i {
    color: var(--th-primary-about);
    background: #fff;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(1, 89, 160, 0.1);
}

.th-modal-feature h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--th-primary-dark);
    margin: 0 0 4px;
}

.th-modal-feature p {
    font-size: 12.5px;
    color: #4a5568;
    margin: 0;
    line-height: 1.55;
}

/* ---------- Quote block ---------- */
.th-modal-quote {
    background: #fff;
    border: 1px dashed var(--th-primary-soft, #d1e6f5);
    border-left: 4px solid var(--th-primary-about);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 14px 0;
    position: relative;
}

.th-modal-quote i.fa-quote-left {
    color: var(--th-accent, #38B6FF);
    font-size: 18px;
    display: block;
    margin-bottom: 6px;
}

.th-modal-quote p {
    margin: 0;
    font-size: 14.5px;
    color: var(--th-primary-dark);
    font-weight: 500;
}

/* ---------- Three column block ---------- */
.th-modal-three-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.th-modal-three-col {
    text-align: center;
    background: #fafcff;
    border: 1px solid var(--th-border, #e3eaf2);
    border-radius: 10px;
    padding: 14px 10px;
    transition: all 0.2s ease;
}

.th-modal-three-col:hover {
    background: var(--th-primary-light);
    border-color: var(--th-primary-soft, #d1e6f5);
}

.th-modal-three-col i {
    color: var(--th-primary-about);
    font-size: 18px;
    margin-bottom: 6px;
}

.th-modal-three-col h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--th-primary-dark);
    margin: 0 0 4px;
}

.th-modal-three-col p {
    font-size: 12px;
    color: #5a6573;
    margin: 0;
    line-height: 1.5;
}

/* ---------- CTA inside modal ---------- */
.th-modal-cta {
    margin-top: 18px;
    padding: 18px;
    background: linear-gradient(135deg, var(--th-primary-about) 0%, var(--th-primary-dark) 100%);
    border-radius: 12px;
    text-align: center;
    color: #fff;
}

.th-modal-cta h4 {
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    margin: 0 0 10px;
}

.th-modal-cta-btn {
    display: inline-block;
    background: #fff;
    color: var(--th-primary-about);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    line-height: 1.4;
}

.th-modal-cta-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.5);
}

.th-modal-cta-btn:hover {
    background: var(--th-accent, #38B6FF);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ---------- Modal "Chi tiết" công nợ ---------- */
.th-modal-lead {
    font-size: 13.5px;
    color: #4a5568;
    margin-bottom: 14px;
}

.th-modal-requirement {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #fafcff;
    border: 1px solid var(--th-border, #e3eaf2);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.th-modal-requirement:hover {
    background: var(--th-primary-light);
    border-color: var(--th-primary-soft, #d1e6f5);
}

.th-modal-req-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: var(--th-primary-about);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.th-modal-req-body {
    flex: 1;
}

.th-modal-req-body h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--th-primary-dark);
    margin: 0 0 3px;
}

.th-modal-req-body p {
    font-size: 12.5px;
    color: #5a6573;
    margin: 0;
    line-height: 1.55;
}

/* ---------- Modal backdrop override ---------- */
.modal-backdrop.show {
    opacity: 0.65;
    background: #001a33;
}

/* ---------- Scrollbar inside modal ---------- */
.th-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.th-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f5fb;
}

.th-modal .modal-body::-webkit-scrollbar-thumb {
    background: var(--th-primary-soft, #d1e6f5);
    border-radius: 3px;
}

.th-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--th-primary-about);
}

/* ---------- Responsive modal ---------- */
@media (max-width: 767px) {
    .th-modal .modal-header {
        padding: 14px 16px;
    }

    .th-modal .modal-header .modal-title {
        font-size: 14.5px;
    }

    .th-modal .modal-body {
        padding: 18px 18px 22px;
        font-size: 13.5px;
    }

    .th-modal .modal-footer {
        padding: 12px 16px;
    }

    .th-modal-h2 {
        font-size: 17px;
    }

    .th-modal-h3 {
        font-size: 14.5px;
    }

    .th-modal-feature-grid {
        grid-template-columns: 1fr;
    }

    .th-modal-three-cols {
        grid-template-columns: 1fr;
    }

    .th-modal-hero img {
        max-height: 180px;
    }
}

@media (max-width: 575px) {
    .th-modal .modal-dialog {
        margin: 12px;
    }
}

/* ---------- Focus accessibility ---------- */
.th-modal .btn:focus,
.th-modal .close:focus {
    box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.4);
    outline: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {

    .th-modal-feature,
    .th-modal-three-col,
    .th-modal-requirement,
    .th-modal-cta-btn {
        transition: none !important;
        transform: none !important;
    }

    html {
        scroll-behavior: auto !important;
    }
}

/* =======================================================
   14. MODAL PURE-JS RUNTIME (no Bootstrap JS)
   ======================================================= */

/* backdrop khi mở modal */
.modal-backdrop.fade.show {
    position: fixed;
    inset: 0;
    background: #001a33;
    opacity: 0.65;
    z-index: 1040;
}

/* body khi modal mở */
body.modal-open {
    overflow: hidden !important;
}

/* modal block khi show */
.modal.show {
    display: block !important;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    inset: 0;
    z-index: 1050;
    outline: 0;
}

/* chừa khoảng trên cho dialog */
.modal.show .modal-dialog {
    margin: 1.75rem auto;
    max-width: 600px;
    pointer-events: none;
}

.modal.show .modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 3.5rem);
}

.modal.show .modal-dialog .modal-content {
    pointer-events: auto;
}

/* modal-lg override */
.modal.show .modal-lg {
    max-width: 900px;
}

/* modal-body scroll */
.modal.show .modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* mobile */
@media (max-width: 575px) {
    .modal.show .modal-dialog {
        margin: 12px;
        max-width: none;
    }

    .modal.show .modal-body {
        max-height: calc(100vh - 140px);
    }
}