/* ======================================
   HOÀNG GIANG SOLAR - CUSTOM STYLESHEET
   ====================================== */

/* Google Font */
:root {
    --primary: #0d6efd;
    --secondary: #ffc107;
    --dark: #0f172a;
    --gray: #64748b;
    --light-bg: #f8fafc;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    --transition: .3s ease;
    --radius: 12px;
    --font: 'Be Vietnam Pro', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    color: #333;
}

a {
    text-decoration: none;
    transition: color var(--transition);
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
}

/* ---- TOPBAR ---- */
.topbar {
    background: var(--dark);
    color: #94a3b8;
    font-size: 12.5px;
    padding: 6px 0;
    transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
    will-change: transform, opacity;
}

.topbar-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.topbar a {
    color: #94a3b8;
    transition: color var(--transition);
}

.topbar a:hover {
    color: var(--secondary);
}

.topbar-divider {
    display: inline-block;
    width: 1px;
    height: 12px;
    background: rgba(255,255,255,.15);
    margin: 0 12px;
    vertical-align: middle;
}

.topbar-label {
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.topbar-social {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
    color: #94a3b8;
    font-size: 11px;
    margin-left: 4px;
    transition: all var(--transition);
}

.topbar-social:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

/* ---- NAVBAR ---- */
#mainNav {
    background: #fff;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: padding .35s cubic-bezier(.4,0,.2,1),
                box-shadow .35s ease,
                background .35s ease;
}

/* Scrolled state: compact + shadow */
#mainNav.nav-scrolled {
    padding: 0;
    box-shadow: 0 2px 24px rgba(0, 0, 0, .1);
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#mainNav .navbar-brand {
    padding: 10px 0;
    transition: padding var(--transition);
}

.nav-scrolled .navbar-brand {
    padding: 6px 0 !important;
}

.nav-logo {
    max-height: 45px;
    transition: max-height var(--transition);
}

.nav-scrolled .nav-logo {
    max-height: 36px;
}

.brand-logo {
    font-size: 2rem;
}

.brand-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.brand-tagline {
    display: block;
    font-size: .58rem;
    letter-spacing: 2.5px;
    color: var(--secondary);
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: #334155;
    padding: 1.1rem .75rem !important;
    position: relative;
    font-size: .9rem;
    transition: color var(--transition);
}

.nav-scrolled .navbar-nav .nav-link {
    padding: .8rem .75rem !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: .75rem;
    right: .75rem;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #0891b2);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform var(--transition);
}

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

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    transform: scaleX(1);
}

/* ---- NAV ACTIONS: Search + CTA ---- */
.nav-actions {
    flex-shrink: 0;
}

/* Search: dropdown approach - hidden by default */
.nav-search-wrapper {
    position: relative;
}

.nav-search-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    color: #64748b;
    font-size: .85rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-search-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
}

/* Search dropdown - initially hidden */
.nav-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s cubic-bezier(.4,0,.2,1), visibility .25s;
    z-index: 1050;
    padding: 8px;
}

.nav-search-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-search-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0 12px;
}

.nav-search-icon {
    color: #94a3b8;
    font-size: .85rem;
    flex-shrink: 0;
}

.nav-search-box input {
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 10px;
    font-size: .88rem;
    font-family: var(--font);
    color: #334155;
    width: 100%;
}

.nav-search-box input::placeholder {
    color: #94a3b8;
}

/* CTA Button: Gradient */
.btn-cta {
    background: linear-gradient(135deg, #0d6efd 0%, #0891b2 100%);
    color: #fff !important;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: .88rem;
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0891b2 0%, #0d6efd 100%);
    opacity: 0;
    transition: opacity .4s ease;
}

.btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(13, 110, 253, .35);
    color: #fff !important;
    text-decoration: none;
}

.btn-cta:hover::before {
    opacity: 1;
}

.btn-cta > * {
    position: relative;
    z-index: 1;
}

.nav-scrolled .btn-cta {
    padding: 8px 18px;
    font-size: .82rem;
}

/* Mobile CTA */
.btn-cta-mobile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: .9rem;
    text-decoration: none;
}

