:root {
    --primary-color: #0056b3;
    --secondary-color: #ff9900;
    --text-color: #333;
    --light-bg: #f4f4f4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.top-bar {
    background: #333;
    color: #fff;
    padding: 10px 0;
    font-size: 0.9em;
}
.top-bar span { margin-right: 20px; }

.navbar {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
}
.nav-links li {
    margin-left: 10px;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}
.nav-links a:hover {
    color: #fff;
    background-color: var(--primary-color);
}
.nav-links a.active {
    color: #fff;
    background-color: var(--secondary-color);
    font-weight: bold;
}
.nav-links a i {
    margin-right: 5px;
}

/* Hero */
.hero {
    background: linear-gradient(rgba(0,86,179,0.6), rgba(0,86,179,0.6)), url('https://www.sheknows.com/wp-content/uploads/2018/08/p9lavthpuu0w1gynuv88.jpeg');
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    padding: 100px 0;
}
.hero h1 { font-size: 2.5em; margin-bottom: 20px; }
.hero p { font-size: 1.2em; margin-bottom: 30px; }
.hero .btn-primary {
    animation: pulse-cta 2s infinite;
}
@keyframes pulse-cta {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 153, 0, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(255, 153, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 153, 0, 0); }
}

/* Buttons */
.btn-primary {
    background: var(--secondary-color);
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-block;
}
.btn-primary:hover { background: #e68a00; }
.btn-secondary {
    background: var(--primary-color);
    color: #fff;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    margin-top: 10px;
}

/* Features */
.features {
    display: flex;
    justify-content: space-between;
    padding: 50px 15px;
    text-align: center;
    flex-wrap: wrap;
}
.feature-item {
    flex: 1;
    min-width: 250px;
    padding: 20px;
}
.feature-item i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Packages */
.loan-packages {
    background: var(--light-bg);
    padding: 60px 0;
}
.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}
.packages-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.package-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
    width: 300px;
    transition: transform 0.3s;
}
.package-card:hover { transform: translateY(-5px); }
.package-card i {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

/* Process */
.process { padding: 60px 15px; }
.steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.step {
    text-align: center;
    flex: 1;
    min-width: 200px;
}
.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    line-height: 40px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Contact */
.contact-section {
    background: #004494;
    color: #fff;
    padding: 60px 0;
    text-align: center;
}
.contact-form {
    max-width: 500px;
    margin: 30px auto 0;
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 8px;
}
.form-group {
    margin-bottom: 15px;
    position: relative;
}
.form-group input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: none;
    border-radius: 4px;
}
.form-group i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* Footer */
footer {
    background: #222;
    color: #ccc;
    padding: 50px 0 0;
}
.footer-col {
    width: 30%;
    display: inline-block;
    vertical-align: top;
    margin-bottom: 30px;
    padding-right: 20px;
}
.footer-col h3 { color: #fff; margin-bottom: 20px; border-bottom: 2px solid var(--secondary-color); display: inline-block; padding-bottom: 5px; }
.footer-col p { margin-bottom: 10px; }
.footer-col i { width: 20px; color: var(--secondary-color); }
.copyright {
    background: #111;
    text-align: center;
    padding: 15px 0;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .footer-col { width: 100%; display: block; }
}

/* --- Styles cho các trang con --- */
.page-header {
    background: var(--primary-color);
    color: #fff;
    padding: 50px 0;
    text-align: center;
    margin-bottom: 30px;
}
.page-header h1 { font-size: 2.2em; margin-bottom: 10px; }
.page-header p { font-size: 1.1em; opacity: 0.9; }

.content-block { padding: 40px 0; }
.content-block h2 { color: var(--primary-color); margin-bottom: 20px; font-size: 1.8em; }
.content-block p { margin-bottom: 15px; text-align: justify; }
.content-block ul { margin-left: 20px; margin-bottom: 20px; }
.content-block li { margin-bottom: 10px; }
.content-block img { max-width: 100%; border-radius: 8px; margin: 20px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

/* Floating Contact */
.floating-contact {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s;
    text-decoration: none;
    position: relative;
}

.contact-btn:hover { transform: scale(1.1); }

.zalo-btn { background: #fff; }
.zalo-btn img { width: 100%; height: 100%; border-radius: 50%; }

.phone-btn { background: #28a745; color: #fff; font-size: 1.2em; overflow: hidden; width: auto; padding: 0 15px; border-radius: 25px; }
.phone-btn i { animation: phone-shake 1.5s infinite; margin-right: 5px; }
.phone-text { font-weight: bold; font-size: 1rem; white-space: nowrap; }

@keyframes phone-shake {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

/* Responsive Logic for Contact */
@media (min-width: 769px) {
    .zalo-btn { display: none; } /* Laptop ẩn Zalo */
    .phone-btn { height: 45px; }
}

@media (max-width: 768px) {
    .header-slogan { display: none; }
    .phone-text { display: none; } /* Mobile ẩn số, chỉ hiện icon */
    .phone-btn { width: 50px; height: 50px; border-radius: 50%; padding: 0; }
    .phone-btn i { margin-right: 0; }
    .floating-contact { bottom: 10px; left: 10px; }
}

/* Table Styles & Hero Subtitle */
.hero-subtitle { font-size: 1.2em; font-style: italic; margin-top: -15px; margin-bottom: 25px; color: #ffcc00; font-weight: 500; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

.table-responsive {
    overflow-x: auto;
    border-radius: 8px; /* Add radius for overflow content */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.table-loan {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    transition: all 0.3s ease;
}
.table-loan th, .table-loan td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}
.table-loan th {
    background: var(--primary-color);
    color: #fff;
    white-space: nowrap;
    font-weight: 600;
}
.table-loan tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
.table-loan tbody tr:hover {
    background-color: #f1f1f1;
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}
.table-loan td:first-child {
    font-weight: 500;
    color: var(--primary-color);
}
.note-text {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    line-height: 1.5;
    text-align: justify;
    background: #fffbe6;
    padding: 15px;
    border-left: 4px solid var(--secondary-color);
    margin-top: 20px;
    border-radius: 0 5px 5px 0;
}

/* --- Dropdown Menu Styles (Bổ sung) --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 4px;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #eee;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
}

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

/* Hiệu ứng hover cho Desktop */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* --- Mobile Menu (Hamburger) --- */
.menu-toggle {
    display: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap; /* Cho phép xuống dòng */
    }
    
    .menu-toggle {
        display: block; /* Hiện nút 3 gạch */
    }

    .nav-links {
        display: none; /* Ẩn menu mặc định */
        width: 100%;
        flex-direction: column;
        margin-top: 15px;
        background-color: #fff;
        border-top: 1px solid #eee;
    }

    .nav-links.active {
        display: flex; /* Hiện menu khi click */
    }

    .nav-links li {
        margin: 0;
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }

    /* Dropdown trên mobile */
    .dropdown { width: 100%; }
    .dropdown-content {
        position: relative;
        width: 100%;
        box-shadow: none;
        background-color: #f8f9fa;
    }
    .dropdown-content a {
        padding-left: 30px; /* Thụt đầu dòng cho menu con */
    }
}

/* --- Calculator Styles --- */
.calculator-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-top: 40px;
    border: 1px solid #e0e0e0;
}
.calculator-box label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block;
}
.calculator-box input, .calculator-box select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: border 0.3s;
}
.calculator-box input:focus, .calculator-box select:focus {
    border-color: var(--primary-color);
    outline: none;
}
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

/* --- Popup Styles --- */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s;
}

.popup-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideDown 0.5s;
    border-top: 5px solid var(--secondary-color);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-popup:hover { color: #333; }
.popup-header h3 { color: var(--primary-color); margin-top: 10px; font-size: 1.5em; }
.popup-body p { margin: 10px 0; font-size: 1.1em; color: #555; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }