/* ============================================================
   AES Industrial – Sản phẩm Công nghiệp
   Bảng màu thương hiệu AES THẬT (theo logo AES VIETNAM):
   Đỏ tươi #e1251b · Vàng gold #f5a300 · Đỏ đô #a32523
   ============================================================ */
:root {
    --aes-red:      #e1251b;   /* đỏ chủ đạo (chữ A / wordmark) */
    --aes-red-dark: #b71c13;
    --aes-maroon:   #a32523;   /* đỏ đô (chữ S) – nền tối, tiêu đề */
    --aes-maroon-dk:#7a1614;
    --aes-gold:     #f5a300;   /* vàng cam – điểm nhấn / CTA */
    --aes-gold-dk:  #d98a00;

    --ink:      #20242c;      /* gần đen trung tính */
    --muted:    #111418;      /* đen (gần thuần) cho body text — dễ đọc */
    --line:     #e6e8ec;      /* viền xám nhạt trung tính */
    --bg:       #ffffff;
    --bg-soft:  #fdf6f4;      /* màu xen kẽ như ban đầu (ấm nhạt) */

    --radius: 14px;
    --shadow: 0 10px 30px rgba(24, 27, 34, 0.08);
    --shadow-lg: 0 20px 50px rgba(24, 27, 34, 0.14);
    --container: 1160px;
    --t: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Chống "chữ mồ côi" (orphan/widow) toàn site ---------- */
/* Tiêu đề: cân bằng số từ mỗi dòng, không để 1 từ rớt riêng 1 dòng */
h1, h2, h3, h4, h5, h6,
.eyebrow, .ct-sub, .qms-card h4, .proc-step h4, blockquote {
    text-wrap: balance;
}
/* Đoạn văn & danh sách: tránh từ lẻ ở dòng cuối */
p, li, figcaption, dd, td, .stat span, .ss-item span {
    text-wrap: pretty;
}
/* Câu mô tả dưới tiêu đề (thường 1–2 dòng): cân bằng cho gọn */
.section-head p, .cta-band p, .hero-badges span {
    text-wrap: balance;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    width: 100%;
    /* Công thức khung kiểu VINIS: khung = 100% chiều rộng màn hình (KHÔNG khoá cứng 1160px),
       lề 2 bên là padding co giãn theo breakpoint → zoom out / màn rộng thì bố cục TRÀN ra 2 bên. */
    max-width: 100%;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 640px)  { .container { padding-left: 2rem;  padding-right: 2rem;  } }
@media (min-width: 1024px) { .container { padding-left: 4rem;  padding-right: 4rem;  } }
@media (min-width: 1600px) { .container { padding-left: 6rem;  padding-right: 6rem;  } }
@media (min-width: 2200px) { .container { padding-left: 9vw;   padding-right: 9vw;   } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.6rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--t);
    white-space: nowrap;
}
.btn-primary { background: var(--aes-gold); color: #3a2400; box-shadow: 0 8px 20px rgba(245,163,0,0.35); }
.btn-primary:hover { background: var(--aes-gold-dk); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Top bar ---------- */
.topbar {
    background: var(--aes-maroon-dk);
    color: #f0d9d6;
    font-size: 0.82rem;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}
.topbar-contact { display: flex; gap: 1.4rem; }
.topbar-contact a { display: inline-flex; align-items: center; gap: 0.4rem; transition: var(--t); }
.topbar-contact a:hover { color: var(--aes-gold); }
.topbar-contact i { color: var(--aes-gold); }
.topbar-social { display: flex; gap: 0.7rem; }
.topbar-social a {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,0.10);
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--t);
}
.topbar-social a:hover { background: var(--aes-red); color: #fff; }

/* ---------- Header ---------- */
/* Cả dải topbar (liên hệ + VI|EN + social) và header trắng dính cùng nhau khi cuộn */
#site-header { position: sticky; top: 0; z-index: 100; }
.site-header {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    transition: var(--t);
}
.site-header.scrolled { box-shadow: 0 6px 20px rgba(122,22,20,0.10); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.logo { display: flex; align-items: center; gap: 0.7rem; }
.logo-mark {
    background: linear-gradient(135deg, var(--aes-red), var(--aes-gold));
    color: #fff; font-weight: 800; letter-spacing: 0.5px;
    padding: 0.5rem 0.7rem; border-radius: 10px; font-size: 1.05rem;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { color: var(--aes-maroon); font-size: 1.1rem; font-weight: 800; }
.logo-text em { font-style: normal; color: var(--muted); font-size: 0.72rem; }
/* Logo ảnh AES (ngang: AES · Industrial Products) */
.logo-img { height: 40px; width: auto; max-width: 100%; display: block; }
@media (max-width: 900px) { .logo-img { height: 34px; } }

.main-nav { display: flex; align-items: center; gap: 0.4rem; }
.main-nav a {
    padding: 0.5rem 0.9rem; border-radius: 8px;
    font-weight: 500; font-size: 0.95rem; color: var(--ink);
    transition: var(--t);
}
.main-nav a:hover { color: var(--aes-red); background: var(--bg-soft); }
.main-nav .nav-cta {
    background: var(--aes-red); color: #fff; font-weight: 600; margin-left: 0.4rem;
}
.main-nav .nav-cta:hover { background: var(--aes-red-dark); color: #fff; }

.nav-toggle {
    display: none; background: none; border: none;
    font-size: 1.4rem; color: var(--aes-maroon); cursor: pointer;
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(245,163,0,0.42), transparent 60%),
        radial-gradient(900px 500px at 0% 110%, rgba(225,37,27,0.35), transparent 60%),
        linear-gradient(135deg, var(--aes-maroon-dk) 0%, var(--aes-maroon) 55%, var(--aes-red) 120%);
}
.hero-bg::after {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(700px 400px at 70% 20%, #000, transparent 75%);
}
.hero-inner { position: relative; padding: 5rem 24px 5.5rem; }
.hero-content { max-width: 720px; }
.badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
    padding: 0.45rem 1rem; border-radius: 999px; font-size: 0.82rem; font-weight: 500;
    margin-bottom: 1.4rem;
}
.badge i { color: var(--aes-gold); }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.5px; }
.hero h1 span { color: var(--aes-gold); }
.hero p { font-size: 1.1rem; color: #f4e0dd; margin: 1.3rem 0 2rem; max-width: 620px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 2rem; font-weight: 800; color: #fff; }
.hero-stats span { font-size: 0.85rem; color: #edcfcb; }

/* ---------- Features ---------- */
.features { margin-top: -3rem; position: relative; z-index: 5; padding-bottom: 1rem; }
.features-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem;
}
.feature-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.8rem 1.5rem; box-shadow: var(--shadow); transition: var(--t);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature-card i {
    font-size: 1.4rem; color: var(--aes-red);
    width: 52px; height: 52px; border-radius: 12px;
    background: rgba(225,37,27,0.08);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1.08rem; color: var(--aes-maroon); margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.9rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 3rem; }
.eyebrow {
    display: inline-block; color: var(--aes-red); font-weight: 700;
    font-size: 0.82rem; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 0.7rem;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--aes-maroon); font-weight: 800; letter-spacing: -0.5px; }
.section-head p { color: var(--muted); margin-top: 0.9rem; font-size: 1.02rem; }

/* ---------- Products ---------- */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.product-card {
    position: relative; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 2rem 1.8rem; transition: var(--t); overflow: hidden;
}
.product-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--aes-red), var(--aes-gold)); transform: scaleX(0);
    transform-origin: left; transition: var(--t);
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.product-card:hover::before { transform: scaleX(1); }
.product-card.featured { border-color: var(--aes-red); box-shadow: var(--shadow); }
.product-card.featured::before { transform: scaleX(1); }
.ribbon {
    position: absolute; top: 1.3rem; right: -0.2rem;
    background: var(--aes-gold); color: #3a2400; font-size: 0.72rem; font-weight: 700;
    padding: 0.25rem 0.9rem; border-radius: 6px 0 0 6px; letter-spacing: 0.5px;
}
.product-icon {
    width: 62px; height: 62px; border-radius: 16px;
    background: linear-gradient(135deg, rgba(225,37,27,0.1), rgba(245,163,0,0.12));
    color: var(--aes-red); font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center; margin-bottom: 1.2rem;
}
.product-card h3 { font-size: 1.25rem; color: var(--aes-maroon); }
.product-sub { color: var(--aes-red); font-weight: 600; font-size: 0.85rem; margin: 0.2rem 0 0.9rem; }
.product-card > p { color: var(--muted); font-size: 0.93rem; }
.product-list { margin: 1.1rem 0 1.4rem; display: grid; gap: 0.55rem; }
.product-list li { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.9rem; color: var(--ink); }
.product-list i { color: var(--aes-red); margin-top: 0.25rem; font-size: 0.8rem; }
.product-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--aes-red); font-weight: 600; font-size: 0.92rem; transition: var(--t); }
.product-link:hover { gap: 0.85rem; color: var(--aes-gold-dk); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.step {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 2rem 1.5rem; position: relative; transition: var(--t);
}
.step:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.step-no {
    font-size: 2.4rem; font-weight: 800; color: rgba(225,37,27,0.16); line-height: 1; display: block; margin-bottom: 0.5rem;
}
.step h3 { color: var(--aes-maroon); font-size: 1.08rem; margin-bottom: 0.4rem; }
.step p { color: var(--muted); font-size: 0.9rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; align-items: center; }
.about-text h2 { margin: 0.6rem 0 1.2rem; font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--aes-maroon); font-weight: 800; }
.about-text > p { color: var(--muted); margin-bottom: 1rem; }
.about-points { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin: 1.5rem 0 2rem; }
.about-points div { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; font-weight: 500; }
.about-points i { color: var(--aes-red); }
.about-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.about-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.6rem 1.3rem; box-shadow: var(--shadow); transition: var(--t);
}
.about-card:hover { transform: translateY(-5px); }
.about-card:nth-child(even) { margin-top: 1.6rem; }
.about-card i { font-size: 1.5rem; color: var(--aes-gold); margin-bottom: 0.7rem; }
.about-card strong { display: block; color: var(--aes-maroon); font-size: 1.05rem; }
.about-card span { font-size: 0.85rem; color: var(--muted); }

