/* Trang giới thiệu công khai – ưu tiên điện thoại */
:root {
    --mau: #6d28d9; --mau-dam: #2d1b69; --vang: #f59e0b; --nen: #faf7ff; --chu: #1f1630; --mo: #6b6480;
    --bo: 14px;
    --nhat: color-mix(in srgb, var(--mau) 10%, #ffffff); --vien: color-mix(in srgb, var(--mau) 18%, #ffffff);
    --mo-mau: color-mix(in srgb, var(--mau) 35%, #ffffff); --bong: 0 2px 10px color-mix(in srgb, var(--mau-dam) 10%, transparent);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nen); color: var(--chu); font-family: var(--font, -apple-system, "Segoe UI", Roboto, Arial, sans-serif); font-size: 15px; line-height: 1.5; }
a { color: var(--mau); text-decoration: none; }
img { max-width: 100%; display: block; }
.khung { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Thanh trên */
.dau { background: #fff; box-shadow: var(--bong); position: sticky; top: 0; z-index: 50; }
.dau .khung { display: flex; align-items: center; gap: 14px; height: 58px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--mau-dam); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo img { width: 34px; height: 34px; border-radius: 9px; }
.dieu-huong { margin-left: auto; display: flex; gap: 4px; }
.dieu-huong a { padding: 8px 12px; border-radius: 10px; color: var(--chu); font-weight: 600; white-space: nowrap; }
.dieu-huong a.hien, .dieu-huong a:hover { background: var(--nhat); color: var(--mau); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--mau-dam), var(--mau) 60%, color-mix(in srgb, var(--mau) 70%, #ffffff)); color: #fff; padding: 34px 0 40px; }
.hero h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.25; }
.hero p { margin: 0 0 14px; opacity: .92; max-width: 720px; }
.hero .nut-hang { display: flex; gap: 8px; flex-wrap: wrap; }
.nut { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; font-weight: 700; border: 0; cursor: pointer; font-size: 15px; }
.nut-trang { background: #fff; color: var(--mau-dam); }
.nut-vien { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.nut-chinh { background: var(--mau); color: #fff; }
.nut-chinh:hover { background: var(--mau-dam); }
.nut-mo { background: var(--nhat); color: var(--mau); }
.nut[disabled] { opacity: .6; cursor: default; }

/* Khối nội dung */
.muc { margin: 26px 0; }
.muc h2 { font-size: 20px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.muc h2 small { font-size: 13px; color: var(--mo); font-weight: 500; }
.the-trang { background: #fff; border-radius: var(--bo); box-shadow: var(--bong); padding: 16px; }

/* Chip lọc */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--vien); color: var(--chu); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip.hien { background: var(--mau); border-color: var(--mau); color: #fff; }
.nhan-nhom { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--mo); margin: 10px 0 6px; font-weight: 700; }

/* Lưới sản phẩm */
.luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.sp { background: #fff; border-radius: var(--bo); box-shadow: var(--bong); overflow: hidden; display: flex; flex-direction: column; color: var(--chu); transition: transform .12s, box-shadow .12s; }
.sp:hover { transform: translateY(-3px); box-shadow: 0 8px 22px color-mix(in srgb, var(--mau-dam) 18%, transparent); }
.sp .anh { aspect-ratio: 3 / 4; background: linear-gradient(160deg, var(--nhat), var(--nen)); position: relative; overflow: hidden; }
.sp .anh img { width: 100%; height: 100%; object-fit: cover; }
.sp .anh .trong { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--mo-mau); font-size: 54px; }
.sp .dau-nhan { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.nhan { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #fff; color: var(--mau-dam); }
.nhan.vang { background: var(--vang); color: #fff; }
.nhan.het { background: #6b7280; color: #fff; }
.sp .noi-dung { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sp .ten { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.sp .phu { color: var(--mo); font-size: 13px; }
.sp .gia { margin-top: auto; padding-top: 6px; font-weight: 800; color: var(--mau); font-size: 17px; }
.sp .gia small { font-weight: 500; color: var(--mo); font-size: 12.5px; }

/* Chi tiết */
.chi-tiet { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; margin-top: 20px; }
.album .lon { border-radius: var(--bo); overflow: hidden; background: linear-gradient(160deg, var(--nhat), var(--nen)); aspect-ratio: 3 / 4; }
.album .lon img { width: 100%; height: 100%; object-fit: cover; }
.album .nho { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.album .nho img { width: 70px; height: 92px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.album .nho img.hien { border-color: var(--mau); }
.thong-so { width: 100%; border-collapse: collapse; margin: 10px 0; }
.thong-so td { padding: 8px 4px; border-bottom: 1px solid var(--vien); vertical-align: top; }
.thong-so td:first-child { color: var(--mo); width: 40%; }
.gia-lon { font-size: 26px; font-weight: 800; color: var(--mau); }
.mo-ta { white-space: pre-line; color: color-mix(in srgb, var(--chu) 85%, var(--mau)); }

/* Ai thuê / đánh giá */
.dong-tin { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--vien); }
.dong-tin:last-child { border-bottom: 0; }
.cham { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex-shrink: 0; box-shadow: 0 0 0 4px #dcfce7; }
.sao { color: var(--vang); letter-spacing: 1px; white-space: nowrap; }
.y-kien { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.y-kien .tl { margin-top: 8px; padding: 8px 10px; background: var(--nhat); border-radius: 10px; font-size: 13.5px; }

/* Bảng size */
.bang { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--bo); overflow: hidden; }
.bang th, .bang td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--vien); }
.bang th { background: var(--nhat); color: var(--mau-dam); font-size: 13.5px; }
.bang td:first-child { font-weight: 800; color: var(--mau); }
.bang tr.goi-y td { background: #fef3c7; }
.cuon-ngang { overflow-x: auto; border-radius: var(--bo); box-shadow: var(--bong); }

/* Form */
.o-nhap { width: 100%; padding: 11px 13px; border: 1px solid var(--vien); border-radius: 11px; font-size: 15px; font-family: inherit; background: #fff; }
.o-nhap:focus { outline: 2px solid var(--mo-mau); border-color: var(--mau); }
.nhom-o { margin-bottom: 12px; }
.nhom-o label { display: block; font-weight: 600; margin-bottom: 5px; }
.chon-sao { display: flex; gap: 6px; font-size: 40px; cursor: pointer; user-select: none; }
.chon-sao span { color: var(--vien); transition: transform .1s; }
.chon-sao span.bat { color: var(--vang); }
.chon-sao span:active { transform: scale(1.2); }
.bao { padding: 12px 14px; border-radius: 12px; margin: 10px 0; }
.bao.ok { background: #dcfce7; color: #14532d; }
.bao.loi { background: #fee2e2; color: #7f1d1d; }
.an { position: absolute; left: -9999px; }

/* Chân trang + thanh liên hệ nổi trên điện thoại */
.chan { background: var(--mau-dam); color: #e9e2ff; padding: 26px 0 90px; margin-top: 40px; font-size: 14px; }
.chan a { color: #fff; }
.chan .cot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.lien-he-noi { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.1); display: none; z-index: 60; }
.lien-he-noi a { flex: 1; text-align: center; padding: 10px 4px; font-weight: 700; font-size: 13px; color: var(--mau-dam); }
.lien-he-noi a i.icon { display: block; margin: 0 auto 2px; font-size: 20px; color: var(--mau); }

@media (max-width: 760px) {
    .dieu-huong a span { display: none; }
    .dieu-huong a { padding: 8px; }
    .hero { padding: 24px 0 28px; }
    .hero h1 { font-size: 22px; }
    .luoi { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sp .noi-dung { padding: 9px 10px 11px; }
    .sp .ten { font-size: 14px; }
    .sp .gia { font-size: 15px; }
    .chi-tiet { grid-template-columns: 1fr; gap: 14px; }
    .lien-he-noi { display: flex; }
}
[x-cloak] { display: none !important; }

/* Hiệu ứng trang trí theo giao diện (hoa đào, tuyết, lá thu…) */
#hieu-ung { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
#hieu-ung span { position: absolute; top: -40px; animation-name: roi; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes roi { 0% { transform: translate(0, -5vh) rotate(0deg); } 50% { transform: translate(30px, 50vh) rotate(180deg); } 100% { transform: translate(-20px, 105vh) rotate(360deg); } }
.thanh-xem-thu { position: sticky; top: 58px; z-index: 45; background: var(--vang); color: #111; text-align: center; padding: 6px; font-weight: 700; font-size: 14px; }

/* Khuyến mãi */
.uu-dai { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.the-km { border-left: 5px solid var(--vang); }
.the-km .km-gia { font-size: 20px; font-weight: 800; color: var(--mau); margin-bottom: 2px; }
.the-km .phu { color: var(--mo); font-size: 13.5px; margin-top: 3px; }
.nhan.km { background: #dc2626; color: #fff; }

/* ===== Tuỳ biến giao diện ===== */
.logo.co-logo img { width: auto; height: 40px; max-width: 160px; border-radius: 0; object-fit: contain; }
.truot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.truot > * { scroll-snap-align: start; }
.khoi-tu-do .the-trang { display: flex; gap: 18px; align-items: center; }
.khoi-tu-do img { max-width: 100%; border-radius: var(--bo); }
.khoi-tu-do.kieu-the .the-trang { flex-direction: column; align-items: stretch; }
.khoi-tu-do.kieu-anh_trai img, .khoi-tu-do.kieu-anh_phai img { width: 42%; object-fit: cover; }
.khoi-tu-do.kieu-anh_phai .the-trang { flex-direction: row-reverse; }
.khoi-tu-do.kieu-bang_noi .the-trang { background: linear-gradient(135deg, var(--mau-dam), var(--mau)); color: #fff; text-align: center; justify-content: center; }
.khoi-tu-do h2 { margin-top: 0; }
@media (max-width: 700px) { .khoi-tu-do .the-trang { flex-direction: column !important; } .khoi-tu-do img { width: 100% !important; } }
.menu-them span { display: inline !important; }
/* Trợ lý tư vấn */
.tl-nut { position: fixed; right: 16px; bottom: 76px; z-index: 60; background: var(--mau); color: #fff; border: 0; border-radius: 999px; padding: 12px 16px; font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; font-size: 15px; }
.tl-khung { position: fixed; right: 16px; bottom: 76px; z-index: 61; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); background: #fff;
    border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.tl-dau { background: var(--mau-dam); color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 8px; }
.tl-dau button { margin-left: auto; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }
.tl-than { flex: 1; overflow-y: auto; padding: 12px; background: var(--nen); display: flex; flex-direction: column; gap: 8px; }
.tl-tin { max-width: 85%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.45; }
.tl-tin.khach { align-self: flex-end; background: var(--mau); color: #fff; border-bottom-right-radius: 4px; }
.tl-tin.shop { align-self: flex-start; background: #fff; border: 1px solid var(--vien); border-bottom-left-radius: 4px; }
.tl-tin a { color: inherit; text-decoration: underline; }
.tl-nhap { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--vien); }
.tl-nhap input { flex: 1; padding: 10px 12px; border: 1px solid var(--vien); border-radius: 999px; font-size: 15px; }
.tl-nhap button { border: 0; background: var(--mau); color: #fff; border-radius: 999px; padding: 0 16px; font-weight: 700; cursor: pointer; }
.tl-goi-y { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-goi-y button { border: 1px solid var(--vien); background: #fff; border-radius: 999px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
@media (min-width: 901px) { .tl-nut, .tl-khung { bottom: 20px; } }
/* Đặt giữ trên trang sản phẩm */
.dat-giu { margin-top: 14px; }
.dat-giu .hang { display: flex; gap: 8px; flex-wrap: wrap; }
.dat-giu .hang > * { flex: 1 1 140px; }
.dat-giu label { font-size: 13px; color: var(--mo); display: block; margin-bottom: 2px; }

/* Khối "Tiện ích cho bạn" trên trang chủ */
.tien-ich { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ti-the { display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: var(--bo); box-shadow: var(--bong); padding: 16px; color: inherit; text-decoration: none;
    border: 1px solid transparent; transition: transform .15s, border-color .15s; }
.ti-the:hover { transform: translateY(-2px); border-color: var(--mau); }
.ti-the > .icon { font-size: 26px; color: var(--mau); margin: 0 0 4px; height: auto; }
.ti-the b { font-size: 16px; }
.ti-the span { font-size: 13.5px; color: var(--mo); line-height: 1.4; }
@media (max-width: 520px) { .tien-ich { grid-template-columns: 1fr 1fr; gap: 8px; } .ti-the { padding: 12px; } .ti-the span { font-size: 12.5px; } }
