/* ==========================================================
   HV Tech Showcase – Banner công nghệ + công nghệ nổi bật
   ========================================================== */
.hv-tech {
    --hv-t-primary: var(--e-global-color-primary, #6F5E4B);
    --hv-t-accent: var(--e-global-color-secondary, #922B2A);
    --hv-t-overlay: #2c241c;
    --hv-t-text: #1d2733;
    --hv-t-muted: #5b6672;
    --hv-t-border: #e6e8eb;
    --hv-t-hero-h: 520px;
    --hv-t-radius: 22px;
    font-family: var(--e-global-typography-primary-font-family, "Roboto Flex"), sans-serif;
    color: var(--hv-t-text);
}

/* ==========================================================
   1. Banner
   ========================================================== */
.hv-tech__hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: var(--hv-t-hero-h);
    overflow: hidden;
    border-radius: var(--hv-t-radius);
    background: var(--hv-t-overlay);
    isolation: isolate;
}

.hv-tech__hero-img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    object-position: right center;
    transform: scale(1.02);
    transition: transform 1.6s cubic-bezier(.2, .7, .2, 1);
}

.hv-tech__hero:hover .hv-tech__hero-img {
    transform: scale(1.06);
}

/* Lớp phủ xanh navy chuyển dần từ trái sang */
.hv-tech__hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, var(--hv-t-overlay) 0%, color-mix(in srgb, var(--hv-t-overlay) 88%, transparent) 32%, color-mix(in srgb, var(--hv-t-overlay) 35%, transparent) 62%, transparent 85%),
        linear-gradient(0deg, color-mix(in srgb, var(--hv-t-overlay) 45%, transparent) 0%, transparent 40%);
}

.hv-tech__hero-content {
    position: relative;
    max-width: 660px;
    padding: 64px 56px;
    color: #fff;
}

.hv-tech__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #e2c79f;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.hv-tech__eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
}

.hv-tech__title {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(28px, 3.2vw, 44px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.hv-tech__desc {
    margin: 0;
    max-width: 440px;
    color: rgba(255, 255, 255, .82);
    font-size: 16px;
    line-height: 1.7;
}

.hv-tech__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding: 13px 26px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    color: #fff !important;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .25s ease, border-color .25s ease, color .25s ease;
}

.hv-tech__btn:hover {
    background: #fff;
    border-color: #fff;
    color: var(--hv-t-primary) !important;
}

.hv-tech__btn svg {
    transition: transform .25s ease;
}

.hv-tech__btn:hover svg {
    transform: translateX(4px);
}

/* ==========================================================
   2. Công nghệ nổi bật
   ========================================================== */
.hv-tech__features {
    margin-top: 48px;
    scroll-margin-top: 140px;
}

.hv-tech__features .hv-sheading {
    margin-bottom: 24px;
}

/* ---------- Kiểu thẻ ---------- */
.hv-tech__cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.hv-tech__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--hv-t-border);
    border-radius: 18px;
    background: #fff;
    color: var(--hv-t-text) !important;
    text-decoration: none !important;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.hv-tech__card:hover {
    transform: translateY(-6px);
    border-color: transparent;
    box-shadow: 0 20px 44px rgba(16, 24, 40, .12);
}

.hv-tech__card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef1f4;
}

.hv-tech__card-media img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.hv-tech__card:hover .hv-tech__card-media img {
    transform: scale(1.07);
}

/* Icon nằm vắt giữa ảnh và nội dung */
.hv-tech__card-icon {
    position: absolute;
    left: 20px;
    top: -23px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 3px solid #fff;
    border-radius: 14px;
    background: var(--hv-t-primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(111, 94, 75, .3);
    transition: background .3s ease;
}

.hv-tech__card:hover .hv-tech__card-icon {
    background: var(--hv-ink, #1f1f1f);
}

.hv-tech__card-body {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 36px 20px 22px;
}

.hv-tech__card-title {
    padding-right: 44px;
    color: var(--hv-t-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.hv-tech__card-text {
    color: var(--hv-t-muted);
    font-size: 14px;
    line-height: 1.6;
}

.hv-tech__card-arrow {
    position: absolute;
    top: 30px;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--hv-t-border);
    border-radius: 50%;
    color: var(--hv-t-primary);
    transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}

.hv-tech__card:hover .hv-tech__card-arrow {
    background: var(--hv-t-primary);
    border-color: var(--hv-t-primary);
    color: #fff;
    transform: translateX(3px);
}

/* ---------- Kiểu tab ---------- */
.hv-tech__tabs {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--hv-t-border);
    border-radius: var(--hv-t-radius);
    background: #fff;
}

.hv-tech__tabs-media {
    position: relative;
    min-height: 460px;
    background: #eef1f4;
}

.hv-tech__tabs-img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity .6s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1);
}

