/* =========================================================
   Trang danh mục tiện ích (/tien-ich)
   Toàn bộ style scope dưới .ti-home; cùng hệ màu với tienich-detail.css
   ========================================================= */
.ti-home { --ti-navy: #0c4a6e; --ti-blue: #0ea5e9; --ti-blue-soft: #f0f9ff; --ti-blue-line: #bae6fd; --ti-accent: #f07620; --ti-text: #0f172a; --ti-muted: #64748b; --ti-line: #e2e8f0; --ti-radius: 16px; --ti-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(12, 74, 110, .08); color: var(--ti-text); padding-bottom: 56px; }

    .ti-home [hidden] { display: none !important; }

    /* ---------- Tiêu đề + tìm kiếm ---------- */
    .ti-home .ti-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 8px 0 24px; }
    .ti-home .ti-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--ti-blue); }
    .ti-home .ti-title { margin: 0 0 6px; font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--ti-navy); }
    .ti-home .ti-sub { margin: 0; font-size: 15px; color: var(--ti-muted); }

    .ti-home .ti-search { position: relative; width: 340px; flex-shrink: 0; }
        .ti-home .ti-search > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ti-muted); pointer-events: none; }
        .ti-home .ti-search input { width: 100%; height: 48px; padding: 0 44px; border: 1px solid var(--ti-line); border-radius: 999px; background: #fff; font-size: 15px; box-shadow: var(--ti-shadow); transition: border-color .2s, box-shadow .2s; }
            .ti-home .ti-search input:focus { outline: none; border-color: var(--ti-blue); box-shadow: 0 0 0 4px rgba(14, 165, 233, .15); }
        .ti-home .ti-search .ti-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ti-muted); }
            .ti-home .ti-search .ti-search-clear:hover { background: var(--ti-line); color: var(--ti-text); }

    /* ---------- Bố cục ---------- */
    .ti-home .ti-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

    /* ---------- Lưới loại tiện ích ---------- */
    .ti-home .ti-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

    .ti-home .ti-cat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 16px 20px; border: 1px solid var(--ti-line); border-radius: var(--ti-radius); background: #fff; text-align: center; text-decoration: none; color: var(--ti-navy); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
        .ti-home .ti-cat:before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--ti-blue), var(--ti-navy)); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
        .ti-home .ti-cat:hover { transform: translateY(-4px); border-color: var(--ti-blue-line); box-shadow: 0 14px 30px rgba(12, 74, 110, .12); color: var(--ti-navy); }
            .ti-home .ti-cat:hover:before { transform: scaleX(1); }
        .ti-home .ti-cat:focus-visible { outline: 3px solid rgba(14, 165, 233, .45); outline-offset: 2px; }

    .ti-home .ti-cat-icon { display: flex; align-items: center; justify-content: center; width: 160px; height: 160px; border-radius: 50%; background: var(--ti-blue-soft); transition: background .2s, transform .2s; }
        .ti-home .ti-cat-icon img { width: 90px; height: 90px; object-fit: contain; }
    .ti-home .ti-cat:hover .ti-cat-icon { background: #e0f2fe; transform: scale(1.05); }

    .ti-home .ti-cat-name { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
    .ti-home .ti-cat-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ti-blue); }
        .ti-home .ti-cat-more i { transition: transform .2s; }
    .ti-home .ti-cat:hover .ti-cat-more i { transform: translateX(3px); }

    /* Trạng thái rỗng */
    .ti-home .ti-empty { padding: 56px 24px; border: 1px dashed var(--ti-line); border-radius: var(--ti-radius); background: #fff; text-align: center; color: var(--ti-muted); }
        .ti-home .ti-empty i { display: block; margin-bottom: 12px; font-size: 40px; color: var(--ti-blue-line); }
        .ti-home .ti-empty p { margin: 0; }

    /* ---------- Sidebar ---------- */
    .ti-home .ti-aside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 90px; }
    .ti-home .ti-box { border: 1px solid var(--ti-line); border-radius: var(--ti-radius); background: #fff; box-shadow: var(--ti-shadow); overflow: hidden; }
    .ti-home .ti-box-title { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--ti-line); font-size: 15px; font-weight: 700; color: var(--ti-navy); }
        .ti-home .ti-box-title i { color: var(--ti-blue); }
    .ti-home .ti-weather iframe { display: block; width: 100%; height: 380px; border: 0; }

    .ti-home .ti-explore { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
        .ti-home .ti-explore a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; background: var(--ti-tone-bg, #f8fafc); text-decoration: none; transition: transform .2s, box-shadow .2s; }
            .ti-home .ti-explore a:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 23, 42, .08); }
            .ti-home .ti-explore a img { width: 48px; height: 48px; object-fit: contain; }
            .ti-home .ti-explore a span { font-size: 15px; font-weight: 700; color: var(--ti-tone, var(--ti-navy)); }
        .ti-home .ti-explore .tone-place { --ti-tone: #32961a; --ti-tone-bg: #f0fdf4; }
        .ti-home .ti-explore .tone-stay { --ti-tone: #a33d8b; --ti-tone-bg: #fdf4fb; }
        .ti-home .ti-explore .tone-eat { --ti-tone: #0284c7; --ti-tone-bg: #f0f9ff; }
        .ti-home .ti-explore .tone-shop { --ti-tone: #dc2626; --ti-tone-bg: #fef2f2; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .ti-home .ti-layout { grid-template-columns: 1fr 280px; }
}

@media (max-width: 991.98px) {
    .ti-home .ti-head { flex-direction: column; align-items: stretch; }
    .ti-home .ti-search { width: 100%; }
    .ti-home .ti-layout { grid-template-columns: 1fr; }
    .ti-home .ti-aside { position: static; }
    .ti-home .ti-weather { display: none; }
    .ti-home .ti-explore { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 575.98px) {
    .ti-home .ti-title { font-size: 24px; }
    .ti-home .ti-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .ti-home .ti-cat { padding: 20px 10px 16px; gap: 10px; }
    .ti-home .ti-cat-icon { width: 68px; height: 68px; }
        .ti-home .ti-cat-icon img { width: 42px; height: 42px; }
    .ti-home .ti-cat-name { font-size: 14px; }
    .ti-home .ti-explore { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ti-home * { transition: none !important; }
}
