* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

body {
    background: #f5f5f5;
    color: #333;
    padding-bottom: 70px;
    min-height: 100vh;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* Desktop: Wider layout */
@media (min-width: 768px) {
    .app { max-width: 900px; }
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .top-nav-desktop { display: flex !important; }
    .app { padding-bottom: 40px; }
}

/* Top Bar (Mobile) */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar h1 { font-size: 18px; font-weight: bold; }
.icon-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #333;
    padding: 5px 8px;
}

/* Desktop Top Nav */
.top-nav-desktop {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background: #ee4d2d;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-nav-desktop .logo {
    font-size: 22px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}
.top-nav-desktop .nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}
.top-nav-desktop .nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    position: relative;
}
.top-nav-desktop .nav-links a:hover { background: rgba(255,255,255,0.15); }
.top-nav-desktop .badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: white;
    color: #ee4d2d;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Banner */
.banner {
    background: linear-gradient(135deg, #ee4d2d, #ff6b3d);
    color: white;
    padding: 30px 25px;
    margin: 15px;
    border-radius: 12px;
    text-align: center;
}
.banner h2 { margin-bottom: 8px; font-size: 22px; }
.banner p { opacity: 0.95; }

/* Section Title */
.section-title {
    padding: 5px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-top: 10px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px;
}

@media (min-width: 600px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); gap: 15px; padding: 20px; }
}

.product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
.product-img {
    width: 100%;
    aspect-ratio: 1;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 10px; }
.product-name {
    font-size: 13px;
    margin-bottom: 5px;
    min-height: 34px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    color: #ee4d2d;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: #ee4d2d; color: white; }
.btn-secondary { background: #fff; color: #ee4d2d; border: 1px solid #ee4d2d; }
.btn-danger { background: #dc3545; color: white; }
.btn-small { padding: 6px 10px; font-size: 12px; width: auto; }

/* Bottom Nav (Mobile only) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 8px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #999;
    font-size: 11px;
    position: relative;
    padding: 5px;
}
.nav-item.active { color: #ee4d2d; }
.nav-icon { display: block; font-size: 22px; margin-bottom: 2px; }
.bottom-nav .badge {
    position: absolute;
    top: -2px;
    right: 25%;
    background: #ee4d2d;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart */
.cart-list { padding: 10px 0; }
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin: 10px 15px;
}
.cart-item-img {
    width: 70px; height: 70px;
    background: #f0f0f0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-right: 15px;
    flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; margin-bottom: 6px; }
.cart-item-price { color: #ee4d2d; font-weight: bold; margin-bottom: 8px; }
.qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.qty-btn {
    width: 28px; height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}
.remove-btn {
    background: none;
    border: none;
    color: #ee4d2d;
    cursor: pointer;
    font-size: 20px;
    padding: 5px 10px;
}
.cart-summary {
    background: #fff;
    padding: 20px;
    margin: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
}
.total-price { color: #ee4d2d; font-weight: bold; font-size: 22px; }

/* Orders */
.order-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 15px;
}
.order-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}
.order-status {
    color: #ee4d2d;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
}
.order-items { margin: 8px 0; font-size: 14px; color: #555; }
.order-total {
    text-align: right;
    font-weight: bold;
    color: #ee4d2d;
    margin-top: 10px;
    font-size: 16px;
}

/* Login/Register */
.auth-container { padding: 40px 25px; max-width: 400px; margin: 0 auto; }
.auth-logo { text-align: center; margin-bottom: 25px; }
.shopee-logo {
    width: 70px;
    height: 70px;
    background: #ee4d2d;
    color: white;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
}
.auth-title { text-align: center; margin-bottom: 25px; color: #333; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #666; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #ee4d2d;
}
.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}
.auth-link a { color: #ee4d2d; text-decoration: none; font-weight: 500; }

/* Dashboard */
.profile-card {
    display: flex;
    padding: 20px 15px;
    align-items: center;
    background: white;
    border-bottom: 1px solid #eee;
}
.profile-logo { margin-right: 15px; text-align: center; }
.profile-logo .shopee-logo { width: 60px; height: 60px; font-size: 32px; }
.profile-info { flex: 1; }
.profile-info p { font-size: 14px; margin: 4px 0; }
.profile-info strong { display: inline-block; min-width: 70px; }

.action-buttons {
    display: flex;
    padding: 20px 0;
    border-bottom: 8px solid #f5f5f5;
    background: white;
}
.action-btn {
    flex: 1;
    text-align: center;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    font-size: 14px;
    color: #333;
}
.action-icon { font-size: 30px; margin-bottom: 5px; display: block; }
.menu-list { background: #fff; }
.menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    cursor: pointer;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    border-left: none;
    border-right: none;
    border-top: none;
}
.menu-item:hover { background: #fafafa; }
.menu-icon { margin-right: 12px; font-size: 20px; width: 24px; text-align: center; }
.menu-text { flex: 1; }
.menu-arrow { color: #ccc; font-size: 20px; }

/* Empty States */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}
.empty-state .icon { font-size: 70px; margin-bottom: 15px; display: block; }
.empty-state p { margin-bottom: 20px; font-size: 15px; }

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin: 15px;
    font-size: 14px;
    animation: slideDown 0.3s;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-error { background: #fee; color: #c33; border: 1px solid #fcc; }
.alert-success { background: #efe; color: #363; border: 1px solid #cfc; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 25px;
    border-radius: 10px;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.modal-actions .btn { flex: 1; }

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}
