/* ================= CÀI ĐẶT CƠ BẢN ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; background-color: #f9f9f9; color: #333; }
a { text-decoration: none; color: inherit; }
.container { width: 85%; max-width: 1200px; margin: 0 auto; }

/* ================= HEADER & TOP BAR ================= */
.top-bar { background-color: #eee; border-bottom: 1px solid #ccc; font-size: 13px; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.text-green { color: green; }

.main-header { background-color: white; padding: 15px 0; border-bottom: 2px solid green; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo img { max-width: 150px; height: auto; display: block; }

.search-cart-wrap { display: flex; flex-grow: 1; justify-content: flex-end; gap: 15px; }
.search-bar { flex-grow: 1; max-width: 600px; height: 42px; padding: 5px 15px; border: 1px solid green; border-radius: 5px; outline: none; }
.btn-cart { background-color: green; color: white; border: none; border-radius: 5px; padding: 0 20px; height: 42px; cursor: pointer; font-weight: bold; }

/* ================= BANNER & MENU ================= */
.hero-section { display: flex; gap: 20px; margin: 30px auto; }
.category-menu { width: 25%; background-color: white; border-radius: 15px; border: 1px solid #ddd; overflow: hidden; }
.category-menu h2 { background-color: green; color: white; font-size: 16px; padding: 15px; margin: 0; text-align: center; }
.category-menu ul { list-style: none; }
.category-menu ul li a { display: block; padding: 12px 20px; border-bottom: 1px solid #eee; transition: 0.3s; }
.category-menu ul li a:hover { background-color: #f1f1f1; padding-left: 25px; color: green; }

/* Giao diện cho phần tick chọn điều khoản */
.form-group.terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 25px;
}

.form-group.terms label {
    margin-bottom: 0;
    font-weight: normal;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.form-group.terms label a {
    color: #3498db;
    text-decoration: none;
}

.form-group.terms label a:hover {
    text-decoration: underline;
}

.form-group.terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-top: 2px;
}

/* Phần đăng nhập */
        .login-section {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 80px 20px; /* Tạo khoảng cách với Header và Footer */
            background-color: #f0f2f5;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        /* Giao diện thẻ (Card) */
        .login-card {
            background-color: #ffffff;
            width: 100%;
            max-width: 420px;
            padding: 40px 30px;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .login-card h1 {
            text-align: center;
            color: #333333;
            margin-bottom: 30px;
            font-size: 26px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #555555;
            font-weight: 600;
            font-size: 14px;
        }

        .form-group label span {
            color: #e74c3c; 
        }

        /* Vùng chứa ô nhập liệu để căn chỉnh icon */
        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .form-group input {
            box-sizing: border-box;
            width: 100%;
            height: 45px;
            padding: 10px 15px;
            padding-right: 45px; 
            border: 1px solid #cccccc;
            border-radius: 5px;
            font-size: 15px;
            transition: border-color 0.3s;
        }

        .form-group input:focus {
            border-color: #4CAF50;
            outline: none;
            box-shadow: 0 0 5px rgba(76, 175, 80, 0.2);
        }

        /* Nút ẩn/hiện mật khẩu */
        .toggle-password {
            position: absolute;
            right: 10px;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 18px;
            color: #888;
            outline: none;
        }

        .toggle-password:hover {
            color: #333;
        }

        .actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 30px;
        }

        .btn-submit {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            font-weight: bold;
            transition: background-color 0.3s;
        }

        .btn-submit:hover {
            background-color: #45a049;
        }

        .forgot-password {
            color: #3498db;
            text-decoration: none;
            font-size: 14px;
            transition: color 0.3s;
        }

        .forgot-password:hover {
            color: #2980b9;
            text-decoration: underline;
        }

/* Khối Banner */
        .banner-wrap {
            flex: 1;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            background-color: #ddd; /* Màu nền dự phòng nếu ảnh lỗi */
        }
        .banner-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ================= KHỐI SẢN PHẨM ================= */
.products-area { background-color: #e9ecef; padding-bottom: 50px; }


.section-title { background-color: green; color: white; font-size: 18px; padding: 15px 0; text-align: center; margin-bottom: 30px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.product-card { background-color: #fff; border: 1px solid #ddd; border-radius: 15px; padding: 15px; text-align: center; position: relative; transition: 0.3s; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.product-card img { width: 100%; height: 200px; object-fit: cover; border-radius: 10px; }

.badge { position: absolute; top: 20px; left: 20px; background-color: #ff9800; color: white; padding: 4px 8px; font-size: 11px; font-weight: bold; border-radius: 5px; }
.badge.new { background-color: #f44336; }

.product-card h3 { color: green; font-size: 16px; margin: 15px 0 10px; height: 40px; overflow: hidden; }
.product-price { color: #ff9800; font-weight: bold; font-size: 18px; display: block; margin-bottom: 15px; }
.btn-action { background-color: #fff; color: green; border: 1px solid green; padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; width: 100%; transition: 0.3s; }
.btn-action:hover { background-color: green; color: white; }

/* ================= FOOTER ================= */
.footer { background-color: #333; color: #ccc; padding: 50px 0 20px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer h3 { color: #4CAF50; margin-bottom: 15px; font-size: 16px; }
.footer ul { list-style: none; line-height: 2.2; }
.footer ul li a:hover { color: #4CAF50; padding-left: 5px; }

/* ================= GIAO DIỆN ĐIỆN THOẠI & TABLET (RESPONSIVE) ================= */
@media (max-width: 768px) {
    /* 1. Mở rộng không gian hiển thị trên màn hình nhỏ */
    .container { 
        width: 95%; 
    }

    /* 2. Top Bar: Xếp dọc chữ lại để không bị tràn viền */
    .top-bar .container { 
        flex-direction: column; 
        height: auto; 
        padding: 8px 0; 
        text-align: center; 
        gap: 5px; 
    }

    /* 3. Header: Đưa thanh tìm kiếm và giỏ hàng xuống dưới Logo */
    .main-header .container { 
        flex-direction: column; 
        gap: 15px; 
    }
    .search-cart-wrap { 
        width: 100%; 
        justify-content: space-between; 
    }
    .search-bar { 
        width: 65%; /* Chia lại tỷ lệ cho thanh tìm kiếm và nút giỏ hàng */
    }
    .btn-cart { 
        width: 32%; 
        padding: 0; 
        font-size: 12px; 
    }

    /* 4. Khối Danh mục & Banner: Xếp chồng lên nhau (Cột dọc) thay vì hàng ngang */
    .hero-section { 
        flex-direction: column; 
    }
    .category-menu { 
        width: 100%; 
        margin-bottom: 15px; 
    }
    .banner-wrap { 
        width: 100%; 
        height: 200px; /* Giảm chiều cao banner để vừa vặn với màn hình điện thoại */
    }
}

/* Hiệu ứng nhịp đập cho nút Zalo */
@keyframes pulse-zalo {
    0% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(0, 104, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0); }
}

/* Nút bong bóng Zalo */
.zalo-bubble {
    position: fixed;
    bottom: 30px; /* Cách lề dưới 30px */
    right: 30px;  /* Cách lề phải 30px */
    width: 60px;
    height: 60px;
    background-color: #0068ff; /* Màu xanh chuẩn của Zalo */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Đảm bảo luôn nằm trên cùng */
    text-decoration: none;
    transition: transform 0.3s ease;
    animation: pulse-zalo 2s infinite; /* Gọi hiệu ứng nhịp đập */
    overflow: hidden; /* Đảm bảo ảnh không bị tràn ra ngoài */
    padding: 10px; /* Tạo khoảng trống xung quanh logo */
}

.zalo-bubble:hover {
    transform: scale(1.1); /* Phóng to nhẹ khi di chuột vào */
}

/* Định dạng ảnh logo Zalo */
.zalo-bubble img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ảnh luôn nằm gọn trong vòng tròn */
}