/* TrustBhai — Mobile home page */

body:has(.home-page) {
    background: #f0f2f5 !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

@media (max-width: 767.98px) {
    body:has(.home-page).has-facebook-topbar:not(.auth-page) {
        padding-top: calc(var(--fb-topbar-height, 56px) + 5px) !important;
    }
}

[data-theme="dark"] body:has(.home-page),
.dark-mode body:has(.home-page) {
    background: #18191a !important;
}

:root {
    --home-bg: #f0f2f5;
    --home-card: #ffffff;
    --home-text: #1c1e21;
    --home-muted: #65676b;
    --home-primary: #1877f2;
    --home-accent: #7c3aed;
    --home-radius: 16px;
    --home-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
}
[data-theme="dark"] {
    --home-bg: #18191a;
    --home-card: #242526;
    --home-text: #e4e6eb;
    --home-muted: #b0b3b8;
    --home-shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2);
}

.home-page {
    font-family: 'Inter', system-ui, sans-serif;
    padding: 0 12px 24px;
    max-width: 680px;
    margin: 0 auto;
}

/* Hero */
.home-hero {
    background: linear-gradient(135deg, #1877f2 0%, #7c3aed 55%, #db2777 100%);
    border-radius: 20px;
    padding: 28px 22px 24px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--home-shadow);
    margin-bottom: 16px;
}
.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,.1) 0%, transparent 40%);
    pointer-events: none;
}
.home-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 14px;
    position: relative;
    color: #fff;
}
.home-hero__title {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px;
    position: relative;
    color: #fff !important;
}
.home-hero__title span {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .95) !important;
    opacity: 1;
    margin-top: 4px;
}
.home-hero__subtitle {
    font-size: .88rem;
    color: rgba(255, 255, 255, .92) !important;
    opacity: 1;
    line-height: 1.55;
    margin: 0 0 20px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}