/* ---- DROPDOWN (keep existing) ---- */
.dropdown-menu {
    border: 0;
    box-shadow: var(--card-shadow);
    border-radius: var(--radius);
    margin-top: 0 !important;
    opacity: 0;
    visibility: hidden;
    display: block;
    transform: translateY(8px);
    transition: all .25s ease;
    pointer-events: none;
}

/* Desktop: hover mở dropdown */
@media (min-width: 992px) {
    .nav-item.dropdown:hover > .dropdown-menu,
    .nav-item.dropdown:focus-within > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Bỏ caret mặc định Bootstrap, thay mũi tên mượt */
    .dropdown-toggle::after {
        border: 0;
        content: "\f107"; /* fa-chevron-down */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: .6rem;
        margin-left: 5px;
        transition: transform .25s ease;
        vertical-align: middle;
    }

    .nav-item.dropdown:hover > .dropdown-toggle::after {
        transform: rotate(-180deg);
    }

    /* Click không cần toggle trên desktop */
    .dropdown-toggle[data-bs-toggle="dropdown"] {
        pointer-events: auto;
    }
}

.dropdown-item {
    padding: .6rem 1.2rem;
    font-size: .875rem;
    transition: all .15s ease;
}

.dropdown-item i,
.dropdown-submenu-toggle i:not(.submenu-arrow) {
    width: 1.2em;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: #f0f7ff;
    color: var(--primary);
    padding-left: 1.5rem;
}

/* ---- NESTED SUBMENU (Biến tần → Inverter con) ---- */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.submenu-arrow {
    font-size: .6rem;
    margin-left: auto;
    padding-left: .5rem;
    transition: transform .2s ease;
    color: #999;
}

/* Desktop: flyout sang phải */
@media (min-width: 992px) {
    .dropdown-submenu-menu {
        position: absolute !important;
        left: 100% !important;
        top: 0 !important;
        margin-top: 0 !important;
        margin-left: 2px;
        min-width: 200px;
        border: 0;
        box-shadow: var(--card-shadow);
        border-radius: var(--radius);
        opacity: 0;
        visibility: hidden;
        display: block;
        transform: translateX(8px);
        transition: all .2s ease;
        pointer-events: none;
    }

    .dropdown-submenu:hover > .dropdown-submenu-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }

    .dropdown-submenu:hover > .dropdown-submenu-toggle .submenu-arrow {
        color: var(--primary);
        transform: translateX(3px);
    }

    .dropdown-submenu:hover > .dropdown-submenu-toggle {
        background: #f0f7ff;
        color: var(--primary);
    }
}

/* Mobile: click mở, mũi tên xuống rõ ràng */
@media (max-width: 991.98px) {
    .dropdown-menu {
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border-radius: 0;
        background: rgba(0,0,0,.03);
        padding: .3rem 0;
    }

    .dropdown-menu.show {
        display: block;
    }

    .dropdown-toggle::after {
        border: 0;
        content: "\f078"; /* fa-chevron-down */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: .65rem;
        float: right;
        margin-top: 6px;
        transition: transform .25s ease;
        color: var(--primary);
    }

    .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(-180deg);
    }

    .dropdown-item {
        padding: .5rem 1.5rem;
        font-size: .85rem;
    }

    /* Mobile nested submenu */
    .dropdown-submenu-menu {
        position: static !important;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border: 0;
        background: rgba(0,0,0,.04);
        padding: 0;
        margin: 0;
    }

    .dropdown-submenu-menu.show {
        display: block;
    }

    .dropdown-submenu-menu .dropdown-item {
        padding-left: 2.5rem;
        font-size: .82rem;
    }

    .submenu-arrow {
        transition: transform .2s ease;
    }

    .dropdown-submenu.open .submenu-arrow {
        transform: rotate(90deg);
    }
}

