/* --- Áp dụng cho TOÀN BỘ trang web (Chặn bôi đen, chặn menu giữ ảnh trên điện thoại) --- */
body, html {
    -webkit-user-select: none;    
    -moz-user-select: none;        
    -ms-user-select: none;        
    user-select: none;            
    /* ĐÃ XÓA -webkit-touch-callout: none; ở đây để cho phép hiện preview link */
}

/* html {
    scroll-behavior: smooth;
} */

/* Cho phép người dùng nhập liệu bình thường ở các ô tìm kiếm hoặc ô nhập văn bản */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Thiết lập chung và body */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    display: block; /* Đổi từ flex sang block để khung dính sát đỉnh */
    min-height: 100vh;
    position: relative;
    background-color: #f9f6f0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('generated-images__link-in-bio__header-block__home__155e7f6a-af6e-482b-82a9-f696f2c221dc__448709b6-f2b4-4eed-a0bf-a99daf469901.webp');
    background-position: center;
    filter: blur(50px) brightness(1.4) saturate(1.3);
    transform: scale(1.2);
    z-index: -2;
}
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.4);
    z-index: -1;
}

/* Khung chính của trang Bio */
.bio-container {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(to bottom, #453731 0%, #5E524D 50%, #C2BAB6 75%, #FFFFFF 100%);
    min-height: 100vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-bottom: 40px;
    box-sizing: border-box;
    z-index: 1;
    border-radius: 0 !important;
    margin: 0 auto !important; /* Đảm bảo căn giữa trên PC và dính sát đỉnh trên mobile */
}

/* 1. Ảnh bìa (Cover photo) */
.cover-photo {
    width: 100%;
    height: 180px;
    overflow: hidden;
}
.cover-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 2. Avatar tròn */
.avatar-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    margin: -50px auto 10px auto;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background-color: #fff;
}
.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 3. Tên và Bio */
.profile-info {
    text-align: center;
    margin-bottom: 15px;
    padding: 0 15px;
}
.profile-info h1 {
    font-size: 30px;
    margin: 0 0 5px 0;
    color: #ffffff;
    font-weight: 700;
    font-family: Playfair Display;
}
.profile-info p {
    font-size: 20px;
    color: #ffffff;
    margin: 0;
    font-family: Arima Madurai;
}

/* 4. Các nút mạng xã hội */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}
.social-icons a {
    font-size: 20px;
    color: #784212;
    background-color: #f9f6f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.social-icons a:active, .social-icons a:hover {
    background-color: #784212;
    color: #fff;
    transform: scale(0.95);
}

/* --- ĐƯỜNG GẠCH --- */
hr.divider {
    border: none;
    height: 1.5px;
    background-color: #ffffff;
    width: 65%;
    margin: 10px auto 15px auto; /* Sửa lại dòng này: 10px ở phía trên, 15px ở phía dưới */
    opacity: 0.6;
}

/* 5. Ô tìm kiếm */
.search-section {
    text-align: center;
    padding: 0 20px;
}
.search-label {
    font-size: 18px;
    font-weight: 600;
    color: #ffff;
    margin-bottom: 10px;
    font-family: Arima Madurai;
}
#searchCodeInput {
    width: 100%;
    max-width: 300px;
    padding: 6px 10px;
    border: 2px solid #784212;
    border-radius: 25px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #fff;
    font-family: Arima Madurai;
    font-size: 16px;
    transform: none !important;
}
#searchCodeInput:focus {
    box-shadow: 0 0 8px rgba(120, 66, 18, 0.4);
    transform: none !important;
}

/* 6. Khu vực danh sách sản phẩm */
.product-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Khung sản phẩm chuẩn: Mở hoàn toàn tính năng chạm giữ xem trước link (Preview) */

.product-card, 
a.product-card {
    width: 100%;
    max-width: 410px;
    height: 180px;
    border: 2px solid #784212;
    border-radius: 16px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    background-color: #fff !important;
    display: flex;
    text-decoration: none;
    
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.45s ease, opacity 0.4s ease, filter 0.4s ease !important;
    opacity: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    
    /* CHÚ Ý: Đã gỡ bỏ touch-callout và user-select chặn trên thẻ a để cho phép hiện preview */
    -webkit-user-select: none !important;
    user-select: none !important;
}

.product-card.reverse {
    flex-direction: row-reverse;
}

.product-card .card-image {
    width: 50%;
    height: 100%;
    flex-shrink: 0;
    background: #eee;
    /* Gỡ bỏ mọi lệnh chặn touch-callout ở vùng ảnh */
}

.product-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    
    /* QUAN TRỌNG: Gỡ bỏ pointer-events: none để khi người dùng nhấn giữ vào ảnh, 
       trình duyệt nhận diện đúng là đang bấm vào link nằm trong thẻ a và bật Preview */
    -webkit-user-drag: none;
}

.product-card .card-content {
    width: 50%;
    height: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    background-color: #fff !important;
}

/* Hiệu ứng co giãn mềm mại khi HOVER hoặc ACTIVE */
.product-card:hover, 
a.product-card:hover,
.product-card:active,
a.product-card:active {
    transform: scale(1.02);
    box-shadow: 0 10px 24px rgba(120, 66, 18, 0.15);
}

/* --- HIỆU ỨNG TÌM KIẾM MÃ SẢN PHẨM --- */
.product-card.product-highlight {
    transform: scale(1.04) !important;
    box-shadow: 0 16px 32px rgba(120, 66, 18, 0.3) !important;
    border-color: #d97706 !important;
    z-index: 10;
}

.product-card.product-dimmed {
    opacity: 0.35 !important;
    filter: grayscale(30%);
}
/* --- NÚT QUAY LẠI CHỈ CÓ ICON MŨI TÊN --- */
#backToTopBtn {
    position: sticky;
    float: right;
    bottom: 20px;
    margin-right: 0px;
    margin-top: -50px; /* Điều chỉnh lại khoảng cách cho cân đối khi không có chữ */
    z-index: 99;
    width: 38px;   /* Thu nhỏ kích thước lại chút cho gọn gàng */
    height: 38px;
    background-color: #784212; /* Tông màu chủ đạo */
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

/* Định dạng icon mũi tên nằm chính giữa nút */
#backToTopBtn i {
    font-size: 14px;
}

/* Khi cuộn trang xuống đủ điều kiện thì nút sẽ hiện lên */
#backToTopBtn.show {
    opacity: 1;
    visibility: visible;
}

/* Hiệu ứng khi rê chuột hoặc chạm vào nút */
#backToTopBtn:hover {
    transform: scale(1.08);
    background-color: #5E524D;
}

#backToTopBtn:active {
    transform: scale(0.95);
}

/* 7. Responsive */
@media (min-width: 768px) {
    body {
        padding: 0 !important;
    }
    .bio-container {
        border-radius: 0 !important;
        min-height: 100vh;
    }
}
/* 7. Responsive */
@media (min-width: 768px) {
    body {
        padding: 0 !important;
    }
    .bio-container {
        border-radius: 0 !important;
        min-height: 100vh;
    }
}