/* NDTC Responsive Spacing System */
:root {
    --section-space: 80px;
    --section-space2: 76px;

    --ndtc-space-section-xl: 80px;
    --ndtc-space-section-lg: 64px;
    --ndtc-space-section-md: 52px;
    --ndtc-space-section-sm: 40px;

    --ndtc-space-page-header-xl: 88px;
    --ndtc-space-page-header-lg: 72px;
    --ndtc-space-page-header-md: 56px;
    --ndtc-space-page-header-sm: 44px;
}

/* Section padding */
.section-space {
    padding-top: var(--ndtc-space-section-xl);
    padding-bottom: var(--ndtc-space-section-xl);
}

.section-space2 {
    padding-top: var(--section-space2);
    padding-bottom: var(--ndtc-space-section-xl);
}

.section-space-top,
.section-space-top2 {
    padding-top: var(--ndtc-space-section-xl);
}

.section-space-bottom,
.section-space-bottom2 {
    padding-bottom: var(--ndtc-space-section-xl);
}

/* Row gutters */
@media (max-width: 991px) {
    .section-space {
        padding-top: var(--ndtc-space-section-lg);
        padding-bottom: var(--ndtc-space-section-lg);
    }

    .section-space2 {
        padding-top: var(--ndtc-space-section-lg);
        padding-bottom: var(--ndtc-space-section-lg);
    }

    .section-space-top,
    .section-space-top2 {
        padding-top: var(--ndtc-space-section-lg);
    }

    .section-space-bottom,
    .section-space-bottom2 {
        padding-bottom: var(--ndtc-space-section-lg);
    }

    .page-header {
        padding-top: var(--ndtc-space-page-header-lg);
        padding-bottom: var(--ndtc-space-page-header-lg);
    }

    .product-page {
        padding-top: 64px;
    }

    .service-details__policies {
        padding: 48px 0;
    }

    .consultations-two__top {
        margin-bottom: 48px;
    }

    .sec-title {
        margin-bottom: 40px;
    }

    .gutter-y-60 {
        --bs-gutter-y: 40px;
    }

    .gutter-y-50 {
        --bs-gutter-y: 32px;
    }

    .gutter-y-40 {
        --bs-gutter-y: 28px;
    }
}

@media (max-width: 767px) {
    .section-space {
        padding-top: var(--ndtc-space-section-md);
        padding-bottom: var(--ndtc-space-section-md);
    }

    .section-space2 {
        padding-top: var(--ndtc-space-section-md);
        padding-bottom: var(--ndtc-space-section-md);
    }

    .section-space-top,
    .section-space-top2 {
        padding-top: var(--ndtc-space-section-md);
    }

    .section-space-bottom,
    .section-space-bottom2 {
        padding-bottom: var(--ndtc-space-section-md);
    }

    .page-header {
        padding-top: var(--ndtc-space-page-header-md);
        padding-bottom: var(--ndtc-space-page-header-md);
    }

    .page-header__title {
        margin-bottom: 10px;
    }

    .product-page {
        padding-top: 48px;
    }

    .service-details__content {
        margin-top: 36px;
    }

    .service-details__policies {
        padding: 36px 0;
    }

    .service-details__policies__image img {
        height: 260px;
    }

    .service-details__policies__content {
        padding: 8px 0 0;
    }

    .consultations-two__top {
        margin-bottom: 36px;
    }

    .sec-title {
        margin-bottom: 32px;
    }

    .sec-title__top {
        margin-bottom: 18px;
    }

    .all-products-overview {
        margin-top: 2.5rem;
    }

    .gutter-y-60 {
        --bs-gutter-y: 30px;
    }

    .gutter-y-50 {
        --bs-gutter-y: 28px;
    }

    .gutter-y-40 {
        --bs-gutter-y: 24px;
    }

    .gutter-y-30 {
        --bs-gutter-y: 22px;
    }
}