/* ===== MEGA MENU ===== */
@media (min-width: 992px) {
    .mega-dropdown { position: static; }
    .mega-menu {
        width: 100%;
        left: 0; right: 0;
        padding: 0;
        border: 0;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 12px 40px rgba(0,0,0,.12);
        background: #fff;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: all .25s ease;
        pointer-events: none;
    }
    .mega-dropdown:hover > .mega-menu,
    .mega-menu:hover {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    .mega-menu-inner {
        max-width: 1140px;
        margin: 0 auto;
        padding: .75rem 1rem .5rem;
    }
    .mega-menu-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: .4rem 1.5rem;
    }
    .mega-cat-group {
        padding-bottom: .4rem;
        border-bottom: 1px solid #f0f0f0;
    }
    .mega-cat-group:nth-last-child(-n+3) { border-bottom: 0; padding-bottom: 0; }
    .mega-cat-title {
        display: flex;
        align-items: center;
        gap: .35rem;
        font-size: .8rem;
        font-weight: 700;
        color: #0f2a4a;
        text-decoration: none;
        margin-bottom: .15rem;
        padding: .2rem .4rem;
        border-radius: 5px;
        transition: all .2s;
    }
    .mega-cat-title i {
        width: 22px; height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #e8f4fd, #dbeafe);
        color: var(--primary);
        border-radius: 5px;
        font-size: .65rem;
        flex-shrink: 0;
    }
    .mega-cat-title:hover {
        background: #f0f7ff;
        color: var(--primary);
    }
    .mega-cat-list {
        list-style: none;
        padding: 0;
        margin: 0 0 0 2rem;
    }
    .mega-cat-list li a {
        display: block;
        padding: .1rem .4rem;
        font-size: .78rem;
        color: #475569;
        text-decoration: none;
        border-radius: 4px;
        line-height: 1.5;
        transition: all .15s;
    }
    .mega-cat-list li a:hover {
        color: var(--primary);
        background: #f8fafc;
        padding-left: .6rem;
    }
    .mega-menu-footer {
        border-top: 1px solid #f0f0f0;
        margin-top: .4rem;
        padding-top: .4rem;
        text-align: center;
    }
    .mega-view-all {
        display: inline-flex;
        align-items: center;
        gap: .25rem;
        font-size: .85rem;
        font-weight: 600;
        color: var(--primary);
        text-decoration: none;
        padding: .4rem 1rem;
        border-radius: 8px;
        transition: all .2s;
    }
    .mega-view-all:hover {
        background: var(--primary);
        color: #fff;
    }
}

/* Mega menu mobile */
@media (max-width: 991.98px) {
    .mega-menu {
        position: static !important;
        box-shadow: none;
        border: 0;
        padding: .25rem 0;
        background: rgba(0,0,0,.02);
    }
    .mega-menu-inner { padding: 0; }
    .mega-menu-grid {
        display: flex;
        flex-direction: column;
    }
    .mega-cat-group {
        border-bottom: 1px solid #f0f0f0;
        padding: .25rem 0;
    }
    .mega-cat-group:last-child { border-bottom: 0; }
    .mega-cat-title {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: .5rem 1rem;
        font-size: .85rem;
        font-weight: 600;
        color: #334155;
        text-decoration: none;
    }
    .mega-cat-title i {
        width: 24px; height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #e8f4fd;
        color: var(--primary);
        border-radius: 5px;
        font-size: .7rem;
        flex-shrink: 0;
    }
    .mega-cat-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: none;
    }
    .mega-cat-group.open .mega-cat-list { display: block; }
    .mega-cat-list li a {
        display: block;
        padding: .35rem 1rem .35rem 3rem;
        font-size: .82rem;
        color: #64748b;
        text-decoration: none;
    }
    .mega-cat-list li a:hover { color: var(--primary); }
    .mega-menu-footer {
        padding: .5rem 1rem;
        border-top: 1px solid #e2e8f0;
    }
    .mega-view-all {
        display: block;
        text-align: center;
        font-size: .82rem;
        font-weight: 600;
        color: var(--primary);
        text-decoration: none;
        padding: .4rem;
    }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 991.98px) {
    .topbar-left, .topbar-right {
        text-align: center !important;
    }
    .topbar-divider {
        display: none;
    }
    .topbar-left span {
        display: block;
        margin-bottom: 2px;
    }
    .topbar-right {
        display: none !important;
    }
    .navbar-nav .nav-link {
        padding: .7rem 0 !important;
    }
    .navbar-nav .nav-link::after {
        display: none;
    }
    .nav-actions {
        padding: .5rem 0;
        justify-content: space-between;
        width: 100%;
    }
    .nav-search-btn {
        width: 36px;
        height: 36px;
    }
    .nav-search-dropdown {
        width: 260px;
    }
}

