/********** Template CSS **********/

/* Prevent horizontal scrolling */
html, body { overflow-x: hidden; }
/* AboutUs section heading style */
.section-title{display:flex;align-items:center;gap:.5rem;border-bottom:2px solid rgba(13,110,253,.2);padding-bottom:.25rem;margin-bottom:.75rem;font-weight:700}
.section-title .bi{color:var(--bs-primary)}

/* Subtle content block for sections */
.content-block{
  background:#fff;
  border:1px solid rgba(0,0,0,.05);
  border-left:3px solid rgba(13,110,253,.25);
  border-radius:.5rem;
  box-shadow:0 .125rem .25rem rgba(0,0,0,.05);
}

/* Remove stray 1px gap under fixed navbar on some devices */
.navbar{ margin-bottom: 0 !important; }
.fixed-top{ border-bottom: 0 !important; }
/* Keyword highlight */
.kw{color:#0f5132;font-weight:600}

/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

.back-to-top {
    position: fixed !important;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: var(--bs-primary) !important;
    color: white !important;
    text-align: center;
    line-height: 50px;
    transition: all 0.3s ease;
    border: none !important;
    padding: 0 !important;
    font-size: 18px;
}

.back-to-top:hover {
    background: var(--bs-primary) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.back-to-top i {
    line-height: 50px;
}

/* Floating Zalo/Call buttons */
.fab-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(0,0,0,.2);
}
.fab-zalo, .fab-call {
    position: fixed;
    right: 45px;
    z-index: 98;
}
.fab-zalo { bottom: 180px; }
.fab-call { bottom: 120px; }
.fab-zalo .fab-circle { background: #008fe5; border: 3px solid #e0f3ff; font-size: 14px; }
.fab-call .fab-circle { background: #ff3b30; border: 3px solid #ffe9e7; }
.fab-call .fab-circle i { font-size: 20px; }

/* Subtle continuous wiggle animation */
@keyframes fab-wiggle {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-2px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(2px); }
}

.fab-zalo .fab-circle,
.fab-call .fab-circle {
    animation: fab-wiggle 2.2s ease-in-out infinite;
}

.fab-zalo .fab-circle:hover,
.fab-call .fab-circle:hover {
    transform: scale(1.05);
    animation-play-state: paused;
}

/*** Button ***/
.btn {
    transition: .5s;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

/* Improve tap target for navbar dropdown arrows on mobile */
@media (max-width: 991.98px){
  .navbar .nav-item.dropdown > .nav-link{
    padding-right: 1.75rem; /* add space for arrow */
  }
  .navbar .nav-item.dropdown > .nav-link .bi-caret-down-fill{
    font-size: .9rem;
  }
  .navbar .nav-item.dropdown > .nav-link > span:last-child{
    padding: .25rem .35rem;
    margin-left: .25rem;
  }
}

/* Downloads page: align buttons nicely on mobile */
@media (max-width: 575.98px){
  .table .btn.btn-sm{ 
    display:inline-flex; 
    align-items:center; 
    justify-content:center; 
    width: 48%;
    min-width: 120px;
    margin-bottom: .4rem;
  }
  .table td.text-end{ text-align: left !important; }
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}


/*** Navbar ***/
/* Keep header visible while scrolling */
.sticky-top {
    top: 0;
    position: sticky;
    transition: box-shadow .3s;
    z-index: 1020;
}

/* Truly fixed header */
.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    transition: box-shadow .3s;
    z-index: 1030;
}

/* Add top padding when page uses fixed header to avoid overlap */
body.has-fixed-header { padding-top: 90px; }

.navbar {
    padding: 15px 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
}

.navbar .navbar-nav .nav-link {
    margin-left: 30px;
    padding: 0;
    outline: none;
    color: var(--bs-dark);
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--bs-primary)
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item.active {
    color: var(--bs-white);
    background: var(--bs-primary);
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link  {
        margin-left: 0;
        padding: 10px 0;
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        border: none;
        margin-top: 0;
        top: 150%;
        opacity: 0;
        visibility: hidden;
        transition: .5s;
    }

    .navbar .nav-item:hover .dropdown-menu {
        top: 100%;
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}


/*** Hero Header ***/
.hero-header {
    margin-top: -100px;
    padding-top: 150px;
    background: url(../img/hero-bg.jpg) top center no-repeat;
    background-size: cover;
}
/* Improve long title readability on hero */
.hero-header h1.display-1 {
    line-height: 1.1;
}

/* Utilities for full-justified centered long titles */
.hero-title-justified {
    text-align: justify;
    text-align-last: center;
}
.hero-title-narrow {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.u-justify-center {
    text-align: justify;
}
.u-justify-center h1,
.u-justify-center p,
.u-justify-center div {
    text-align: justify;
}
.u-justify-center h1 { text-align-last: center; }

/* Keyword highlight */
.kw {
    font-weight: 700;
    color: var(--bs-primary);
}

/* Video captions and section highlights */
.video-caption {
    font-weight: 700;
    color: var(--bs-primary);
}
.section-lead {
    font-weight: 700;
    color: var(--bs-primary);
}

/* Image hover effects for gallery */
.gallery-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.gallery-hover:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Standardize hero feature icon boxes */
.hero-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-badge i { font-size: 20px; line-height: 1; }

.hero-header .breadcrumb-item+.breadcrumb-item::before {
    color: var(--light);
}

.header-carousel {
    position: relative;
    padding: 45px 90px 45px 0;
    overflow: hidden;
}

.header-carousel::before {
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    width: calc(50% + 45px);
    height: 100%;
    background: var(--bs-primary);
    z-index: -1;
}

.header-carousel .owl-dots {
    position: absolute;
    top: 50%;
    right: 38px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 5px 0;
    width: 15px;
    height: 15px;
    border: 2px solid var(--bs-white);
    transition: .5s;
}

.header-carousel .owl-dot.active {
    height: 30px;
    background: var(--bs-white);
}


/*** About ***/
.about-img {
    position: relative;
    overflow: hidden;
}

.about-img::after {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: url(../img/bg-about-img.png) top left no-repeat;
    background-size: contain;
}


/*** Project ***/
.project-item img {
    transition: .5s;
}

/* Ensure about carousel doesn't overflow horizontally */
.about-carousel { overflow: hidden; }
/* Enlarged single-image slides for solution page */
.about-carousel .owl-stage-outer { border-radius: 8px; }
.about-carousel img {
    width: 100%;
    height: 360px;
    object-fit: cover;
}
@media (max-width: 991.98px) {
    .about-carousel img { height: 300px; }
}
@media (max-width: 576px) {
    .about-carousel img { height: 220px; }
}
  
.project-item:hover img {
    transform: scale(1.2);
}
  
.project-overlay {
    position: absolute;
    padding: 25px;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    background: linear-gradient(rgba(255, 255, 255, .1) 50%, var(--bs-dark));
    z-index: 1;
}


/*** Service ***/
.service-item {
    position: relative;
    padding: 30px 25px;
    transition: .5s;
}

.service-item.bg-primary:hover {
    background: var(--bs-light) !important;
}

.service-item.bg-primary p {
    color: var(--bs-light);
    transition: .5s;
}

.service-item.bg-primary:hover p {
    color: var(--bs-secondary);
}

.service-item.bg-light:hover {
    background: var(--bs-primary) !important;
}

.service-item.bg-light p {
    color: var(--bs-secondary);
    transition: .5s;
}

.service-item.bg-light:hover p {
    color: var(--bs-light);
}


.service-item .service-img h3 {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 12px 7px 0;
}

.service-item.bg-primary .service-img h3 {
    background: var(--bs-primary);
    color: var(--bs-white);
    transition: .5s;
}

.service-item.bg-primary:hover .service-img h3 {
    background: var(--bs-light);
    color: var(--bs-dark);
}

.service-item.bg-light .service-img h3 {
    background: var(--bs-light);
    color: var(--bs-dark);
    transition: .5s;
}

.service-item.bg-light:hover .service-img h3 {
    background: var(--bs-primary);
    color: var(--bs-white);
}


/*** Our Team ***/
.team-item img {
    transition: .5s;
}
  
.team-item:hover img {
    transform: scale(1.2);
}
  
.team-overlay {
    position: absolute;
    padding: 30px;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    background: linear-gradient(rgba(255, 255, 255, .1) 50%, var(--bs-dark));
    z-index: 1;
}

.team-overlay small {
    display: inline-block;
    padding: 3px 15px;
    color: var(--bs-white);
    background: var(--bs-primary);
}


/*** Testimonial ***/
.testimonial-img {
    position: relative;
    padding: 45px 0 45px 90px;
}

.testimonial-img::before {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    width: calc(50% + 45px);
    height: 100%;
    background: var(--bs-primary);
    z-index: -1;
}

.testimonial-text h5 {
    position: relative;
    padding-left: 45px;
}

.testimonial-text h5::before {
    position: absolute;
    content: "";
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background: var(--bs-primary);
}

.testimonial-carousel .owl-dots {
    position: absolute;
    height: 17px;
    bottom: 0;
    right: 0;
    left: auto;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    width: 15px;
    height: 15px;
    background: var(--bs-white);
    border: 2px solid var(--bs-primary);
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    width: 30px;
    background: var(--bs-primary);
}

@media (max-width: 768px) {
    .testimonial-carousel .owl-dots {
        left: 0;
        right: auto;
    }

    .testimonial-carousel .owl-dot {
        margin-right: 10px;
        margin-left: 0;
    }
}


/*** Newsletter ***/
.newsletter {
    background: url(../img/hero-bg.jpg) bottom right no-repeat;
    background-size: cover;
}

/* Make newsletter image scale responsively without overflowing */
.newsletter .img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Reduce newsletter media height on large screens so image isn't too tall */
.newsletter .ratio { --bs-aspect-ratio: 32%; }
@media (min-width: 992px) { .newsletter .ratio { --bs-aspect-ratio: 28%; } }
@media (max-width: 576px) { .newsletter .ratio { --bs-aspect-ratio: 56.25%; } }

/* Constrain newsletter image inside a framed box (like the red box) */
.newsletter-media {
    max-width: 640px;
    border: none;
    border-radius: 4px;
    overflow: hidden;
}
@media (max-width: 991.98px) {
    .newsletter-media { max-width: 100%; }
}

@media (min-width: 992px) {
    .newsletter .container {
        max-width: 100% !important;
    }

    .newsletter .newsletter-text  {
        padding-right: calc(((100% - 960px) / 2) + .75rem);
    }
}

@media (min-width: 1200px) {
    .newsletter .newsletter-text  {
        padding-right: calc(((100% - 1140px) / 2) + .75rem);
    }
}

@media (min-width: 1400px) {
    .newsletter .newsletter-text  {
        padding-right: calc(((100% - 1320px) / 2) + .75rem);
    }
}


/*** Footer ***/
.footer .btn.btn-link {
    display: block;
    margin-bottom: 10px;
    padding: 0;
    text-align: left;
    color: rgba(255,255,255,.5);
    font-weight: normal;
    transition: .3s;
}

.footer .btn.btn-link:hover {
    color: var(--bs-white);
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .copyright {
    padding: 25px 0;
    font-size: 14px;
    border-top: 1px solid rgba(256, 256, 256, .1);
}

.footer .copyright a {
    color: rgba(255,255,255,.5);
}

.footer .copyright a:hover {
    color: var(--bs-white);
}

.footer .footer-menu a {
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, .1);
}

.footer .footer-menu a:last-child {
    margin-right: 0;
    padding-right: 0;
    border-right: none;
}

/*** Language toggle visibility ***/
body[data-lang="vi"] [data-lang="en"] {
    display: none !important;
}

body[data-lang="en"] [data-lang="vi"] {
    display: none !important;
}

/* Always show both options inside the language dropdown */
[data-toggle-lang] [data-lang] {
    display: block !important;
}

/* Small helper style for the header distributor note */
.distributor-note {
    font-size: 12px;
    color: var(--bs-secondary);
    white-space: nowrap;
}

/* Fix KMD image specifically */
img[src*="kmdimg.jpg"] {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* KMD image hover effect */
img[src*="kmdimg.jpg"]:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* KMD container - make it fit the image */
.kmd-image-container {
    display: inline-block;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.kmd-image-container:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}