.home-hero__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}
.home-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.home-hero__btn--primary {
    background: #fff;
    color: #1877f2;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.home-hero__btn--ghost {
    background: rgba(255,255,255,.15);
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,.45);
}
.home-hero__btn--ghost:hover {
    color: #fff !important;
}
.home-hero__btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.home-hero__btn--primary:hover { color: #1877f2; }

/* Search */
.home-search {
    margin-bottom: 16px;
}
.home-search__form {
    position: relative;
}
.home-search__input {
    width: 100%;
    padding: 14px 48px 14px 46px;
    border: none;
    border-radius: 999px;
    background: var(--home-card);
    color: var(--home-text);
    font-size: .95rem;
    box-shadow: var(--home-shadow);
    outline: none;
    transition: box-shadow .2s;
}
.home-search__input:focus {
    box-shadow: 0 0 0 3px rgba(24,119,242,.25), var(--home-shadow);
}
.home-search__input::placeholder { color: var(--home-muted); }
.home-search__icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--home-muted);
    pointer-events: none;
}
.home-search__submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--home-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Stats strip */
.home-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.home-stat {
    background: var(--home-card);
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--home-shadow);
    transition: transform .2s;
}
.home-stat:hover { transform: translateY(-3px); }
.home-stat__num {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--home-primary);
    line-height: 1.2;
}
.home-stat__label {
    font-size: .72rem;
    color: var(--home-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* Section */
.home-section {
    background: var(--home-card);
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    margin-bottom: 16px;
    overflow: hidden;
}
.home-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
[data-theme="dark"] .home-section__head {
    border-bottom-color: rgba(255,255,255,.08);
}
.home-section__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--home-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.home-section__title i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1877f2, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}
.home-section__link {
    font-size: .82rem;
    color: var(--home-primary);
    text-decoration: none;
    font-weight: 600;
}
.home-section__body { padding: 12px 14px 16px; }

/* Nav grid */
.home-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.home-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 6px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--home-text);
    background: var(--home-bg);
    transition: transform .2s, box-shadow .2s;
}
.home-nav-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--home-shadow);
    text-decoration: none;
    color: var(--home-text);
}
.home-nav-item__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}
.home-nav-item__label {
    font-size: .72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
}
.home-nav-item__icon--shop    { background: linear-gradient(135deg, #1877f2, #0ea5e9); }
.home-nav-item__icon--service { background: linear-gradient(135deg, #10b981, #059669); }
.home-nav-item__icon--cat     { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.home-nav-item__icon--offer   { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.home-nav-item__icon--discount{ background: linear-gradient(135deg, #ec4899, #db2777); }
.home-nav-item__icon--product { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.home-nav-item__icon--web     { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.home-nav-item__icon--blog    { background: linear-gradient(135deg, #f97316, #ea580c); }

/* Horizontal scroll cards */
.home-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.home-scroll::-webkit-scrollbar { display: none; }
.home-scroll-card {
    flex: 0 0 100px;
    scroll-snap-align: start;
    text-decoration: none;
    color: var(--home-text);
}
.home-scroll-card:hover { text-decoration: none; color: var(--home-text); }
.home-scroll-card__img {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    box-shadow: var(--home-shadow);
    background: var(--home-bg);
}
.home-scroll-card__icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1877f2, #7c3aed);
    color: #fff;
    font-size: 1.4rem;
}
.home-scroll-card__label {
    font-size: .72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* News cards */
.home-news-list { display: flex; flex-direction: column; gap: 10px; }
.home-news-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--home-bg);
    text-decoration: none;
    color: var(--home-text);
    transition: transform .15s;
}
.home-news-item:hover {
    transform: translateX(4px);
    text-decoration: none;
    color: var(--home-text);
}
.home-news-item__title {
    font-size: .88rem;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.35;
}
.home-news-item__excerpt {
    font-size: .78rem;
    color: var(--home-muted);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.home-news-item__arrow {
    margin-left: auto;
    align-self: center;
    color: var(--home-primary);
    flex-shrink: 0;
}

/* Offer badge */
.home-offer-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    border-radius: 14px;
    overflow: hidden;
    background: var(--home-bg);
    text-decoration: none;
    color: var(--home-text);
    box-shadow: var(--home-shadow);
}
.home-offer-card:hover { text-decoration: none; color: var(--home-text); }
.home-offer-card__banner {
    width: 100%;
    height: 80px;
    object-fit: cover;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.home-offer-card__body { padding: 8px 10px; }
.home-offer-card__title {
    font-size: .75rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 480px) {
    .home-nav-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .home-nav-item { padding: 10px 4px; }
    .home-nav-item__icon { width: 40px; height: 40px; font-size: 1rem; }
    .home-nav-item__label { font-size: .68rem; }
    .home-hero__title { font-size: 1.4rem; }
    .home-stat__num { font-size: 1rem; }
    .home-stat__label { font-size: .65rem; }
}

@media (min-width: 768px) {
    .home-page { padding: 0 0 32px; }
    .home-hero { padding: 36px 32px 28px; }
    .home-hero__title { font-size: 2rem; }
    .home-nav-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

@media (max-width: 767.98px) {
    .home-page {
        padding: 12px 12px 24px;
    }

    .home-top-stack {
        margin-bottom: 4px;
        padding-top: 4px;
    }

    .home-hero {
        margin-bottom: 0;
        padding: 26px 18px 22px;
        border-radius: 20px;
    }

    .home-hero__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .home-hero__btn {
        justify-content: center;
        padding: 12px 10px;
        font-size: .78rem;
        min-height: 44px;
    }

    .home-hero__btn i {
        font-size: .85rem;
    }

    /* My Card / Video — full bleed purple bar */
    .home-page .tb-mobile-quicklinks-bar {
        margin: 0 -12px;
        padding: 10px 12px;
        width: auto;
        border-radius: 0;
        background: linear-gradient(135deg, #5b6ee8 0%, #7c4fbd 100%);
    }

    .home-page .tb-mobile-quicklinks-bar .tb-mobile-quicklink {
        min-height: 44px;
        border-radius: 14px;
    }

    /* Dark search pill */
    .home-search {
        margin: 14px 0 16px;
    }

    .home-search__input {
        background: #242526;
        color: #f0f2f5;
        font-size: 16px;
        padding: 14px 50px 14px 44px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
        border: 1px solid rgba(255, 255, 255, .06);
    }

    .home-search__input:focus {
        box-shadow: 0 0 0 3px rgba(24, 119, 242, .35), 0 2px 12px rgba(0, 0, 0, .18);
    }

    .home-search__input::placeholder {
        color: #9ca3af;
    }

    .home-search__icon {
        color: #9ca3af;
        left: 16px;
    }

    .home-search__submit {
        background: linear-gradient(135deg, #1877f2 0%, #5b6ee8 100%);
        width: 38px;
        height: 38px;
        right: 5px;
    }
}
