/* =========================
    RESET
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* =========================
    BODY & HIỆU ỨNG GRADIENT NỀN ĐỘNG
========================= */
body {
    color: #333;
    background: linear-gradient(-45deg, #ffb6c1, #ffc0cb, #fff0f5, #ff69b4);
    background-size: 400% 400%;
    animation: gradientBG 10s ease infinite;
}

@keyframes gradientBG {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

/* =========================
    HEADER WITH BLUR EFFECT & SHADOW
========================= */
header {
    position: sticky;
    top: 0;
    background: rgba(255,105,180,0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    color: white;
    padding: 15px;
    text-align: center;
}

header nav {
    margin-top: 10px;
}

header nav a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
    transition: 0.3s;
}

header nav a:hover {
    color: yellow;
}

/* =========================
    NÚT FILTER
========================= */
button {
    padding: 10px 15px;
    margin: 5px;
    border: none;
    background: #ff69b4;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
}

button:hover {
    background: #ff1493;
    transform: scale(1.05);
}

/* =========================
    PRODUCT GRID (PC)
========================= */
.product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
}

/* =========================
    PRODUCT CARD
========================= */
.product {
    background: white;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transition: 0.3s;
    animation: fadeIn 0.5s ease-in;
}

.product img {
    width: 100%;
    border-radius: 10px;
}

.product:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,105,180,0.5);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================
    LOGIN / REGISTER FORM
========================= */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

.auth-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.auth-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.auth-box button {
    width: 100%;
}

/* =========================
    HIỆU ỨNG LOADING KHI VÀO TRANG
========================= */
#loading {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #ff69b4;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* =========================
    POPUP SẢN PHẨM
========================= */
.popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Nổi bật hơn header */
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    width: 300px;
}

.popup img {
    width: 100%;
    border-radius: 10px;
}

.close {
    float: right;
    cursor: pointer;
    font-size: 20px;
}

/* =========================
    HIỆU ỨNG TIM BAY LÊN TRỜI (BẢN CẢI TIẾN LUNG LINH 100%)
========================= */
.hearts {
    position: fixed;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    top: 0;
    left: 0;
}

.hearts span {
    position: absolute;
    font-size: 20px;
    /* 🛠 CẢI TIẾN: Thêm bộ lọc đổ bóng nhẹ và chuyển động mượt mà hơn */
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
    animation: floatUp 5s ease-in-out infinite; 
}

/* 🛠 TÁI CẤU TRÚC HOẠT ẢNH: Giúp tim bay lắc lư sang hai bên và mờ dần nghệ thuật */
@keyframes floatUp {
    0% { 
        transform: translateY(110vh) translateX(0) scale(0.5); 
        opacity: 0; 
    }
    10% {
        opacity: 1; /* Vừa bay lên khỏi cạnh dưới màn hình là hiện rõ ngay */
    }
    50% { 
        /* Bay đến giữa màn hình thì uốn lượn sang phải một chút và phóng to nhẹ */
        transform: translateY(50vh) translateX(25px) scale(1.1); 
    }
    75% {
        /* Tiếp tục uốn lượn sang trái tạo quỹ đạo hình chữ S dập dềnh */
        transform: translateY(25vh) translateX(-20px) scale(1);
    }
    100% { 
        /* Bay lên đỉnh màn hình thì thu nhỏ, mờ dần rồi biến mất hẳn */
        transform: translateY(-10vh) translateX(10px) scale(0.6); 
        opacity: 0; 
    }
}


/* =========================
    DROPDOWN BỘ SƯU TẬP
========================= */
.dropdown {
    position: relative;
    display: inline-block;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 180px;
    top: 100%;
    left: 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 999;
}

.dropdown-content a {
    display: block;
    padding: 10px;
    color: black;
    text-decoration: none;
    transition: 0.3s;
}

.dropdown-content a:hover {
    background: pink;
}

/* hover để xổ menu */
.dropdown:hover .dropdown-content {
    display: block;
}