/* ---------- Clients ---------- */
.clients-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
.client-logo {
    padding: 1rem 2.2rem; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; font-weight: 800; font-size: 1.25rem; color: #b09a97;
    letter-spacing: 0.5px; transition: var(--t);
}
.client-logo:hover { color: var(--aes-red); border-color: var(--aes-red); transform: translateY(-3px); }

/* ---------- CTA ---------- */
.cta { background: linear-gradient(135deg, var(--aes-maroon-dk), var(--aes-maroon)); color: #fff; padding: 4.5rem 0; }
.cta-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.cta-text h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
.cta-text p { color: #f0d9d6; margin: 0.9rem 0 1.6rem; }
.cta-contact { display: grid; gap: 0.8rem; }
.cta-contact li { display: flex; align-items: center; gap: 0.7rem; color: #f6e6e3; }
.cta-contact i { color: var(--aes-gold); width: 20px; }
.cta-contact a:hover { color: var(--aes-gold); }
.cta-form {
    background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-lg);
    display: grid; gap: 0.9rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.cta-form input, .cta-form select, .cta-form textarea {
    width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 10px;
    font-family: inherit; font-size: 0.93rem; color: var(--ink); background: var(--bg-soft); transition: var(--t);
}
.cta-form input:focus, .cta-form select:focus, .cta-form textarea:focus {
    outline: none; border-color: var(--aes-red); background: #fff; box-shadow: 0 0 0 3px rgba(225,37,27,0.12);
}
.cta-form textarea { resize: vertical; }
.form-note { font-size: 0.85rem; text-align: center; margin: 0; min-height: 1rem; }
.form-note.ok { color: #1a9c5b; }
.form-note.err { color: #d93838; }

/* ---------- Footer ---------- */
.site-footer { background: var(--aes-maroon-dk); color: #e7cecb; padding-top: 3.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1.2fr 1fr 1.2fr; gap: 2.2rem; padding-bottom: 2.5rem; }
.logo--footer .logo-text strong { color: #fff; }
.logo--footer .logo-text em { color: #d6b0ac; }
/* Footer nền tối → đặt logo trên chip trắng cho nổi */
.logo--footer .logo-img { height: 44px; background: #fff; padding: 9px 14px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,0.22); box-sizing: content-box; }
.footer-col > p { font-size: 0.9rem; margin-top: 1rem; color: #d6b0ac; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-col a, .footer-col span { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; margin-bottom: 0.6rem; color: #e7cecb; transition: var(--t); }
.footer-col a:hover { color: var(--aes-gold); }
.footer-col i { color: var(--aes-gold); width: 16px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.3rem 0; font-size: 0.85rem; color: #cfa39f; text-align: center; }

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed; bottom: 24px; right: 24px; z-index: 90;
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--aes-red); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden;
    transform: translateY(12px); transition: var(--t);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--aes-gold); color: #3a2400; }

/* ---------- Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .about-grid, .cta-inner { grid-template-columns: 1fr; gap: 2.2rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .main-nav {
        position: fixed; top: 112px; right: 0; left: 0;
        background: #fff; flex-direction: column; align-items: stretch;
        padding: 1rem 24px 1.5rem; gap: 0.2rem;
        border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
        transform: translateY(-140%); transition: transform 0.3s ease; z-index: 99;
    }
    .main-nav.open { transform: translateY(0); }
    .main-nav a { padding: 0.8rem 0.5rem; }
    .main-nav .nav-cta { margin: 0.4rem 0 0; text-align: center; }
    .nav-toggle { display: block; }
    .topbar-contact { gap: 0.9rem; }
    .topbar-contact a span { display: none; }
}
@media (max-width: 540px) {
    .features-grid, .about-points, .footer-grid, .form-row { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .about-card:nth-child(even) { margin-top: 0; }
    .hero-stats { gap: 1.5rem; }
    .topbar-contact { font-size: 0.75rem; }
}

/* ---------- Nút nổi góc phải dưới: Chatbot · Gọi · Zalo · WhatsApp ---------- */
.back-to-top { bottom: 280px; right: 27px; width: 46px; height: 46px; }
.aes-fab-stack { position: fixed; right: 24px; bottom: 24px; z-index: 95; display: flex; flex-direction: column; gap: 12px; }
.aes-fab { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.25rem; box-shadow: 0 8px 22px rgba(24,27,34,0.25); transition: transform var(--t), box-shadow var(--t); text-decoration: none; }
.aes-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 28px rgba(24,27,34,0.3); color: #fff; }
.aes-fab-chat { background: var(--aes-red); }
.aes-fab-chat.active { background: var(--aes-maroon); }
.aes-fab-phone { background: #18a957; animation: aesFabRing 2.4s ease-in-out infinite; }
.aes-fab-zalo { background: #0068ff; }
.aes-fab-wa { background: #25d366; font-size: 1.6rem; }
.aes-fab-zalo-txt { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.2px; }
.aes-fab-tip { position: absolute; right: 64px; top: 50%; transform: translateY(-50%) translateX(6px); white-space: nowrap; background: var(--ink); color: #fff; font-size: 0.8rem; font-weight: 600; padding: 0.35rem 0.7rem; border-radius: 6px; opacity: 0; visibility: hidden; transition: var(--t); pointer-events: none; }
.aes-fab:hover .aes-fab-tip, .aes-fab:focus-visible .aes-fab-tip { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }
@keyframes aesFabRing { 0%, 100% { box-shadow: 0 8px 22px rgba(24,27,34,0.25), 0 0 0 0 rgba(24,169,87,0.45); } 50% { box-shadow: 0 8px 22px rgba(24,27,34,0.25), 0 0 0 10px rgba(24,169,87,0); } }

.chat-panel { position: fixed; right: 88px; bottom: 24px; z-index: 96; width: 360px; max-width: calc(100vw - 32px); height: 500px; max-height: calc(100vh - 140px); background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(24,27,34,0.25); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1rem; background: linear-gradient(135deg, var(--aes-maroon), var(--aes-red)); color: #fff; }
.chat-head strong { display: block; font-size: 0.98rem; }
.chat-head small { display: block; font-size: 0.75rem; opacity: 0.85; }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; }
.chat-close { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; opacity: 0.85; padding: 0.3rem; }
.chat-close:hover { opacity: 1; }
.chat-clear + .chat-close { margin-left: 0; }
.chat-clear { font-size: 0.95rem; }
.chat-ul { margin: .3rem 0 .3rem 1.1rem; padding: 0; list-style: disc; }
.chat-ul li { margin: .15rem 0; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; background: #faf7f6; display: flex; flex-direction: column; gap: 0.6rem; }
.chat-msg { max-width: 86%; padding: 0.6rem 0.85rem; border-radius: 14px; font-size: 0.9rem; line-height: 1.5; }
.chat-msg.bot { background: #fff; border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-msg.user { background: var(--aes-red); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-more { display: block; margin-top: .45rem; font-size: .82rem; color: #555; }
.chat-typing { display: inline-flex; gap: 4px; padding: 2px 0; }
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #b9bec7; animation: chatDot 1s infinite ease-in-out; }
.chat-typing i:nth-child(2) { animation-delay: .15s; } .chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chatDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-msg a { color: var(--aes-red); font-weight: 600; text-decoration: underline; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.6rem 0.8rem; border-top: 1px solid var(--line); background: #fff; }
.chat-quick button { border: 1px solid #f0c9c5; background: #fff; color: var(--aes-maroon); border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.chat-quick button:hover { background: var(--aes-red); border-color: var(--aes-red); color: #fff; }
.chat-form { display: flex; gap: 0.5rem; padding: 0.6rem 0.8rem 0.8rem; background: #fff; }
.chat-form input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 0.55rem 0.9rem; font-size: 0.9rem; font-family: inherit; outline: none; }
.chat-form input:focus { border-color: var(--aes-red); }
.chat-form button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--aes-red); color: #fff; cursor: pointer; }
@media (max-width: 600px) {
    .aes-fab-stack { right: 14px; bottom: 14px; gap: 10px; }
    .aes-fab { width: 46px; height: 46px; font-size: 1.1rem; }
    .back-to-top { right: 14px; bottom: 240px; width: 46px; }
    .aes-fab-wa { font-size: 1.4rem; }
    .aes-fab-tip { display: none; }
    .chat-panel { right: 12px; left: 12px; width: auto; bottom: 74px; height: 70vh; max-width: none; }
}
@media print { .aes-fab-stack, .chat-panel { display: none !important; } }
.chat-quick .chat-quick-lead { background: var(--aes-gold); border-color: var(--aes-gold); color: #3a2400; }
.chat-quick .chat-quick-lead:hover { background: var(--aes-gold-dk); border-color: var(--aes-gold-dk); color: #fff; }
.chat-msg .chat-lead { display: grid; gap: 0.45rem; margin-top: 0.6rem; }
.chat-lead input, .chat-lead select, .chat-lead textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.65rem; font-size: 0.86rem; font-family: inherit; background: #fff; color: var(--ink); outline: none; resize: vertical; }
.chat-lead select.ph { color: #8a8f98; }
.chat-lead input:focus, .chat-lead select:focus, .chat-lead textarea:focus { border-color: var(--aes-red); }
.chat-lead button { border: 0; border-radius: 8px; background: var(--aes-red); color: #fff; font-weight: 700; padding: 0.55rem; cursor: pointer; font-family: inherit; font-size: 0.88rem; }
.chat-lead button:disabled { opacity: 0.6; cursor: wait; }
.chat-lead-note { margin: 0; font-size: 0.8rem; color: var(--aes-red-dark); }
.chat-lead-note:empty { display: none; }
.chat-panel { height: 560px; }
/* Chữ trong 3 nút nổi: không in hoa / giãn chữ theo style trang, tránh vỡ dấu tiếng Việt */
.aes-fab-stack .aes-fab, .aes-fab-stack .aes-fab-tip, .aes-fab-stack .aes-fab-zalo-txt { text-transform: none; letter-spacing: normal; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; font-style: normal; }
.aes-fab-stack .aes-fab-tip { line-height: 1.45; padding: 0.4rem 0.75rem; font-size: 0.82rem; font-weight: 600; }
.aes-fab-stack .aes-fab-zalo-txt { line-height: 1; font-size: 0.8rem; font-weight: 800; }
