/* =========================================================
   BAIHANGDA V6.3.1 Homepage Visual Alignment Fix
   - Featured Products: equal cards / responsive / no overflow
   - Why Choose: four-column enterprise metrics
   ========================================================= */

html, body { max-width: 100%; }

.bhd-v6-featured-section {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
}

.bhd-v6-featured-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(18px, 1.55vw, 28px) !important;
    align-items: stretch !important;
    width: min(100%, 1500px) !important;
    max-width: 1500px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: clamp(20px, 3vw, 42px) !important;
    padding-right: clamp(20px, 3vw, 42px) !important;
    box-sizing: border-box !important;
}

.bhd-v6-featured-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
}

.bhd-v6-featured-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 535px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.bhd-v6-featured-card img {
    display: block !important;
    width: 100% !important;
    height: 270px !important;
    max-height: 270px !important;
    flex: 0 0 270px !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto 22px !important;
    background: #fff !important;
}

.bhd-v6-featured-card h2,
.bhd-v6-featured-card h3,
.bhd-v6-featured-card h4 {
    min-height: 58px !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    display: flex !important;
    align-items: flex-start !important;
    line-height: 1.25 !important;
}

.bhd-v6-featured-card p {
    min-height: 84px !important;
    margin-top: 0 !important;
    margin-bottom: 18px !important;
    line-height: 1.7 !important;
}

.bhd-v6-featured-card .bhd-v6-card-button,
.bhd-v6-featured-card a.bhd-v6-card-button {
    margin-top: auto !important;
    align-self: flex-start !important;
}

.bhd-v6-featured-card.bhd-v6-card-needs-padding {
    padding: 30px !important;
}

/* WHY CHOOSE BAIHANGDA */
.bhd-v6-why-section {
    box-sizing: border-box !important;
    width: 100% !important;
    padding: 52px max(7.5vw, 32px) 56px !important;
}

.bhd-v6-why-section h2,
.bhd-v6-why-section h3 {
    margin: 0 0 28px !important;
    line-height: 1.2 !important;
}

.bhd-v61-old-why-content {
    display: none !important;
}

.bhd-v61-why-grid {
    width: min(100%, 1500px) !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    box-sizing: border-box !important;
}

.bhd-v61-why-card {
    min-width: 0 !important;
    padding: 24px 26px !important;
    border: 1px solid rgba(255,255,255,.28) !important;
    background: rgba(255,255,255,.08) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
}

.bhd-v61-why-value {
    display: block !important;
    margin-bottom: 7px !important;
    color: #fff !important;
    font-size: clamp(30px, 2.3vw, 40px) !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: -.02em !important;
}

.bhd-v61-why-label {
    display: block !important;
    color: #fff !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
}

@media (max-width: 1180px) {
    .bhd-v6-featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .bhd-v61-why-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 680px) {
    .bhd-v6-featured-grid {
        grid-template-columns: 1fr !important;
        gap: 22px !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
    .bhd-v6-featured-card {
        min-height: 0 !important;
    }
    .bhd-v6-featured-card img {
        height: 250px !important;
        max-height: 250px !important;
        flex-basis: 250px !important;
    }
    .bhd-v6-featured-card h2,
    .bhd-v6-featured-card h3,
    .bhd-v6-featured-card h4,
    .bhd-v6-featured-card p {
        min-height: 0 !important;
    }
    .bhd-v6-why-section {
        padding: 38px 20px 42px !important;
    }
    .bhd-v61-why-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}


/* V6.2 centering refinement for Featured Products */
.bhd-v6-featured-card {
    text-align: center !important;
}

.bhd-v6-featured-card h2,
.bhd-v6-featured-card h3,
.bhd-v6-featured-card h4 {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    align-items: flex-start !important;
}

.bhd-v6-featured-card p {
    width: 100% !important;
    text-align: center !important;
}

.bhd-v6-featured-card .bhd-v6-card-button,
.bhd-v6-featured-card a.bhd-v6-card-button,
.bhd-v6-featured-card .v6-btn,
.bhd-v6-featured-card a.v6-btn,
.bhd-v6-featured-card .btn,
.bhd-v6-featured-card a.btn {
    align-self: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

/* =========================================================
   V6.3.1 SAFE CLEANROOM SOLUTIONS
   Only styles four verified direct child cards.
   Never positions/changes parent sections or other homepage blocks.
   ========================================================= */
.bhd-v631-solutions-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(18px, 1.6vw, 28px) !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.bhd-v631-solution-card {
    position: relative !important;
    min-width: 0 !important;
    min-height: 280px !important;
    height: 280px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    border: 0 !important;
    padding: 0 !important;
    background-image:
        linear-gradient(180deg, rgba(4,31,57,.04) 20%, rgba(4,31,57,.78) 100%),
        var(--bhd-v631-image) !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 8px 24px rgba(8,45,78,.14) !important;
    transform: none !important;
    transition: transform .22s ease, box-shadow .22s ease !important;
}

.bhd-v631-solution-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 30px rgba(8,45,78,.2) !important;
}

.bhd-v631-original-label {
    display: none !important;
}

.bhd-v631-solution-content {
    position: absolute !important;
    inset: 0 !important;
    z-index: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    color: #fff !important;
}

.bhd-v631-solution-title {
    display: block !important;
    margin: 0 0 8px !important;
    color: #fff !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-align: left !important;
    text-shadow: 0 2px 9px rgba(0,0,0,.35) !important;
}

.bhd-v631-solution-cta {
    display: block !important;
    color: rgba(255,255,255,.94) !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
}

/* Neutralize stale V6.3 classes if an old cached DOM somehow survives. */
.bhd-v63-solutions-grid,
.bhd-v63-solutions-section,
.bhd-v63-solution-card,
.bhd-v63-solution-title,
.bhd-v63-solution-label,
.bhd-v63-solution-link {
    transform: none;
}

@media (max-width: 1180px) {
    .bhd-v631-solutions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 680px) {
    .bhd-v631-solutions-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
    .bhd-v631-solution-card {
        min-height: 250px !important;
        height: 250px !important;
    }
}


/* =========================================================
   V6.3.2 CLEANROOM SOLUTIONS REBUILD
   Inserts a new isolated four-card grid below the exact heading.
   Original text-only source is hidden only after the new grid exists.
   ========================================================= */
.bhd-v632-original-solutions-hidden {
    display: none !important;
}

.bhd-v632-solutions-grid {
    width: min(100%, 1500px) !important;
    margin: 28px auto 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(18px, 1.6vw, 28px) !important;
    box-sizing: border-box !important;
}

.bhd-v632-solution-card {
    position: relative !important;
    display: block !important;
    min-width: 0 !important;
    height: 300px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #eaf1f7 !important;
    text-decoration: none !important;
    box-shadow: 0 8px 24px rgba(8,45,78,.14) !important;
    transition: transform .22s ease, box-shadow .22s ease !important;
}

.bhd-v632-solution-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 30px rgba(8,45,78,.22) !important;
}