/* =========================
    FOOTER (CHIA 3 CỘT)
========================= */
footer {
    background-color: pink;
    color: white;
    padding: 30px 0;
    margin-top: 30px;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-container {
    display: flex;
    width: 90%;
    margin: auto;
}

.footer-left,
.footer-center,
.footer-right {
    flex: 1;
    padding: 10px;
}

.footer-left {
    text-align: left;
}

/* CHỮ MÔ TẢ */
.footer-desc {
    color: white;          /* màu dịu */
    font-size: 14px;      /* nhỏ gọn */
    line-height: 1.6;     /* giãn dòng */
    letter-spacing: 0.5px;/* giãn chữ nhẹ */
}

/* =========================
    CÁC PHẦN CHO TRANG CÁ NHÂN (MXH)
========================= */
.social {
    margin-top: 10px;
}

/* Cho list nằm ngang Nằm ngang */
.social ul {
    display: flex;          /* xếp ngang */
    gap: 20px;              /* khoảng cách */
    list-style: none;       /* bỏ dấu chấm */
    padding: 0;
    margin: 0;
}

/* Link */
.social li a {
    display: flex;
    align-items: center;    /* căn giữa */
    color: white;
    text-decoration: none;
    transition: 0.3s;       /* hiệu ứng mượt */
}

/* Icon */
.social img {
    width: 25px;
    margin-left: 6px;
    transition: 0.3s;
}

/* Hover */
.social li a:hover {
    transform: translateY(-4px);  /* nổi lên */
    color: #ffcc00;               /* đổi màu chữ */
}

.social li a:hover img {
    transform: scale(1.2);        /* phóng to icon */
}

/* =========================
    🛒 KHUNG GIỎ HÀNG 
========================= */
#cart-box {
    position: fixed; /* cố định vị trí khi cuộn trang */
    right: 10px;     /* cách mép phải 10px */
    top: 100px;      /* cách trên 100px để không đè header */
    width: 280px;    /* 🛠 CẢI TIẾN: Tăng lên một chút tránh tràn chữ khi tên sản phẩm dài */
    background: white; /* nền trắng để dễ nhìn */
    border-radius: 10px; /* bo góc cho đẹp */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* đổ bóng tạo chiều sâu */
    padding: 15px;   /* khoảng cách bên trong cho thoáng */
    z-index: 999;    /* luôn nổi lên trên các phần khác */
}

/* 📋 DANH SÁCH SẢN PHẨM TRONG GIỎ */
#cart-list {
    list-style: none; /* bỏ dấu chấm đầu dòng mặc định */
    padding: 0;       /* bỏ khoảng cách mặc định của ul */
    margin: 0 0 10px 0;/* tạo khoảng cách nhẹ với nút thanh toán bên dưới */
}

/* 🧾 MỖI DÒNG SẢN PHẨM TRONG GIỎ */
#cart-list li {
    font-size: 13px;  /* chữ nhỏ gọn cân đối */
    margin: 8px 0;    /* tạo khoảng cách giữa các sản phẩm */
    display: flex;    /* sắp xếp hàng ngang */
    justify-content: space-between; /* tách đều hai đầu */
    align-items: center; /* căn giữa theo chiều dọc */
    border-bottom: 1px dashed #f0f0f0; /* tạo đường kẻ phân cách nhẹ */
    padding-bottom: 4px;
}

/* 🛠 KHẮC PHỤC LỖI QUAN TRỌNG: Định hình riêng cho các nút tăng giảm số lượng (+, -, ❌) trong danh sách */
#cart-list li button {
    width: auto;         /* Không để nút bị kéo rộng 100% */
    display: inline-block;
    padding: 2px 6px;    /* Kích thước nút nhỏ gọn vừa vặn */
    margin: 0 2px;
    font-size: 11px;
    background: #ff69b4;
    border-radius: 4px;
}

/* 🔘 NÚT THANH TOÁN CHÍNH TRONG HỘP GIỎ HÀNG */
#cart-box > button {
    width: 100%;        /* Nút thanh toán full chiều ngang hộp */
    background: hotpink; /* màu nổi bật */
    color: white;       /* chữ trắng dễ đọc */
    border: none;       
    padding: 10px;      /* tăng diện tích bấm */
    cursor: pointer;    
    border-radius: 6px; 
    transition: 0.3s;   
    font-weight: bold;
    margin-top: 5px;
}

/* ✨ HIỆU ỨNG KHI RÊ CHUỘT VÀO NÚT */
#cart-box button:hover {
    background: deeppink; /* đổi màu khi hover */
    transform: scale(1.03); /* phóng nhẹ tạo phản hồi tương tác */
}

#cart-icon {
    position: fixed;   /* cố định icon trên màn hình, cuộn trang vẫn không mất */
    top: 15px;         /* Chỉnh xuống tí để cân đối */
    right: 15px;       /* cách mép phải 15px */
    background: pink;  /* nền màu hồng cho đẹp */
    padding: 10px;     /* tạo khoảng cách bên trong cho icon không bị sát */
    border-radius: 50px; /* bo tròn thành hình tròn (giống nút app) */
    font-size: 20px;    /* kích thước chữ/emoji to lên */
    z-index: 1001;     /* Luôn nằm trên cả header */
    cursor: pointer;
}

/* =========================
    RESPONSIVE MOBILE 
========================= */
@media (max-width: 768px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }

    header nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* 🛠 SỬA LỖI RESPONSIVE: Ép 3 cột dọc trên điện thoại để không bị tràn chữ */
    .footer-container {
        flex-direction: column;
    }
    
    #cart-box {
        position: static;
        width: 100%;
        margin-top: 20px;
    }
}

/* =========================
    MOBILE NHỎ HƠN NỮA
========================= */
@media (max-width: 480px) {
    .product-list {
        grid-template-columns: repeat(1, 1fr);
    }

    header h1 {
        font-size: 18px;
    }
}