@media (max-width: 575px) {
    .section-space {
        padding-top: var(--ndtc-space-section-sm);
        padding-bottom: var(--ndtc-space-section-sm);
    }

    .section-space2 {
        padding-top: var(--ndtc-space-section-sm);
        padding-bottom: var(--ndtc-space-section-sm);
    }

    .section-space-top,
    .section-space-top2 {
        padding-top: var(--ndtc-space-section-sm);
    }

    .section-space-bottom,
    .section-space-bottom2 {
        padding-bottom: var(--ndtc-space-section-sm);
    }

    .page-header {
        padding-top: var(--ndtc-space-page-header-sm);
        padding-bottom: var(--ndtc-space-page-header-sm);
    }

    .product-page {
        padding-top: 40px;
    }

    .service-details__policies {
        padding: 28px 0;
    }

    .service-details__policies__image img {
        height: 220px;
    }

    .service-details__policies__list li {
        margin-bottom: 10px;
    }

    .service-details__policies__list p {
        padding-left: 20px;
    }

    .consultations-two__top {
        margin-bottom: 28px;
    }

    .sec-title {
        margin-bottom: 24px;
    }

    .all-products-overview {
        margin-top: 1.5rem;
    }

    .gutter-y-60,
    .gutter-y-50 {
        --bs-gutter-y: 24px;
    }

    .gutter-y-40,
    .gutter-y-30 {
        --bs-gutter-y: 20px;
    }
}

@media (max-width: 767px) {
    .product-page .row.gutter-y-60 > .col-lg-4 {
        margin-top: 8px;
    }
}

/* Language switcher (GTranslate) */
.topbar,
.topbar__right,
.topbar__language,
.main-header,
.main-header__inner,
.main-header__right,
.sticky-header--cloned,
.sticky-header--cloned .main-header__inner,
.sticky-header--cloned .main-header__right {
    overflow: visible !important;
}

.topbar__language {
    position: relative;
    top: 0;
    flex-shrink: 0;
    z-index: 10050;
    overflow: visible !important;
}

.main-header__right .topbar__language {
    margin-right: 14px;
}

.topbar__language .gt_switcher {
    width: auto !important;
    min-width: 36px;
    position: relative;
    z-index: 10050;
    overflow: visible !important;
    font-family: var(--insuba-font, "Roboto", sans-serif);
    line-height: 1.2 !important;
}

.topbar__language .gt_switcher .gt_selected {
    width: auto;
    position: relative;
    z-index: 2;
    background: transparent !important;
}

/* Trigger: flag only, blends with header/topbar */
.topbar__language .gt_switcher .gt_selected a,
.topbar__language .gt_switcher .gt_selected a:hover {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    color: inherit !important;
    line-height: 1 !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 0 !important;
    overflow: visible;
    box-sizing: border-box !important;
    transition: opacity 0.2s ease;
}

.topbar__language .gt_switcher .gt_selected a:hover {
    opacity: 0.82;
}

.topbar__language .gt_switcher .gt_selected a:after {
    display: none !important;
}

.topbar__language .gt_switcher .gt_selected img {
    width: 24px !important;
    height: auto !important;
    max-height: 18px;
    object-fit: contain;
    display: inline-block !important;
    opacity: 1 !important;
    margin: 0 !important;
}

/* Dropdown panel — closed */
.topbar__language .gt_switcher .gt_option {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: auto !important;
    right: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    z-index: 10051 !important;
    box-sizing: border-box !important;
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: none !important;
}

/* Dropdown panel — open */
.topbar__language .gt_switcher:has(.gt_selected a.open) .gt_option {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    min-width: 156px !important;
    padding: 6px 0 !important;
    background: #fff !important;
    border: 1px solid rgba(var(--insuba-base-rgb, 46, 94, 170), 0.12) !important;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 53, 100, 0.12);
    max-height: min(280px, 50vh) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: none !important;
}

.topbar__language .gt_switcher .gt_option::-webkit-scrollbar {
    width: 4px;
}

.topbar__language .gt_switcher .gt_option::-webkit-scrollbar-thumb {
    background: rgba(var(--insuba-base-rgb, 46, 94, 170), 0.25);
    border-radius: 999px;
}

