:root {
    --primary: #002B5B;
    --accent: #FF8E26;
    --bg-light: #F8F9FD;
    --text-main: #2D3436;
    --text-muted: #636E72;
    --white: #FFFFFF;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #e0e0e0;
    color: var(--text-main);
}

.app-container {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-light);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Auth Screen */
.auth-box {
    width: 100%;
    max-width: 360px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 28px 22px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: fadeUp 0.5s ease;
}

/* TITLE */
.auth-box h1 {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 6px;
    color: #001a72;
    letter-spacing: -0.5px;
}

.text-accent {
    color: #ff8c00;
}

.auth-box p {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 20px;
}

/* INPUT GROUP */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* INPUT */
.input-group input {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.9rem;
    outline: none;
    transition: 0.2s;
}

/* FOCUS */
.input-group input:focus {
    border-color: #001a72;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 26, 114, 0.1);
}

/* BUTTON */
.btn-primary {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border-radius: 16px;
    border: none;
    font-weight: 800;
    font-size: 0.95rem;
    color: white;
    background: linear-gradient(135deg, #001a72, #0033cc);
    cursor: pointer;
    transition: 0.2s;
}

/* BUTTON HOVER */
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* HIDDEN FIELD ANIMATION */
.hidden {
    display: none;
}

/* ANIMATION */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-circle {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
    box-shadow: var(--shadow);
}

.text-accent {
    color: var(--accent);
}

/* Header & Tab UI */
.sticky-header {
    padding: 30px 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
}

.welcome-user {
    font-size: 20px;
    font-weight: 800;
}

.avatar-mini {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

/* Banner & Grid */
.banner-card {
    margin: 0 25px 25px;
    padding: 25px;
    background: var(--primary);
    color: white;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 43, 91, 0.2);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 0 25px;
}

.service-item {
    background: var(--white);
    padding: 20px 10px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.service-item:active {
    transform: scale(0.95);
}

.icon-box {
    font-size: 28px;
    margin-bottom: 8px;
}

.service-item span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
}

/* Row Buttons */
.quick-access {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 18px;
    background: var(--white);
    font-weight: 600;
    text-align: left;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.row-btn.support {
    color: #27ae60;
}

.row-btn.sos {
    color: #e74c3c;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 430px;
    height: 80px;
    background: var(--white);
    display: flex;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.03);
    border-radius: 30px 30px 0 0;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.nav-item.active {
    color: var(--primary);
    font-weight: 800;
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 10px;
    margin-top: 4px;
}

/* Order Cards (History) */
.history-card {
    background: var(--white);
    margin: 15px 25px;
    padding: 15px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-pill.pending {
    background: #fff3e0;
    color: #ff9800;
}

.status-pill.done {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Overlay Popups */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.overlay-content {
    background: var(--bg-light);
    width: 100%;
    border-radius: 35px 35px 0 0;
    padding: 30px 25px 50px;
    max-height: 90vh;
    overflow-y: auto;
}

.btn-primary {
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

/* Stats Bar */
.stats-bar {
    margin: 25px;
    padding: 20px;
    background: var(--white);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    box-shadow: var(--shadow);
}

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

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.divider {
    width: 1px;
    background: #eee;
    height: 30px;
    align-self: center;
}

/* --- HIGHLIGHTS: HIỂN THỊ 2 CỘT VỪA KHÍT --- */
.highlights-section {
    display: flex;
    gap: 12px;
    /* Khoảng cách giữa 2 thẻ */
    padding: 0 25px;
    /* Căn lề trái phải bằng với Header và Service Grid */
    margin-bottom: 25px;
    justify-content: space-between;
    /* Đẩy 2 thẻ ra sát lề */
}

.highlight-card {
    flex: 1;
    /* Quan trọng: Chia đều không gian để 2 thẻ bằng nhau 100% */
    padding: 15px 12px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    min-height: 100px;
    /* Chiều cao cố định để 2 thẻ luôn cao bằng nhau */
}

/* Màu nền nhẹ */
.highlight-card.promo {
    background: #E3F2FD;
}

.highlight-card.trust {
    background: #F1F8E9;
}

.card-content .tag {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--white);
    padding: 3px 7px;
    border-radius: 6px;
    color: var(--primary);
    display: inline-block;
    margin-bottom: 6px;
}

.card-content h4 {
    margin: 0;
    font-size: 14px;
    /* Giảm nhẹ font để không bị nhảy dòng trên máy nhỏ */
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    /* Giữ chữ trên một dòng */
}

.card-content p {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

.card-deco {
    font-size: 32px;
    /* Thu nhỏ icon trang trí */
    opacity: 0.12;
    position: absolute;
    right: -5px;
    bottom: -5px;
    transform: rotate(-10deg);
}

/* Sửa lỗi ô nhập liệu bị dàn hàng ngang */
.input-group-v3 {
    display: flex;
    flex-direction: column;
    /* Bắt buộc xếp chồng theo chiều dọc */
    gap: 15px;
    /* Khoảng cách giữa các ô */
    margin-top: 10px;
}

.input-group-v3 label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.input-group-v3 input,
.input-group-v3 select,
.input-group-v3 textarea {
    width: 100%;
    /* Chiếm hết chiều ngang */
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #E0E0E0;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group-v3 input:focus {
    border-color: var(--accent);
    /* Đổi màu viền khi nhấn vào */
}

/* Tùy chỉnh riêng cho phần text thông báo trong form */
.form-sub-title {
    margin: 10px 0 5px;
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
}

/* Giao diện danh sách đi chợ mới */
/* Container chứa các món đã thêm */
#shopping-items-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Thẻ món hàng */
.shopping-item-card {
    background: #fff;
    padding: 15px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border-left: 5px solid var(--accent);
    /* Nhấn nhá màu sắc */
}

/* Thẻ nhập món mới */
.shop-input-card {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid #eee;
}

.card-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.input-row input {
    background: #f1f4f9 !important;
    border: none !important;
}

/* Nút thêm món riêng */
.btn-add-item {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.btn-add-item:active {
    transform: scale(0.98);
}


/* Nút xóa món */
.btn-remove-item {
    background: #fff0f1;
    color: #ff4757;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hiệu ứng Overlay trượt lên */
.overlay {
    background: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.overlay-content {
    transform: translateY(100%);
    /* Bắt đầu ở dưới cùng */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    /* Hiệu ứng mượt */
}

/* Khi lớp 'hidden' bị loại bỏ, chúng ta kích hoạt hiệu ứng qua JS */
.overlay:not(.hidden) .overlay-content {
    transform: translateY(0);
    /* Trượt lên vị trí cũ */
}

/* Tinh chỉnh lại ô nhập liệu cho sang trọng */
.input-group-v3 input,
.input-group-v3 select,
.input-group-v3 textarea {
    border: 1.5px solid #f0f0f0;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.input-group-v3 input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 43, 91, 0.08);
}

/* Tracking Css */
/* Container Tracking Ngang */
.tracking-wrapper {
    padding: 20px 10px;
}

/* Timeline Ngang */
.timeline-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin-bottom: 30px;
    padding: 0 10px;
}

/* Đường kẻ nối giữa các bước */
.timeline-horizontal::before {
    content: '';
    position: absolute;
    top: 20px;
    /* Căn giữa theo icon */
    left: 40px;
    right: 40px;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    opacity: 0.3;
    transition: all 0.4s ease;
}

.step-item.active {
    opacity: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step-item.active .step-icon {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 43, 91, 0.2);
}

.step-label {
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    color: var(--text-main);
    white-space: nowrap;
}

/* Cập nhật màu đường kẻ khi đạt tới bước đó */
.step-item.active~.step-item::before {
    background: #e0e0e0;
}

/* FLOATING BUTTON */
.floating-contact {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 999;
}

.float-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    font-size: 22px;
    animation: shake 2.5s infinite;
}

/* ZALO */
.float-btn.zalo {
    background: #0084ff;
}

.float-btn.zalo img {
    width: 28px;
    height: 28px;
}

/* PHONE */
.float-btn.phone {
    background: #10b981;
    color: white;
}

/* HIỆU ỨNG SÓNG */
.pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulseWave 2s infinite;
    z-index: -1;
    opacity: 0.6;
}

/* ANIMATION SÓNG */
@keyframes pulseWave {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    70% {
        transform: scale(1.6);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}