/* MarketConnect home redesign — scoped under .mc-home.
   Brand green comes from the DB-driven --web-primary (fallback: Lagos green). */
.mc-home {
    --mc-green: var(--web-primary, #1a7a43);
    --mc-green-rgb: var(--web-primary-rgb, 26, 122, 67);
    --mc-ink: #1f2b3a;
    --mc-muted: #64748b;
    --mc-line: rgba(var(--mc-green-rgb), .18);
    --mc-tint: rgba(var(--mc-green-rgb), .06);
    --mc-tint-2: rgba(var(--mc-green-rgb), .12);
    color: var(--mc-ink);
}

.mc-home .mc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Hero ---------- */
.mc-hero {
    background: linear-gradient(180deg, #e9f6ee 0%, #eef8f1 55%, #ffffff 100%);
    padding: 72px 16px 84px;
    text-align: center;
}
.mc-hero__title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--mc-ink);
    margin: 0 auto 20px;
    max-width: 16ch;
}
.mc-hero__lead {
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    color: #475569;
    max-width: 60ch;
    margin: 0 auto 32px;
    line-height: 1.5;
}
.mc-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-bottom: 34px;
}
.mc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 14px 26px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    text-decoration: none;
    line-height: 1;
}
.mc-btn:hover { transform: translateY(-1px); text-decoration: none; }
.mc-btn--primary {
    background: var(--mc-green);
    color: #fff;
    box-shadow: 0 6px 18px rgba(var(--mc-green-rgb), .28);
}
.mc-btn--primary:hover { color: #fff; box-shadow: 0 10px 24px rgba(var(--mc-green-rgb), .34); }
.mc-btn--ghost {
    background: #fff;
    color: var(--mc-ink);
    border-color: #d7e3da;
}
.mc-btn--ghost:hover { color: var(--mc-ink); border-color: var(--mc-green); }
.mc-hero__trust {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 34px;
    justify-content: center;
    color: #334155;
    font-weight: 500;
}
.mc-hero__trust span { display: inline-flex; align-items: center; gap: 9px; }
.mc-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.mc-dot--a { background: var(--mc-green); }
.mc-dot--b { background: #8bc34a; }
.mc-dot--c { background: #2e7d32; }

/* ---------- Section shells ---------- */
.mc-section { padding: 46px 0; }
.mc-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.mc-section__title {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 800;
    color: var(--mc-ink);
    margin: 0;
    letter-spacing: -.01em;
}
.mc-section--center { text-align: center; }
.mc-section--center .mc-section__head { justify-content: center; flex-direction: column; align-items: center; }
.mc-section__sub { color: var(--mc-muted); margin: 10px 0 0; font-size: 1.05rem; max-width: 62ch; }
.mc-viewall {
    color: var(--mc-green);
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--mc-line);
    border-radius: 10px;
    padding: 8px 16px;
    white-space: nowrap;
    transition: background .12s ease;
}
.mc-viewall:hover { background: var(--mc-tint); color: var(--mc-green); text-decoration: none; }

/* ---------- Category grid ---------- */
.mc-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.mc-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 34px 18px;
    background: #fff;
    border: 1.5px solid var(--mc-line);
    border-radius: 18px;
    text-decoration: none;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.mc-cat:hover {
    transform: translateY(-3px);
    border-color: var(--mc-green);
    box-shadow: 0 12px 28px rgba(var(--mc-green-rgb), .12);
    text-decoration: none;
}
.mc-cat__icon {
    width: 68px; height: 68px;
    border-radius: 16px;
    background: var(--mc-tint);
    display: grid;
    place-items: center;
}
.mc-cat__icon img { width: 34px; height: 34px; object-fit: contain; }
.mc-cat__name { font-weight: 700; font-size: 1.15rem; color: var(--mc-ink); }
.mc-cat__count { color: var(--mc-muted); font-size: .95rem; }

/* ---------- Product cards ---------- */
.mc-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.mc-pcard {
    background: #fff;
    border: 1.5px solid var(--mc-line);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .14s ease, transform .14s ease;
}
.mc-pcard:hover { box-shadow: 0 14px 32px rgba(15, 23, 42, .08); transform: translateY(-2px); }
.mc-pcard__media { position: relative; aspect-ratio: 4 / 3; background: #f1f5f4; }
.mc-pcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-pcard__save {
    position: absolute; top: 12px; right: 12px;
    background: #f97316; color: #fff;
    font-weight: 700; font-size: .82rem;
    padding: 6px 11px; border-radius: 8px;
}
.mc-pcard__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mc-pcard__name {
    font-weight: 700; font-size: 1.12rem; color: var(--mc-ink);
    text-decoration: none; line-height: 1.3;
}
.mc-pcard__name:hover { color: var(--mc-green); text-decoration: none; }
.mc-pcard__seller { color: var(--mc-muted); font-size: .92rem; }
.mc-pcard__rating { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--mc-ink); font-size: .92rem; }
.mc-pcard__rating .tio-star, .mc-pcard__rating .fa-star { color: #f5b301; }
.mc-star { color: #f5b301; }
.mc-pcard__rating small { color: var(--mc-muted); font-weight: 500; }
.mc-pcard__price { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.mc-pcard__price ins { color: var(--mc-green); font-weight: 800; font-size: 1.25rem; text-decoration: none; }
.mc-pcard__price del { color: #94a3b8; font-size: .95rem; }
.mc-pcard__actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 14px; }
.mc-pcard__actions .mc-btn { width: 100%; justify-content: center; font-size: .98rem; padding: 12px 14px; border-radius: 10px; white-space: nowrap; }
.mc-btn--chat { background: var(--mc-green); color: #fff; }
.mc-btn--chat:hover { color: #fff; }
.mc-btn--cart { background: #fff; color: var(--mc-green); border-color: var(--mc-line); }
.mc-btn--cart:hover { color: var(--mc-green); border-color: var(--mc-green); background: var(--mc-tint); }

/* ---------- Seller cards ---------- */
.mc-scard {
    background: #fff;
    border: 1.5px solid var(--mc-line);
    border-radius: 18px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.mc-scard__top { display: flex; align-items: center; gap: 14px; }
.mc-scard__avatar {
    width: 58px; height: 58px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--mc-tint-2);
}
.mc-scard__name { font-weight: 800; font-size: 1.18rem; color: var(--mc-ink); margin: 0; }
.mc-scard__cat { color: var(--mc-muted); font-size: .92rem; }
.mc-scard__rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .95rem; }
.mc-scard__verify { color: var(--mc-green); }
.mc-scard__meta { display: flex; flex-direction: column; gap: 8px; color: #475569; font-size: .95rem; }
.mc-scard__meta i { color: var(--mc-green); margin-right: 6px; }
.mc-scard__meta b { color: var(--mc-green); font-weight: 700; }
.mc-scard__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-chip {
    background: var(--mc-tint-2);
    color: #2e7d32;
    font-weight: 600;
    font-size: .82rem;
    padding: 5px 12px;
    border-radius: 999px;
}
.mc-scard .mc-btn { justify-content: center; margin-top: 4px; }

/* ---------- Markets directory ---------- */
.mc-pagehead {
    background: linear-gradient(180deg, #e9f6ee 0%, #eef8f1 60%, #ffffff 100%);
    padding: 48px 16px 40px;
    text-align: center;
}
.mc-pagehead__title { font-size: clamp(1.9rem, 3.4vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; color: var(--mc-ink); margin: 0 0 10px; }
.mc-pagehead__lead { color: #475569; font-size: 1.08rem; max-width: 60ch; margin: 0 auto 22px; }
.mc-search { display: flex; max-width: 460px; margin: 0 auto; gap: 8px; }
.mc-search input { flex: 1; border: 1.5px solid var(--mc-line); border-radius: 12px; padding: 12px 16px; font-size: 1rem; background: #fff; }
.mc-search input:focus { outline: none; border-color: var(--mc-green); }
.mc-search button { border: none; background: var(--mc-green); color: #fff; border-radius: 12px; padding: 0 20px; font-weight: 600; cursor: pointer; }

.mc-market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.mc-market-card {
    background: #fff;
    border: 1.5px solid var(--mc-line);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .14s ease, box-shadow .14s ease;
    text-decoration: none;
}
.mc-market-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15,23,42,.10); text-decoration: none; }
.mc-market-card__media {
    aspect-ratio: 16 / 10;
    background: var(--mc-tint);
    overflow: hidden;
}
.mc-market-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-market-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.mc-market-card__name { font-weight: 800; font-size: 1.25rem; color: var(--mc-ink); margin: 0; }
.mc-market-card__stats { display: flex; gap: 22px; color: #475569; font-size: .95rem; }
.mc-market-card__stats b { display: block; color: var(--mc-green); font-size: 1.25rem; font-weight: 800; line-height: 1.1; }
.mc-market-card__cta { margin-top: auto; }

/* ---------- App-style bottom nav (mobile) ---------- */
.mc-bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid #e6ece8;
    display: flex;
    justify-content: space-around;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, .06);
}
.mc-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--mc-muted, #64748b);
    font-size: .74rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding: 4px 0;
}
.mc-bottom-nav a.active, .mc-bottom-nav a:hover { color: var(--web-primary, #1a7a43); }
.mc-bottom-nav a i { font-size: 1.25rem; line-height: 1; }
.mc-bottom-nav__badge {
    position: absolute;
    top: 0; left: 58%;
    background: #f97316; color: #fff;
    font-size: .62rem; font-weight: 700;
    min-width: 17px; height: 17px;
    border-radius: 999px;
    display: grid; place-items: center;
    padding: 0 4px;
}
@media (min-width: 992px) { .mc-bottom-nav { display: none; } }
@media (max-width: 991px) { body.mc-has-bottom-nav { padding-bottom: 68px; } }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .mc-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .mc-grid-3, .mc-market-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .mc-hero { padding: 52px 16px 60px; }
    .mc-grid-3, .mc-market-grid { grid-template-columns: 1fr; }
    .mc-cat-grid { gap: 12px; }
    .mc-cat { padding: 22px 12px; }
    .mc-section { padding: 34px 0; }
}
