/* --- Reset CSS & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 1. Header & Navbar --- */
.navbar {
    background-color: #262626;
    padding: 15px 0;
    color: white;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #82b440; /* Màu xanh lục Envato */
    cursor: pointer;
}

.logo span {
    color: white;
    font-weight: normal;
}

nav a {
    color: #ccc;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
    transition: color 0.3s ease; /* Hover hiệu ứng màu chữ */
}

/* Hiệu ứng HOVER cho Link trong Nav */
nav a:hover {
    color: white;
}

/* --- 2. Nút Bấm Chính (Primary Button) --- */
.btn-primary {
    background-color: #82b440;
    color: white !important;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.3s ease; /* Transition tổng thể */
}

/* Hiệu ứng HOVER cho Nút Primary */
.btn-primary:hover {
    background-color: #6f9a36; /* Màu xanh đậm hơn một chút */
    box-shadow: 0 4px 10px rgba(130, 180, 64, 0.3); /* Đổ bóng nhẹ */
    transform: translateY(-2px); /* Nhích nhẹ lên trên */
}

/* --- 3. Hero Section & Search Box --- */
.hero {
    background-color: #333;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://via.placeholder.com/1500x400');
    background-size: cover;
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #ccc;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    border-radius: 4px;
    overflow: hidden; /* Đảm bảo góc bo tròn không bị lỗi */
}

.search-box input {
    flex: 1;
    padding: 15px;
    border: none;
    font-size: 16px;
    transition: box-shadow 0.3s ease;
}

/* Hiệu ứng FOCUS cho Input Tìm Kiếm (giống Hover) */
.search-box input:focus {
    outline: none;
    box-shadow: inset 0 0 5px rgba(130, 180, 64, 0.5); /* Đổ bóng bên trong khi focus */
}

.search-box button {
    padding: 15px 30px;
    border: none;
    background-color: #82b440;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Hiệu ứng HOVER cho Nút Tìm Kiếm */
.search-box button:hover {
    background-color: #6f9a36;
}

/* --- 4. Grid Sản Phẩm & Card Hover --- */
.section-title {
    margin: 40px 0 20px;
    font-size: 24px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.card {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    position: relative; /* Cho overlay */
    transition: all 0.3s ease-in-out; /* Transition mượt mà nhất */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Bóng nhẹ mặc định */
}

/* === HIỆU ỨNG HOVER CHÍNH CỦA CARD === */
.card:hover {
    transform: translateY(-8px); /* Nhích lên cao hơn một chút */
    box-shadow: 0 15px 30px rgba(0,0,0,0.15); /* Đổ bóng đậm và rộng hơn */
}

.card-image {
    height: 180px;
    background-color: #ddd;
    background-image: url('https://via.placeholder.com/300x200');
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease; /* Hiệu ứng zoom ảnh */
}

/* Phóng to ảnh nhẹ khi hover card */
.card:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
    background-color: white; /* Đảm bảo content nằm trên ảnh khi zoom */
    position: relative;
    z-index: 1;
}

.card-content h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
    transition: color 0.3s ease;
}

/* Đổi màu tiêu đề khi hover card */
.card:hover .card-content h3 {
    color: #82b440;
}

.author {
    font-size: 12px;
    color: #777;
    margin-bottom: 15px;
}

.author a {
    color: #82b440;
    text-decoration: none;
}
.author a:hover {
    text-decoration: underline;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: auto;
}

.price {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.sales {
    font-size: 12px;
    color: #999;
}

/* Layout Chung */
.category-section {
    background-color: #f5f7f9;
    padding: 80px 0;
    display: flex;
    justify-content: center;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.grid-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1140px;
    padding: 0 20px;
}

/* Cấu trúc Card */
.category-card {
    background: #ffffff;
    border: 1px solid #e1e8ed; /* Thay shadow bằng border mảnh */
    border-radius: 8px;
    height: 480px; /* Chiều cao cao ráo chuẩn gốc */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hover Card */
.category-card:hover {
    border-color: #ccd6dd; /* Viền đậm hơn một chút khi hover */
    transform: translateY(-4px);
}

/* Nội dung Text */
.category-info {
    padding-top: 50px;
    text-align: center;
}

.category-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.category-desc {
    color: #666;
    font-size: 15px;
    margin-bottom: 15px;
}

.category-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.category-links a {
    color: #0084b4;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.category-links a:hover {
    text-decoration: underline;
}

.divider {
    width: 1px;
    height: 12px;
    background-color: #d1d8db;
}

/* Phần Hình Ảnh và Badge */
.category-image-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 250px;
}

/* Badge Icon */
.badge {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e1e8ed; /* Phẳng hóa badge */
    font-size: 22px;
    z-index: 5;
}

.badge-wp { color: #21759b; }
.badge-cart { color: #ff8a00; }
.badge-html { color: #25d366; }




/* --- Card chính dựa trên thông số bạn gửi --- */
.category-card {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    height: 370px; /* Chiều cao bạn đã chỉnh */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* --- Container chứa cả Badge và Ảnh --- */
.category-image-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 135px; /* Chiều cao bạn đã chỉnh */
    
    /* Trạng thái ban đầu của nguyên cụm: đẩy xuống một chút */
    transform: translateY(15px); 
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- HIỆU ỨNG CHÍNH: Hover vào card thì nguyên cụm dịch lên --- */
.category-card:hover .category-image-box {
    transform: translateY(10px); /* Dịch chuyển cả cụm lên cùng nhau */
}

/* --- Badge nằm trong cụm dịch chuyển --- */
.badge {
    position: absolute;
    top: -40px; /* Theo thông số bạn gửi */
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e1e8ed;
    font-size: 22px;
    z-index: 5;
    /* Không cần transition riêng ở đây vì nó đi theo cha */
}

/* --- Hình ảnh nằm trong cụm dịch chuyển --- */
.floating-img {
    width: 85%;
    height: auto;
    display: block;
    /* Loại bỏ transform riêng của img để nó đi đồng bộ với Badge */
}

/* Các tùy chỉnh phụ cho đẹp */
.category-info {
    padding: 30px 20px 0;
    text-align: center;
}

.category-card:hover {
    border-color: #ccd6dd;
}