.hv-tech__tabs-img.is-active {
    opacity: 1;
    transform: none;
}

.hv-tech__tabs-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 28px 36px 36px;
}

.hv-tech__tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
    padding: 5px;
    border-radius: 16px;
    background: #f1f3f6;
    scrollbar-width: none;
}

.hv-tech__tabs-nav::-webkit-scrollbar {
    display: none;
}

.hv-tech .hv-tech__tab {
    flex: 1 0 auto;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--hv-t-muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}

.hv-tech .hv-tech__tab:hover,
.hv-tech .hv-tech__tab:focus {
    background: rgba(111, 94, 75, .06);
    color: var(--hv-t-primary);
}

.hv-tech .hv-tech__tab.is-active {
    background: var(--hv-t-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(111, 94, 75, .25);
}

.hv-tech__pane {
    animation: hv-tech-fade .5s ease both;
}

.hv-tech__pane[hidden] {
    display: none;
}

@keyframes hv-tech-fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hv-tech__pane-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(111, 94, 75, .08);
    color: var(--hv-t-primary);
}

.hv-tech__pane-title {
    margin: 0 0 10px;
    color: var(--hv-t-primary);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
}

.hv-tech__pane-text {
    margin: 0 0 18px;
    color: var(--hv-t-muted);
    font-size: 15.5px;
    line-height: 1.7;
}

.hv-tech__pane-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-tech__pane-list li {
    position: relative;
    margin: 0;
    padding-left: 32px;
    color: var(--hv-t-text);
    font-size: 15px;
    font-weight: 500;
    line-height: 22px;
}

.hv-tech__pane-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--hv-t-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.hv-tech__pane-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    color: var(--hv-t-primary) !important;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none !important;
}

