* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; background: #f8f8f8; min-height: 100vh; }
.hidden { display: none !important; }
.screen { min-height: 100vh; padding-bottom: 60px; position: relative; z-index: 1; }
.screen:not(.hidden) { display: block; z-index: 2; }

/* Splash */
#screen-splash { display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #1a1a2e 0%, #16213e 100%); color: #fff; }
.splash-content { text-align: center; }
.splash-content .logo { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.splash-content .tagline { opacity: 0.9; margin-bottom: 2rem; }
.splash-content .loading { font-size: 0.9rem; opacity: 0.7; }

/* Onboarding */
#screen-onboarding { padding: 2rem 1.5rem; text-align: center; background: #fff; }
.onboarding-slide .illus { font-size: 4rem; margin-bottom: 1rem; }
.onboarding-slide h2 { margin: 0 0 2rem; font-size: 1.25rem; }
.nav-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.primary { background: #1a1a2e; color: #fff; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-size: 1rem; cursor: pointer; }
.secondary { background: #eee; color: #333; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; cursor: pointer; }
.link { background: none; border: none; color: #666; cursor: pointer; text-decoration: underline; }

/* Login */
#screen-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1a1a2e; padding: 1rem; }
#screen-login:not(.hidden) { z-index: 10; }
.form-card { background: #fff; padding: 1.5rem; border-radius: 12px; width: 100%; max-width: 360px; position: relative; z-index: 1; }
.form-card button { cursor: pointer; position: relative; z-index: 2; }
.form-card h1 { margin: 0 0 1rem; }
.form-card input { width: 100%; padding: 0.75rem; margin-bottom: 1rem; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; }
.full { width: 100%; }
.form-card .error { color: #c00; font-size: 0.9rem; margin-top: 0.5rem; }
.form-card .login-divider { text-align: center; margin: 1rem 0 0.5rem; color: #888; font-size: 0.9rem; }
.form-card .demo-login { background: #28a745; margin-bottom: 0; }

/* Home */
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: #fff; border-bottom: 1px solid #eee; }
.top-bar h1 { margin: 0; font-size: 1.1rem; }
.top-bar .back { text-decoration: none; color: #333; font-size: 1.25rem; }
.profile-icon { cursor: pointer; font-size: 1.5rem; }
.search-bar { padding: 0.5rem 1rem; background: #fff; }
.search-bar input { width: 100%; padding: 0.6rem 1rem; border: 1px solid #eee; border-radius: 8px; }
.categories-scroll { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; overflow-x: auto; background: #fff; }
.cat-chip { white-space: nowrap; padding: 0.4rem 0.8rem; background: #eee; border-radius: 20px; text-decoration: none; color: #333; font-size: 0.9rem; }
.cat-chip:hover { background: #1a1a2e; color: #fff; }
.banner-carousel { padding: 0.5rem 1rem; background: #fff; }
.banner { height: 140px; background: #eee; border-radius: 8px; margin-bottom: 0.5rem; }
.banner img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.banner.placeholder { display: flex; align-items: center; justify-content: center; color: #999; }
#screen-home h3 { margin: 1rem 1rem 0.5rem; font-size: 1rem; }
.stores-scroll { display: flex; gap: 0.75rem; padding: 0 1rem 1rem; overflow-x: auto; }
.store-card { flex: 0 0 140px; padding: 1rem; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); text-decoration: none; color: #333; }
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; padding: 0 1rem 1rem; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); text-decoration: none; color: #333; }
.product-card .img-wrap { aspect-ratio: 1; background: #f0f0f0; }
.product-card img { width: 100%; height: 100%; object-fit: cover; }
.product-card .name { display: block; padding: 0.4rem 0.5rem; font-size: 0.9rem; }
.product-card .price { display: block; padding: 0 0.5rem 0.25rem; font-weight: 600; }
.product-card .vendor { display: block; padding: 0 0.5rem 0.5rem; font-size: 0.8rem; color: #666; }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; padding: 0.5rem; background: #fff; border-top: 1px solid #eee; z-index: 100; }
.bottom-nav a { text-decoration: none; color: #666; font-size: 0.85rem; }
.bottom-nav a.active { color: #1a1a2e; font-weight: 600; }

/* Listing */
#screen-listing .products-grid { padding: 1rem; }

/* Product detail */
#product-content { padding: 1rem; }
#product-content .product-images { width: 100%; aspect-ratio: 1; background: #f0f0f0; border-radius: 8px; margin-bottom: 1rem; }
#product-content .product-images img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
#product-content .price { font-size: 1.25rem; font-weight: 700; }
#product-content .vendor { color: #666; margin-bottom: 1rem; }
.sizes { display: flex; gap: 0.5rem; margin: 1rem 0; }
.size-btn { padding: 0.5rem 1rem; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; }
.size-btn.active { border-color: #1a1a2e; background: #1a1a2e; color: #fff; }
#product-content .desc { margin: 1rem 0; font-size: 0.9rem; color: #555; }
#product-content .primary, #product-content .secondary { margin-right: 0.5rem; margin-top: 0.5rem; }

/* Cart */
#cart-items { padding: 1rem; }
.cart-item { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid #eee; }
.cart-summary { padding: 1rem; background: #fff; margin: 0 1rem; border-radius: 8px; }
.cart-summary p { margin: 0.25rem 0; }
#btn-checkout { margin: 1rem; }

/* Checkout */
.address-section, .payment-section { padding: 1rem; }
.address-option { display: block; padding: 0.5rem 0; }
#btn-add-address { margin: 0 1rem; }
#btn-confirm-order { margin: 1rem; }

/* Orders */
#orders-list { padding: 1rem; }
.order-row { display: block; padding: 1rem; background: #fff; border-radius: 8px; margin-bottom: 0.5rem; text-decoration: none; color: #333; }
.order-row .status { float: right; font-size: 0.85rem; color: #666; }

/* Order tracking */
.track-steps { padding: 1rem; }
.step { padding: 0.5rem 0; border-left: 3px solid #eee; padding-left: 1rem; margin-left: 0.5rem; }
.step.done { border-color: #28a745; color: #28a745; }
.order-items { padding: 1rem; }

/* Profile */
.profile-header { text-align: center; padding: 1.5rem; background: #fff; margin-bottom: 0.5rem; }
.profile-header .avatar { font-size: 3rem; margin-bottom: 0.5rem; }
.profile-header .name { margin: 0; font-weight: 600; }
.menu-list { list-style: none; margin: 0; padding: 0; background: #fff; }
.menu-list li { border-bottom: 1px solid #eee; }
.menu-list a, .menu-list button { display: block; width: 100%; padding: 1rem; text-align: left; background: none; border: none; font-size: 1rem; cursor: pointer; text-decoration: none; color: #333; }