/* ---- NAVBAR SEARCH (legacy compat) ---- */
.navbar-search .form-control {
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: .9rem;
    width: 200px;
}

.navbar-search .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- HERO ---- */
.hero-section {
    position: relative;
}

.hero-slide {
    min-height: 560px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    position: relative;
    display: flex;
    align-items: center;
}

.hero-slide-1 {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

.hero-slide-2 {
    background: linear-gradient(135deg, #0d1117, #1a1a2e, #16213e);
}

.hero-slide-3 {
    background: linear-gradient(135deg, #0f172a, #1e3a5f, #0369a1);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
}

.min-vh-75 {
    min-height: 75vh;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 193, 7, .15);
    color: var(--secondary);
    border: 1px solid rgba(255, 193, 7, .3);
    padding: .4rem 1rem;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-desc {
    color: rgba(255, 255, 255, .8);
    font-size: 1.05rem;
    max-width: 550px;
    margin-bottom: 1.5rem;
}

.hero-actions .btn {
    padding: .75rem 1.8rem;
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    border-top: 1px solid rgba(255, 255, 255, .15);
    padding-top: 1rem;
    margin-top: 1rem;
}

.hero-stats .stat-item {
    text-align: center;
}

.hero-stats .stat-item strong {
    display: block;
    font-size: 1.4rem;
    color: var(--secondary);
    font-weight: 800;
}

.hero-stats .stat-item span {
    font-size: .75rem;
    color: rgba(255, 255, 255, .6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- WHY STRIP ---- */
.why-strip {
    padding: 0;
}

.why-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.2rem 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, .15);
    transition: background var(--transition);
}

.why-item:hover {
    background: rgba(255, 255, 255, .08);
}

.why-icon {
    font-size: 1.8rem;
    color: var(--secondary);
    flex-shrink: 0;
}

.why-text {
    color: #fff;
    font-size: .88rem;
    line-height: 1.3;
}

/* ---- SECTION COMMON ---- */
.section-label {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--dark);
}

/* ---- ABOUT ---- */
.about-img-wrap {
    position: relative;
}

.about-img-bg {
    position: absolute;
    width: 80%;
    height: 80%;
    background: linear-gradient(135deg, var(--primary) 0%, #0891b2 100%);
    border-radius: var(--radius);
    bottom: -20px;
    right: -20px;
    z-index: 0;
}

.about-img {
    position: relative;
    z-index: 1;
    width: 100%;
}

.about-badge-box {
    position: absolute;
    bottom: 20px;
    left: -15px;
    z-index: 2;
}

.about-badge {
    background: var(--secondary);
    border-radius: var(--radius);
    padding: .7rem 1.2rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.about-badge .badge-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.about-badge .badge-text {
    font-size: .7rem;
    font-weight: 600;
    color: #664d03;
}

.feature-row {
    padding: .4rem 0;
    font-weight: 500;
}

/* ---- SERVICES ---- */
.service-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: var(--card-shadow);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
}

.service-solar {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left: 4px solid var(--secondary);
}

.service-camera {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid var(--primary);
}

.service-card-body {
    padding: 2rem;
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.service-solar .service-icon {
    color: var(--secondary);
}

.service-camera .service-icon {
    color: var(--primary);
}

.service-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: .8rem;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list li {
    padding: .3rem 0;
    font-size: .9rem;
    color: var(--gray);
}

/* ---- PRODUCTS ---- */
.product-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.product-tab {
    padding: .4rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray);
    transition: all var(--transition);
}

.product-tab:hover,
.product-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.product-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, .12);
}

.product-img-link {
    display: block;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #cbd5e1;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: .25rem .6rem;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-contact {
    background: var(--secondary);
    color: #664d03;
}

.product-info {
    padding: .8rem;
}

.product-category {
    font-size: .72rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-name {
    font-size: .9rem;
    font-weight: 600;
    margin: .2rem 0 .3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.34em; /* 2 lines × 1.3 line-height × .9rem */
}

.product-name a {
    color: var(--dark);
}

.product-name a:hover {
    color: var(--primary);
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* ---- STATS ---- */
.stat-counter {
    padding: 1rem;
}

.counter-num {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    display: inline;
}

.counter-label {
    font-size: .85rem;
    opacity: .8;
    margin-top: .3rem;
}

.counter-num+span {
    font-size: 2rem;
    font-weight: 800;
}

/* ---- NEWS ---- */
.news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, .12);
}

.news-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform .4s;
}