.hv-tech__pane-link:hover {
    color: var(--hv-t-accent) !important;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1024px) {
    .hv-tech {
        --hv-t-hero-h: 440px;
    }

    .hv-tech__hero-content {
        padding: 48px 36px;
    }

    .hv-tech__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hv-tech__tabs {
        grid-template-columns: minmax(0, 1fr);
    }

    .hv-tech__tabs-media {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 767px) {
    .hv-tech {
        --hv-t-radius: 18px;
    }

    /* Banner mobile: ảnh trên, chữ đè phần dưới */
    .hv-tech__hero {
        align-items: flex-end;
        min-height: 480px;
    }

    .hv-tech__hero-img {
        object-position: 70% center;
    }

    .hv-tech__hero::before {
        background: linear-gradient(180deg, transparent 15%, color-mix(in srgb, var(--hv-t-overlay) 75%, transparent) 50%, var(--hv-t-overlay) 100%);
    }

    .hv-tech__hero-content {
        padding: 28px 22px;
    }

    .hv-tech__title {
        font-size: 26px;
    }

    .hv-tech__desc {
        font-size: 14.5px;
    }

    .hv-tech__btn {
        margin-top: 20px;
        padding: 11px 20px;
        font-size: 13.5px;
    }

    .hv-tech__features {
        margin-top: 32px;
    }

    .hv-tech__cards {
        gap: 12px;
    }

    .hv-tech__card-body {
        padding: 30px 14px 16px;
        gap: 6px;
    }

    .hv-tech__card-icon {
        left: 14px;
        top: -19px;
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .hv-tech__card-icon svg {
        width: 18px;
        height: 18px;
    }

    .hv-tech__card-title {
        padding-right: 0;
        font-size: 14.5px;
    }

    .hv-tech__card-text {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 12.5px;
    }

    .hv-tech__card-arrow {
        display: none;
    }

    .hv-tech__tabs-panel {
        padding: 18px 16px 24px;
    }

    .hv-tech__tabs-nav {
        margin-bottom: 20px;
    }

    .hv-tech__pane-title {
        font-size: 21px;
    }

    .hv-tech__pane-text {
        font-size: 14.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hv-tech *,
    .hv-tech *::before {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================
   Phần "Các công nghệ nổi bật" ẩn sẵn – mở khi rê / bấm nút banner
   Chỉ ẩn khi JS sẵn sàng (html.hv-anim-ready); trong editor,
   khi giảm chuyển động hoặc JS lỗi thì luôn hiện đầy đủ.
   ========================================================== */
.hv-tech__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
    margin-top: 28px;
}

.hv-tech__actions .hv-tech__btn {
    margin-top: 0;
}

.hv-tech__btn-label--close {
    display: none;
}

.hv-tech__btn-chevron {
    transition: transform .4s cubic-bezier(.2, .7, .2, 1);
}

.hv-tech__btn.is-toggle:hover svg {
    transform: translateY(2px);
}

/* Hàng icon gợi ý: các vòng kính mờ xếp chồng, rê chuột thì xòe ra */
.hv-tech__teaser {
    display: inline-flex;
    align-items: center;
    padding: 4px 4px 4px 12px;
    color: rgba(255, 255, 255, .82) !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: opacity .35s ease, transform .35s ease, visibility .35s;
}

.hv-tech__teaser-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: -10px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    transition: margin .35s cubic-bezier(.2, .7, .2, 1), background .25s ease, transform .35s ease;
}

.hv-tech__teaser-icon:first-child {
    margin-left: 0;
}

.hv-tech__teaser-count {
    margin-left: 12px;
    white-space: nowrap;
}

.hv-tech__teaser:hover .hv-tech__teaser-icon {
    margin-left: 4px;
    background: rgba(255, 255, 255, .22);
}

.hv-tech__teaser:hover .hv-tech__teaser-icon:first-child {
    margin-left: 0;
}

.hv-tech__teaser:hover .hv-tech__teaser-icon:nth-child(even) {
    transform: translateY(-3px);
}

/* Nút "Thu gọn" ở tiêu đề phần công nghệ: chỉ hiện khi có chế độ ẩn */
.hv-tech__features-head .hv-sheading__btn {
    display: none;
}

.hv-tech__features-head .hv-sheading__btn svg {
    transform: rotate(-90deg);
}

.hv-tech__features-head .hv-sheading__btn:hover svg {
    transform: rotate(-90deg) translateX(3px);
}

/* ---------- Trạng thái ẩn / mở ---------- */
.hv-anim-ready .hv-tech.is-collapsible .hv-tech__features {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    transition:
        grid-template-rows .8s cubic-bezier(.2, .7, .2, 1),
        margin-top .8s cubic-bezier(.2, .7, .2, 1),
        opacity .5s ease,
        visibility 0s linear .8s;
}

.hv-anim-ready .hv-tech.is-collapsible .hv-tech__features-inner {
    min-height: 0;
    overflow: hidden;
}

.hv-anim-ready .hv-tech.is-collapsible.is-open .hv-tech__features {
    grid-template-rows: 1fr;
    margin-top: 48px;
    opacity: 1;
    visibility: visible;
    transition:
        grid-template-rows .8s cubic-bezier(.2, .7, .2, 1),
        margin-top .8s cubic-bezier(.2, .7, .2, 1),
        opacity .6s ease .1s,
        visibility 0s;
}

/* Mở xong: bỏ cắt để hiệu ứng hover nhấc thẻ / bóng đổ không bị cụt */
.hv-anim-ready .hv-tech.is-collapsible.is-open.is-settled .hv-tech__features-inner {
    overflow: visible;
}

.hv-anim-ready .hv-tech.is-collapsible .hv-tech__features-head .hv-sheading__btn {
    display: inline-flex;
}

.hv-anim-ready .hv-tech.is-collapsible.is-open .hv-tech__btn-label--open {
    display: none;
}

.hv-anim-ready .hv-tech.is-collapsible.is-open .hv-tech__btn-label--close {
    display: inline;
}

.hv-anim-ready .hv-tech.is-collapsible.is-open .hv-tech__btn-chevron {
    transform: rotate(180deg);
}

.hv-anim-ready .hv-tech.is-collapsible.is-open .hv-tech__btn.is-toggle:hover svg {
    transform: rotate(180deg) translateY(2px);
}

.hv-anim-ready .hv-tech.is-collapsible.is-open .hv-tech__teaser {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    pointer-events: none;
}

@media (max-width: 767px) {
    .hv-tech__actions {
        gap: 12px 16px;
        margin-top: 20px;
    }

    .hv-tech__teaser-icon {
        width: 32px;
        height: 32px;
    }

    .hv-anim-ready .hv-tech.is-collapsible.is-open .hv-tech__features {
        margin-top: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hv-tech.is-collapsible .hv-tech__features {
        transition: none !important;
    }
}