/* Each language row: flag + label */
.topbar__language .gt_switcher .gt_option a {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 42px;
    padding: 8px 14px !important;
    margin: 0 !important;
    font-size: var(--ndtc-text-sm, 0.875rem) !important;
    font-weight: 400;
    line-height: var(--ndtc-leading-snug, 1.35) !important;
    color: var(--insuba-black, #122f51) !important;
    background: #fff !important;
    border: 0 !important;
    white-space: nowrap;
    box-sizing: border-box !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.topbar__language .gt_switcher .gt_option a.gt-current {
    display: none !important;
}

.topbar__language .gt_switcher .gt_option a:not(:last-child) {
    border-bottom: 1px solid rgba(var(--insuba-base-rgb, 46, 94, 170), 0.07);
}

.topbar__language .gt_switcher .gt_option a:hover {
    background-color: rgba(var(--insuba-base-rgb, 46, 94, 170), 0.07) !important;
    color: var(--insuba-base, #2e5eaa) !important;
}

.topbar__language .gt_switcher .gt_option a img {
    width: 22px !important;
    height: auto !important;
    max-height: 16px;
    flex-shrink: 0;
    object-fit: contain;
    display: inline-block !important;
    opacity: 1 !important;
    margin: 0 !important;
}

.topbar__language .gt_switcher .gt_option a span {
    font-size: inherit !important;
    line-height: inherit;
}

.sticky-header--cloned.active .main-header__right {
    display: flex;
    align-items: center;
    overflow: visible !important;
}

.sticky-header--cloned .main-header__right .topbar__language {
    display: block;
}

/* Mobile / tablet header layout */
@media (max-width: 1199px) {
    .main-header__right {
        gap: 0;
    }

    .main-header__right .topbar__language {
        margin-right: 12px;
    }

    .topbar__language .gt_switcher:has(.gt_selected a.open) .gt_option {
        min-width: 148px !important;
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 8px;
        padding: 4px 0 !important;
    }

    .topbar__language .gt_switcher:has(.gt_selected a.open) .gt_option a {
        min-height: 40px;
        padding: 7px 12px !important;
        background: #fff !important;
    }

    .topbar__language .gt_switcher:has(.gt_selected a.open) .gt_option a:not(:last-child) {
        border-bottom: none;
    }

    .topbar__language .gt_switcher:has(.gt_selected a.open) .gt_option a:hover {
        background-color: rgba(var(--insuba-base-rgb, 46, 94, 170), 0.08) !important;
    }
}

@media (max-width: 575px) {
    .topbar__language {
        margin-left: 0 !important;
    }

    .topbar__language .gt_switcher .gt_selected a,
    .topbar__language .gt_switcher .gt_selected a:hover {
        width: 34px !important;
        height: 34px !important;
    }

    .topbar__language .gt_switcher .gt_selected img {
        width: 22px !important;
        max-height: 16px;
    }

    .topbar__language .gt_switcher:has(.gt_selected a.open) .gt_option {
        min-width: 140px !important;
    }

    .topbar__language .gt_switcher:has(.gt_selected a.open) .gt_option a {
        min-height: 38px;
        padding: 6px 10px !important;
        gap: 8px;
    }

    .main-header__right .topbar__language {
        margin-right: 10px;
    }
}

.scroll-to-top {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--insuba-base, #2e5eaa);
    color: #fff;
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) !important;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(var(--insuba-base-rgb, 46, 94, 170), 0.35);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
    text-decoration: none;
}

.scroll-to-top__text,
.scroll-to-top__wrapper,
.scroll-to-top__inner {
    display: none !important;
}

.scroll-to-top__icon {
    font-size: 18px;
    line-height: 1;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) !important;
    bottom: 28px;
    right: 28px;
}

.scroll-to-top:hover,
.scroll-to-top:focus {
    background-color: var(--insuba-gray6, #3c5c83);
    color: #fff;
    outline: none;
}

@media (max-width: 991px) {
    .scroll-to-top,
    .scroll-to-top.show {
        width: 46px;
        height: 46px;
        bottom: 22px;
        right: 20px;
    }
}

@media (max-width: 575px) {
    .scroll-to-top,
    .scroll-to-top.show {
        width: 44px;
        height: 44px;
        bottom: 18px;
        right: 16px;
    }

    .scroll-to-top__icon {
        font-size: 16px;
    }
}

/* Footer layout */
.ndtc-footer.main-footer--home-2 .main-footer__top {
    padding-top: clamp(64px, 5vw, 96px);
    padding-bottom: clamp(48px, 4vw, 72px);
}

.ndtc-footer__grid {
    align-items: flex-start;
}

.ndtc-footer .footer-widget__title {
    margin-bottom: 24px;
    font-size: var(--ndtc-text-lg, 1.125rem);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ndtc-footer .footer-widget__title::after {
    width: 36px;
    height: 3px;
    border-radius: 999px;
    background: var(--insuba-base, #2e5eaa);
}

.ndtc-footer__about-logo {
    display: inline-block;
    margin-bottom: 18px;
}

.ndtc-footer__about-logo img {
    max-width: 180px;
    height: auto;
}

.ndtc-footer__about-info {
    display: grid;
    gap: 12px;
}

.ndtc-footer__about-card.ndtc-footer__contact-card {
    max-width: 100%;
}

.ndtc-footer__about-card .ndtc-footer__company-name {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--ndtc-text-md, 1rem);
    line-height: var(--ndtc-leading-snug, 1.35);
}

.ndtc-footer__about-card .ndtc-footer__contact-list {
    margin: 0;
}

.ndtc-footer__links .footer-widget__links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
}

.ndtc-footer__links .footer-widget__links li + li {
    margin-top: 0;
}

.ndtc-footer__links .footer-widget__links li {
    font-size: var(--ndtc-text-sm, 0.875rem);
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0.01em;
}

.ndtc-footer__links .footer-widget__links li a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0;
    padding-left: 0;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: none;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    min-width: 0;
    word-break: break-word;
}

.ndtc-footer__links .footer-widget__links li:first-child a {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ndtc-footer__links .footer-widget__links li a::before {
    display: none;
}

.ndtc-footer__links .footer-widget__links li a::after {
    content: "";
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
    opacity: 0.45;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: translateX(-0.25rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ndtc-footer__links .footer-widget__links li a:hover {
    color: #fff;
    padding-left: 0;
    border-color: rgba(255, 255, 255, 0.18);
}

.ndtc-footer__links .footer-widget__links li a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.ndtc-footer__contact-grid {
    display: grid;
    gap: 16px;
}

.ndtc-footer__contact-card {
    padding: 18px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
}

.ndtc-footer__contact-card-title {
    margin: 0 0 12px;
    font-size: var(--ndtc-text-sm, 0.875rem);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.ndtc-footer__contact-list {
    margin: 0;
}

.ndtc-footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ndtc-footer__contact-item + .ndtc-footer__contact-item {
    margin-top: 10px;
}

.ndtc-footer__contact-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
}

.ndtc-footer__contact-icon--phone i {
    transform: scaleX(-1);
}

.ndtc-footer__contact-text {
    flex: 1;
    min-width: 0;
    font-size: var(--ndtc-text-sm, 0.875rem);
    line-height: var(--ndtc-leading-normal, 1.6);
    color: rgba(255, 255, 255, 0.88);
}

.ndtc-footer__contact-text a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ndtc-footer__contact-text a:hover {
    color: #fff;
}

.ndtc-footer__bottom.main-footer__bottom {
    background: linear-gradient(90deg, rgba(15, 54, 103, 1) 0%, rgba(46, 94, 170, 1) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ndtc-footer__bottom .main-footer__bottom__inner {
    padding: 8px 0;
}

.ndtc-footer__bottom .main-footer__copyright {
    font-size: var(--ndtc-text-xs, 0.75rem);
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.88);
}

@media (min-width: 992px) {
    .ndtc-footer__contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1199px) {
    .ndtc-footer__about-info,
    .ndtc-footer__about-card.ndtc-footer__contact-card {
        max-width: none;
    }
}

@media (max-width: 767px) {
    .ndtc-footer .main-footer__shape-one,
    .ndtc-footer .main-footer__shape-two {
        opacity: 0.35;
    }
}

@media (max-width: 575px) {
    .ndtc-footer__contact-card,
    .ndtc-footer__about-card {
        padding: 14px 16px;
    }

    .ndtc-footer__links .footer-widget__links li a {
        padding: 0.5625rem 0;
    }
}

/* About Us – Hành trình phát triển (snake / S-curve timeline) */
.about-timeline {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #e8eef6 0%, #f0f4f9 100%);
}

.about-timeline__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 8%, rgba(3, 101, 211, 0.06), transparent 36%),
        radial-gradient(circle at 88% 92%, rgba(26, 127, 232, 0.05), transparent 38%);
}

.about-timeline .container {
    position: relative;
    z-index: 1;
}

.about-timeline .sec-title {
    margin-bottom: 2.5rem;
}

.about-timeline__snake {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.about-timeline--snake {
    --wpt-zone: 13.5rem;
    --wpt-circle-size: 6.875rem;
    --wpt-circle-r: calc(var(--wpt-circle-size) / 2);
    --wpt-axis: calc(var(--wpt-zone) + var(--wpt-circle-r));
    --wpt-gap-height: 1.5rem;
    --wpt-text-gap: 2rem;
}

.about-timeline--snake .wpt-track {
    padding: 0.5rem 0 2rem;
}

.about-timeline--snake .wpt-text {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    max-width: 10.5rem;
    margin: 0 auto;
    padding: 0.875rem 1rem;
    text-align: center;
    color: #1e3a5f;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.82);
    border-radius: 0.625rem;
    border: 0.0625rem solid rgba(3, 101, 211, 0.1);
    border-left: 0.25rem solid #0365d3;
    box-shadow: 0 0.25rem 0.875rem rgba(15, 54, 103, 0.06);
    box-sizing: border-box;
}

/* Desktop: tách chữ khỏi vạch nét đứt */
@media (min-width: 992px) {
    .about-timeline--snake .wpt-top,
    .about-timeline--snake .wpt-bottom {
        min-height: var(--wpt-zone);
        height: auto;
        box-sizing: border-box;
    }

    .about-timeline--snake .wpt-item--desc-top .wpt-top {
        padding-bottom: var(--wpt-text-gap);
        justify-content: flex-end;
    }

    .about-timeline--snake .wpt-item--desc-bottom .wpt-bottom {
        padding-top: var(--wpt-text-gap);
        justify-content: flex-start;
    }

    .about-timeline--snake .wpt-circle {
        width: var(--wpt-circle-size);
        height: var(--wpt-circle-size);
    }

    .about-timeline--snake .wpt-row::before {
        top: var(--wpt-axis);
    }

    .about-timeline--snake .wpt-row:not(:last-child) .wpt-item:last-child::after {
        top: var(--wpt-axis);
        height: auto;
        bottom: 0;
    }

    .about-timeline--snake .wpt-row--connected .wpt-item:first-child::before {
        height: var(--wpt-axis);
    }

    .about-timeline--snake .wpt-row-gap {
        height: var(--wpt-gap-height);
        margin: 0.5rem 0;
    }

    .about-timeline--snake .wpt-row--connected {
        margin-top: 0.75rem;
    }
}

/* Connector offsets when a row has fewer than 4 milestones */
.about-timeline--snake .wpt-row--cols-3::before {
    left: 16.666%;
    right: 16.666%;
}

.about-timeline--snake .wpt-row--cols-3 + .wpt-row-gap::before {
    right: 16.666%;
    width: 33.333%;
}

.about-timeline--snake .wpt-row--cols-3 + .wpt-row-gap::after {
    left: 16.666%;
    width: 33.333%;
}

.about-timeline--snake .wpt-row--cols-2::before {
    left: 25%;
    right: 25%;
}

.about-timeline--snake .wpt-row--cols-2 + .wpt-row-gap::before {
    right: 25%;
    width: 25%;
}

.about-timeline--snake .wpt-row--cols-2 + .wpt-row-gap::after {
    left: 25%;
    width: 25%;
}

.about-timeline--snake .wpt-row--cols-1::before {
    display: none;
}

.about-timeline__bottom-img {
    margin-top: 3rem;
    border-radius: 1rem;
    overflow: hidden;
    line-height: 0;
    box-shadow: 0 1rem 2.5rem rgba(15, 54, 103, 0.1);
}

.about-timeline__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

@media (min-width: 1200px) {
    .about-timeline .sec-title {
        margin-bottom: 3rem;
    }

    .about-timeline--snake .wpt-text {
        max-width: 11.25rem;
    }
}

/* Tablet + mobile: timeline dọc, vạch nối liền không vỡ */
@media (max-width: 991px) {
    .about-timeline .sec-title {
        margin-bottom: 2rem;
    }

    .about-timeline__snake {
        padding: 0;
        --wpt-circle-size: 5rem;
        --wpt-circle-r: calc(var(--wpt-circle-size) / 2);
        --wpt-line-x: calc(var(--wpt-circle-r) + 0.125rem);
        --wpt-item-gap: 2.25rem;
    }

    .about-timeline__bottom-img {
        margin-top: 2rem;
    }

    .about-timeline--snake .wpt-track {
        display: flex;
        flex-direction: column;
        gap: var(--wpt-item-gap);
        position: relative;
        padding: 0.25rem 0 1.5rem;
    }

    .about-timeline--snake .wpt-track::before {
        content: '';
        position: absolute;
        top: var(--wpt-circle-r);
        bottom: var(--wpt-circle-r);
        left: var(--wpt-line-x);
        border-left: 2px dashed rgba(3, 101, 211, 0.45);
        z-index: 0;
        pointer-events: none;
    }

    .about-timeline--snake .wpt-row-gap {
        display: none !important;
    }

    /* Gộp các hàng desktop thành một cột liên tục */
    .about-timeline--snake .wpt-row {
        display: contents;
    }

    .about-timeline--snake .wpt-row::before,
    .about-timeline--snake .wpt-row::after,
    .about-timeline--snake .wpt-row:not(:last-child)::after,
    .about-timeline--snake .wpt-row--connected::after,
    .about-timeline--snake .wpt-row:not(:last-child) .wpt-item:last-child::after,
    .about-timeline--snake .wpt-row--connected .wpt-item:first-child::before {
        display: none !important;
        content: none !important;
    }

    .about-timeline--snake .wpt-row--connected {
        margin-top: 0;
        padding-top: 0;
    }

    .about-timeline--snake .wpt-item {
        display: grid !important;
        grid-template-columns: var(--wpt-circle-size) minmax(0, 1fr);
        column-gap: 1.25rem;
        align-items: center;
        flex: none !important;
        max-width: 100% !important;
        width: 100%;
        padding: 0 !important;
        margin: 0;
        position: relative;
        z-index: 1;
    }

    .about-timeline--snake .wpt-circle {
        grid-column: 1;
        grid-row: 1;
        width: var(--wpt-circle-size) !important;
        height: var(--wpt-circle-size) !important;
        order: unset !important;
        margin: 0;
        justify-self: center;
        align-self: start;
        margin-top: 0.125rem;
        position: relative;
        z-index: 2;
    }

    .about-timeline--snake .wpt-top,
    .about-timeline--snake .wpt-bottom {
        grid-column: 2;
        grid-row: 1;
        display: flex !important;
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: center !important;
        min-height: 0;
        height: auto;
        padding: 0 !important;
        text-align: left !important;
        order: unset !important;
    }

    .about-timeline--snake .wpt-top:empty,
    .about-timeline--snake .wpt-bottom:empty {
        display: none !important;
    }

    .about-timeline--snake .wpt-text {
        max-width: none;
        margin: 0;
        text-align: left !important;
    }
}

@media (max-width: 575px) {
    .about-timeline .sec-title {
        margin-bottom: 1.75rem;
    }

    .about-timeline--snake {
        --wpt-circle-size: 4.5rem;
        --wpt-item-gap: 2rem;
    }

    .about-timeline--snake .wpt-item {
        column-gap: 1rem;
    }

    .about-timeline--snake .wpt-text {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
        line-height: 1.6;
    }
}

/* About Us – Máy móc: thẻ dùng <img> (không background-image) */
.portfolio-two--section .portfolio-two__machines {
    position: relative;
    z-index: 1;
}

.portfolio-two--section .portfolio-two__grid .portfolio-card-two--img {
    display: block;
    padding: 0;
    min-height: 0;
    aspect-ratio: auto;
    background: none !important;
    background-image: none !important;
    overflow: hidden;
}

.portfolio-two--section .portfolio-two__grid .portfolio-card-two--img::before {
    display: none !important;
    content: none !important;
    background-image: none !important;
}

.portfolio-two--section .portfolio-two__grid .portfolio-card-two--img:hover::before {
    transform: none !important;
}

.portfolio-two--section .portfolio-two__grid .portfolio-card-two__media {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #eef2f7;
    line-height: 0;
}

.portfolio-two--section .portfolio-two__grid .portfolio-card-two__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.portfolio-two--section .portfolio-two__grid .portfolio-card-two--img .portfolio-card-two__content {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: auto;
    max-height: none;
    opacity: 1;
    transform: none;
    align-items: flex-end;
    background: linear-gradient(
        180deg,
        rgba(15, 53, 103, 0.05) 0%,
        rgba(15, 53, 103, 0.35) 45%,
        rgba(3, 101, 211, 0.92) 100%
    );
}

/* Desktop: masonry gốc – chiều cao ảnh cố định để không bị lệch hàng */
@media (min-width: 1200px) {
    .portfolio-two--section .portfolio-two__grid.row {
        display: flex !important;
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 2.5rem;
        margin-left: calc(-0.5 * var(--bs-gutter-x, 30px));
        margin-right: calc(-0.5 * var(--bs-gutter-x, 30px));
    }

    .portfolio-two--section .portfolio-two__grid > .column-3 {
        width: 29.927% !important;
        max-width: 29.927% !important;
        flex: 0 0 29.927% !important;
    }

    .portfolio-two--section .portfolio-two__grid > .column-4 {
        width: 40.146% !important;
        max-width: 40.146% !important;
        flex: 0 0 40.146% !important;
    }

    .portfolio-two--section .portfolio-two__grid > .column-6 {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
    }

    .portfolio-two--section .portfolio-two__grid > [class*="column-"] {
        padding-left: calc(var(--bs-gutter-x, 30px) * 0.5);
        padding-right: calc(var(--bs-gutter-x, 30px) * 0.5);
        margin-top: 0;
        margin-bottom: 0;
        min-width: 0;
        box-sizing: border-box;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two--img {
        width: 100%;
        height: auto;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__media {
        height: 21.875rem;
        aspect-ratio: auto;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two--lg .portfolio-card-two__media {
        height: 21.875rem;
        aspect-ratio: auto;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }
}

/* Tablet: lưới 2 cột, có khoảng cách ngang/dọc */
@media (min-width: 768px) and (max-width: 1199px) {
    .portfolio-two--section .portfolio-two__machines.container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        box-sizing: border-box;
    }

    .portfolio-two--section .portfolio-two__grid.row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1.5rem;
        row-gap: 1.5rem;
        gap: 1.5rem;
        align-items: stretch;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex-wrap: unset !important;
    }

    .portfolio-two--section .portfolio-two__grid > .column-3,
    .portfolio-two--section .portfolio-two__grid > .column-4,
    .portfolio-two--section .portfolio-two__grid > .column-6,
    .portfolio-two--section .portfolio-two__grid > [class*="column-"] {
        width: auto !important;
        max-width: none !important;
        flex: none !important;
        margin: 0;
        padding: 0 !important;
        min-width: 0;
    }

    .portfolio-two--section .portfolio-two__grid > [class*="column-"]:last-child {
        grid-column: 1 / -1;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two--img {
        width: 100%;
        height: 100%;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__media {
        aspect-ratio: 5 / 4;
        min-height: 18.75rem;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .portfolio-two--section .portfolio-two__machines.container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .portfolio-two--section .portfolio-two__grid.row {
        column-gap: 1.875rem;
        row-gap: 1.875rem;
        gap: 1.875rem;
    }
}

/* Mobile: 1 cột, ảnh trọn trong khung (object-fit: contain) */
@media (max-width: 767px) {
    .portfolio-two--section .portfolio-two__grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin-left: 0;
        margin-right: 0;
    }

    .portfolio-two--section .portfolio-two__grid > [class*="column-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__media {
        display: block;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__image {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: center center;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two--img .portfolio-card-two__content {
        padding: 1.25rem 1rem 1.125rem;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__title {
        font-size: 1.25rem;
    }

    .portfolio-two--section .portfolio-two__grid .portfolio-card-two__text {
        font-size: 0.875rem;
        line-height: 1.55;
    }
}