.bhd-v632-solution-card > img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.bhd-v632-solution-card::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    background: linear-gradient(180deg, rgba(4,31,57,.02) 22%, rgba(4,31,57,.84) 100%) !important;
    pointer-events: none !important;
}

.bhd-v632-solution-overlay {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 24px 22px !important;
    color: #fff !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.bhd-v632-solution-title {
    display: block !important;
    margin: 0 0 8px !important;
    color: #fff !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 8px rgba(0,0,0,.35) !important;
}

.bhd-v632-solution-cta {
    display: inline-block !important;
    color: rgba(255,255,255,.96) !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: .02em !important;
}

@media (max-width: 1180px) {
    .bhd-v632-solutions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 680px) {
    .bhd-v632-solutions-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
        margin-top: 20px !important;
    }
    .bhd-v632-solution-card {
        height: 260px !important;
    }
}


/* =========================================================
   V6.4 GLOBAL PROJECTS + FINAL CTA CENTERING
   ========================================================= */
.bhd-v64-projects-heading {
    width: 100% !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.bhd-v64-projects-section {
    text-align: center !important;
}

.bhd-v64-projects-grid {
    align-items: stretch !important;
}

.bhd-v64-project-card {
    position: relative !important;
    text-align: center !important;
    overflow: hidden !important;
    transition: transform .22s ease, box-shadow .22s ease !important;
}

.bhd-v64-project-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 30px rgba(7,50,88,.16) !important;
}

.bhd-v64-project-card img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.bhd-v64-project-title,
.bhd-v64-project-card h2,
.bhd-v64-project-card h3,
.bhd-v64-project-card h4,
.bhd-v64-project-card > a:not(.bhd-v64-project-overlay-link) {
    text-align: center !important;
    justify-content: center !important;
}

.bhd-v64-project-cta {
    position: relative !important;
    z-index: 6 !important;
    display: block !important;
    width: 100% !important;
    margin: 8px auto 18px !important;
    color: #005fc5 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    text-align: center !important;
}

.bhd-v64-project-overlay-link {
    position: absolute !important;
    inset: 0 !important;
    z-index: 5 !important;
    display: block !important;
    background: transparent !important;
    text-decoration: none !important;
}

.bhd-v64-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.bhd-v64-final-cta {
    box-sizing: border-box !important;
    text-align: center !important;
}

.bhd-v64-final-cta-heading,
.bhd-v64-final-cta h1,
.bhd-v64-final-cta h2,
.bhd-v64-final-cta h3,
.bhd-v64-final-cta-copy,
.bhd-v64-final-cta p {
    width: 100% !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

.bhd-v64-final-cta-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

.bhd-v64-case-anchor {
    scroll-margin-top: 110px !important;
}
