:root {
    --brand: #E00000;
    --brand-dark: #b50000;
    --brand-light: #ff5b5b;
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --border: #ececec;
    --radius: 14px;
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 78px; /* space for bottom nav */
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    max-width: 480px;
    margin: 0 auto;
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-size: 22px;
    font-weight: 800;
}
.brand span.hi { color: var(--brand); }
.brand-tagline {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -2px;
}
.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: none;
    border: none;
    padding: 4px;
}
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------- Location bar ---------- */
.location-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px 12px;
    max-width: 480px;
    margin: 0 auto;
    color: var(--brand);
    font-size: 14px;
}
.location-bar strong { color: var(--text); font-weight: 700; }
.location-bar .chev { color: var(--text-muted); margin-left: 2px; }

/* ---------- Search ---------- */
.search-wrap { padding: 0 16px 16px; max-width: 480px; margin: 0 auto; }
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 8px 10px 16px;
    box-shadow: var(--shadow);
}
.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: var(--text);
}
.search-box input::placeholder { color: #a7a7a7; }
.search-submit {
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    flex-shrink: 0;
}

/* ---------- Banner slider (images only, max 100px tall) ---------- */
.banner-slider { max-width: 448px; margin: 0 16px 20px; }
.banner-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    border-radius: 16px;
    height: 100px;
    scrollbar-width: none;
}
.banner-scroll::-webkit-scrollbar { display: none; }
.banner-scroll img {
    flex: 0 0 100%;
    width: 100%;
    height: 100px;
    object-fit: cover;
    scroll-snap-align: start;
}
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.banner-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: #e8c9c9;
    transition: all .2s;
}
.banner-dots span.active { background: var(--brand); width: 16px; border-radius: 4px; }

/* ---------- Category grid ---------- */
.section { max-width: 480px; margin: 0 auto; padding: 0 16px 24px; }
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.section-title h2 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.section-title .see-all { color: var(--brand); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 2px; }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 10px;
    box-shadow: var(--shadow);
}
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.cat-icon {
    width: 52px; height: 52px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand);
    background: #fdeaea;
}
.cat-item span { font-size: 11.5px; color: var(--text); font-weight: 500; }

/* ---------- Product cards ---------- */
.scroll-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.scroll-row::-webkit-scrollbar { display: none; }

.product-card {
    flex: 0 0 150px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    position: relative;
    box-shadow: var(--shadow);
}
.discount-tag {
    position: absolute;
    top: 8px; left: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 2;
}
.fav-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: #fff;
    border-radius: 50%;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    box-shadow: var(--shadow);
    z-index: 2;
}
.product-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    background: #f5f5f5;
    margin-bottom: 8px;
}
.product-name { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.price-row { display: flex; align-items: center; justify-content: space-between; }
.price-current { color: var(--brand); font-weight: 800; font-size: 13px; }
.price-old { color: #b3b3b3; font-size: 11px; text-decoration: line-through; margin-left: 4px; }
.cart-fab {
    background: var(--brand);
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: none;
}

/* ---------- Promo banners ---------- */
.promo-purple, .promo-green {
    max-width: 448px;
    margin: 0 16px 16px;
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.promo-purple { background: linear-gradient(135deg, #5b4fd6, #7c6ef2); color: #fff; }
.promo-green { background: #e6f8ee; color: #0f7a3d; }
.promo-purple h3, .promo-green h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.promo-purple p, .promo-green p { font-size: 12px; opacity: 0.9; }
.avatars { display: flex; align-items: center; flex-shrink: 0; }
.avatars img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; margin-left: -10px; object-fit: cover; }
.avatars img:first-child { margin-left: 0; }
.avatar-count {
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; color: #333; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-left: -10px; text-align: center; line-height: 1.1;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    max-width: 480px;
    margin: 0 auto;
    z-index: 50;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--text-muted);
    position: relative;
    padding: 2px 10px;
}
.nav-item.active { color: var(--brand); }
.nav-badge {
    position: absolute;
    top: -2px; right: 2px;
    background: var(--brand);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px; height: 14px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
}