.news-card:hover .news-img {
    transform: scale(1.04);
}

.news-img-placeholder {
    width: 100%;
    height: 200px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #cbd5e1;
}

.news-body {
    padding: 1.2rem;
}

.news-date {
    font-size: .78rem;
    color: var(--gray);
    margin-bottom: .4rem;
}

.news-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: .5rem;
}

.news-title a {
    color: var(--dark);
}

.news-title a:hover {
    color: var(--primary);
}

.news-summary {
    font-size: .85rem;
    color: var(--gray);
    margin-bottom: .7rem;
}

.news-read-more {
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
}

.news-read-more:hover {
    color: #0a58ca;
}

/* ---- CONTACT ---- */
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.contact-item i {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.contact-item strong {
    display: block;
    font-weight: 600;
}

.contact-item a {
    color: var(--dark);
}

.contact-item a:hover {
    color: var(--primary);
}

.contact-form-wrap {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

/* ---- FOOTER ---- */
.footer {
    background: linear-gradient(180deg, #0c1426 0%, #0f172a 100%);
    color: #cbd5e1;
}

.footer-top {
    padding: 3.5rem 0 2.5rem;
}

/* Brand */
.footer-brand {
    text-decoration: none;
}

.footer-brand:hover {
    text-decoration: none;
}

.footer-logo {
    max-height: 42px;
}

.footer-brand-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.footer-brand-tagline {
    display: block;
    font-size: .55rem;
    letter-spacing: 2.5px;
    color: var(--secondary);
    font-weight: 600;
}

.footer-desc {
    color: #94a3b8;
    font-size: .85rem;
    line-height: 1.6;
    margin-bottom: .8rem;
}

/* Contact list — bright text */
.footer-contact-list {
    margin-bottom: 1rem;
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: .6rem;
    font-size: .88rem;
    color: #e2e8f0;
}

.footer-contact-list li i {
    color: var(--secondary);
    margin-top: 3px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.footer-contact-list a {
    color: #e2e8f0;
    transition: color var(--transition);
}

.footer-contact-list a:hover {
    color: var(--secondary);
}

/* Social Icons — horizontal row with brand colors */
.footer-social-row {
    display: flex;
    gap: 8px;
    margin-top: .5rem;
}

.social-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    color: #94a3b8;
    font-size: .85rem;
    transition: all var(--transition);
}

.social-icon:hover {
    transform: translateY(-2px);
    color: #fff;
}

.social-fb:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.social-zalo:hover {
    background: #0068ff;
    border-color: #0068ff;
}

.social-yt:hover {
    background: #ff0000;
    border-color: #ff0000;
}

.social-tt:hover {
    background: #000;
    border-color: #69c9d0;
}

/* Footer title */
.footer-title {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.1rem;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    padding-bottom: .6rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
}

/* Footer nav links */
.footer-links li {
    margin-bottom: .55rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: .86rem;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
}

.footer-links a i {
    font-size: .6rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--transition);
}

.footer-links a:hover {
    color: var(--secondary);
    padding-left: 4px;
}

.footer-links a:hover i {
    opacity: 1;
    transform: translateX(0);
}

/* Newsletter */
.footer-newsletter {
    margin-top: .6rem;
    margin-bottom: 1.2rem;
}

.newsletter-input-group {
    display: flex;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50px;
    overflow: hidden;
    transition: border-color var(--transition);
}

.newsletter-input-group:focus-within {
    border-color: var(--secondary);
}

.newsletter-input-group input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 16px;
    font-size: .85rem;
    color: #fff;
    font-family: var(--font);
    min-width: 0;
}

.newsletter-input-group input::placeholder {
    color: #64748b;
}

.newsletter-input-group button {
    background: var(--secondary);
    border: none;
    padding: 10px 18px;
    color: #1a1a2e;
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background var(--transition);
}

.newsletter-input-group button:hover {
    background: #e0a800;
}

/* Trust Badges — subtle inline */
.footer-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 6px;
    font-size: .78rem;
    color: #94a3b8;
    transition: all var(--transition);
}

.trust-badge i {
    color: var(--secondary);
    font-size: .7rem;
}

.trust-badge:hover {
    background: rgba(255, 255, 255, .08);
    color: #e2e8f0;
}

/* Government badge */
.footer-govt-badge {
    margin-top: .5rem;
}

.govt-logo {
    max-height: 40px;
    opacity: .8;
    transition: opacity var(--transition);
}

.govt-logo:hover {
    opacity: 1;
}

/* Visitor Counter (inline in footer bottom) */
.visitor-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
}

.visitor-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 .7rem;
    color: #94a3b8;
    font-size: .75rem;
    white-space: nowrap;
}

.visitor-stat-item i {
    font-size: .55rem;
    color: #64748b;
}

.visitor-stat-item i.text-success {
    color: #22c55e !important;
}

.visitor-stat-item .stat-value {
    font-weight: 700;
    color: #e2e8f0;
    font-size: .8rem;
}

.visitor-stat-item .stat-label {
    color: #64748b;
    font-size: .7rem;
}

.visitor-stat-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, .1);
}

.pulse-dot {
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

@media (max-width: 767.98px) {
    .visitor-stat-item {
        padding: .2rem .6rem;
        font-size: .75rem;
    }
    .visitor-stat-item .stat-value {
        font-size: .8rem;
    }
}

/* Bottom bar */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding: 1rem 0;
    color: #64748b;
    font-size: .8rem;
}

.footer-bottom a {
    color: #64748b;
    transition: color var(--transition);
}

.footer-bottom a:hover {
    color: var(--secondary);
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.footer-dot {
    color: #475569;
}

/* ---- RESPONSIVE: mobile footer ---- */
@media (max-width: 767.98px) {
    .footer-top {
        padding-bottom: 1.5rem;
    }
    .footer-bottom .row > div {
        text-align: center !important;
    }
    .footer-bottom-links {
        justify-content: center;
        margin-top: .5rem;
    }
    /* Extra padding-bottom để tránh floating buttons che nội dung */
    .footer {
        padding-bottom: 80px;
    }
    .newsletter-input-group button span {
        display: none;
    }
    .newsletter-input-group button {
        padding: 10px 14px;
    }
}

/* ---- FLOATING BUTTONS ---- */
.floating-buttons {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .75rem;
    z-index: 9999;
}

.float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: 160px;
    padding: .75rem 1.25rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    transition: transform .25s ease, box-shadow .25s ease;
}

.float-btn:hover {
    transform: scale(1.08) !important;
    color: #fff;
    text-decoration: none;
}

.float-btn i {
    font-size: 1.15rem;
}

/* — Gọi ngay — */
.float-phone {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 4px 20px rgba(34, 197, 94, .45);
    animation: shake-phone 3s ease-in-out infinite;
}
.float-phone:hover {
    box-shadow: 0 6px 30px rgba(34, 197, 94, .6);
}

/* — Zalo — */
.float-zalo {
    background: linear-gradient(135deg, #0068ff, #0050cc);
    box-shadow: 0 4px 20px rgba(0, 104, 255, .4);
    animation: bounce-zalo 2.5s ease-in-out infinite;
}
.float-zalo:hover {
    box-shadow: 0 6px 30px rgba(0, 104, 255, .55);
}

/* — Back to top — */
.float-top {
    background: #334155;
    min-width: auto;
    padding: .75rem;
    border-radius: 50%;
    justify-content: center;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.float-label {
    max-width: 100px;
    overflow: hidden;
    white-space: nowrap;
}

/* ===== ANIMATIONS ===== */

/* Gọi ngay: lắc lắc điện thoại */
@keyframes shake-phone {
    0%, 100% { transform: rotate(0deg); }
    3% { transform: rotate(-12deg); }
    6% { transform: rotate(12deg); }
    9% { transform: rotate(-10deg); }
    12% { transform: rotate(10deg); }
    15% { transform: rotate(-6deg); }
    18% { transform: rotate(6deg); }
    21% { transform: rotate(0deg); }
}

/* Zalo: nhún nhẹ */
@keyframes bounce-zalo {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 4px 20px rgba(0, 104, 255, .4);
    }
    15% {
        transform: translateY(-6px);
        box-shadow: 0 8px 25px rgba(0, 104, 255, .5);
    }
    30% { transform: translateY(0); }
    40% {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0, 104, 255, .45);
    }
    50% { transform: translateY(0); }
}

/* Responsive floating buttons - horizontal bottom bar on mobile */
@media (max-width: 768px) {
    /* Hide topbar on mobile to save space */
    .topbar { display: none !important; }

    /* CRITICAL: Force body overflow visible so position:fixed works */
    html, body {
        overflow-x: hidden !important;
        overflow-y: visible !important;
        height: auto !important;
    }
    body {
        padding-top: 70px !important;
        padding-bottom: 65px !important;
    }

    /* Fixed header on mobile */
    #mainNav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9990 !important;
        background: #fff !important;
        box-shadow: 0 2px 12px rgba(0,0,0,.08);
        transform: none !important;
    }

    /* Fixed floating buttons on mobile */
    .floating-buttons {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        background: rgba(255,255,255,.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -2px 20px rgba(0,0,0,.08);
        border-top: 1px solid rgba(0,0,0,.05);
        transform: none !important;
    }
    .float-btn {
        flex: 1;
        min-width: 0;
        height: 48px;
        padding: 0 1rem;
        font-size: .88rem;
        font-weight: 700;
        border-radius: 50px;
        margin: 0;
        justify-content: center;
        animation: none !important;
    }
    .float-phone {
        box-shadow: 0 3px 12px rgba(34, 197, 94, .35);
    }
    .float-zalo {
        box-shadow: 0 3px 12px rgba(0, 104, 255, .3);
    }
    .float-btn i { font-size: 1.05rem; }
    .float-label { display: inline; max-width: none; }
    .float-top { display: none !important; }
}

/* ---- PAGE HEADER ---- */
.page-header {
    background: linear-gradient(135deg, var(--dark), #1e3a5f);
    padding: 3rem 0;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 0L30 15L15 30L0 15z' fill='%23fff' fill-opacity='.03'/%3E%3C/svg%3E");
}

.page-header .breadcrumb-item {
    font-size: .85rem;
}

.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, .7);
}

.page-header .breadcrumb-item.active {
    color: var(--secondary);
}

.page-header .breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, .4);
}

/* ---- ADMIN BADGE ---- */
.admin-link {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: -60px;
    background: var(--primary);
    color: #fff;
    padding: .5rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: .75rem;
    font-weight: 600;
    transition: left var(--transition);
    z-index: 9998;
}

.admin-link:hover {
    left: 0;
    color: #fff;
}

/* ---- UTILITIES ---- */
.section-spacing {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    .section-spacing {
        padding: 3rem 0;
    }

    .hero-slide {
        min-height: 420px;
    }

    .min-vh-75 {
        min-height: 420px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .why-item {
        padding: .8rem 1rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    /* float buttons handled by dedicated responsive block above */
}

/* ---- LAZY LOAD ---- */
img.lazy {
    opacity: 0;
    transition: opacity .4s;
}

img.lazy.loaded {
    opacity: 1;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}