* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0A5177;
    --primary-dark: #0A5177;
    --primary-light: #e6f4ff;
    --secondary: #ff6b35;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --border: #e5e7eb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-gray);
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-small {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

/* Button Styles */
.btn-icon {
    background: #0A5177;
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    transition: all 0.2s;
}

.btn-icon:active {
    transform: scale(0.95);
    background: #0A5177;
}

.btn-icon svg {
    width: 24px;
    height: 24px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:active {
    transform: scale(0.98);
}

/* Search Bar */
.search-bar-wrapper {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.search-bar {
    background: var(--light-gray);
    border-radius: 24px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.search-bar:focus-within {
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar svg {
    width: 20px;
    height: 20px;
    color: var(--gray);
}

.search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    background: transparent;
}

/* Container */
.container {
    padding: 16px;
    padding-bottom: 100px;
}

/* Banner Slider */
.banner-slider {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    width: 20px;
    background: white;
}

/* Category Cards */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.see-all {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
    width: 100%;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    min-width: 0;
}

.category-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

.category-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #f0f9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--secondary);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.category-info {
    padding: 12px;
}

.category-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 4px;
}

.category-count {
    font-size: 13px;
    color: var(--gray);
}

/* Product List */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: var(--shadow);
    position: relative;
    transition: all 0.2s;
}

.product-card:active {
    transform: scale(0.99);
}

.product-image {
    width: 100px;
    height: 100px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-badge {
    background: var(--success);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    align-self: flex-start;
    margin-bottom: 6px;
}

.product-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-subtitle {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.product-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray);
}

.product-meta-item svg {
    width: 14px;
    height: 14px;
}

.product-price {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    align-self: flex-start;
    margin-bottom: 8px;
}

.product-stock.low-stock {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.product-stock.out-of-stock {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-view {
    flex: 1;
    padding: 10px;
    background: var(--light-gray);
    color: var(--dark);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn-add-to-cart {
    flex: 1;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-to-cart:active {
    transform: scale(0.98);
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 90;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fab:active {
    transform: scale(0.95);
}

.fab svg {
    width: 28px;
    height: 28px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    text-decoration: none;
    color: var(--gray);
    transition: all 0.2s;
    position: relative;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    padding: 0 4px;
}

/* Cart Styles */
.cart-item {
    background: white;
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.qty-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-display {
    font-size: 16px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.btn-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove:active {
    transform: scale(0.9);
}

.btn-remove svg {
    width: 16px;
    height: 16px;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.cart-summary h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--primary);
    margin-top: 8px;
    padding-top: 16px;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: white;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.filters-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 8px 16px;
    background: var(--light-gray);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    width: 100%;
}

.stat-card {
    background: white;
    padding: 10px 6px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    min-width: 0;
    overflow: hidden;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.stat-label {
    font-size: 10px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-text {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    padding: 0 4px;
    border: 2px solid white;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* Pull to Refresh */
.pull-to-refresh {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    transition: all 0.3s;
}

.pull-to-refresh.pulling {
    top: 0;
}

/* Swipe Actions */
.swipe-actions {
    display: flex;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
}

.swipe-action {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

.swipe-action.edit {
    background: var(--primary);
}

.swipe-action.delete {
    background: var(--danger);
}

/* Responsive */
@media (max-width: 380px) {
    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .stat-card {
        padding: 8px 4px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .category-image {
        height: 100px;
        font-size: 36px;
    }
    
    .category-info {
        padding: 10px;
    }
    
    .category-name {
        font-size: 14px;
    }
    
    .category-count {
        font-size: 12px;
    }
}

@media (max-width: 320px) {
    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    
    .stat-card {
        padding: 6px 2px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 8px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .category-image {
        height: 90px;
        font-size: 32px;
    }
    
    .category-info {
        padding: 8px;
    }
    
    .category-name {
        font-size: 13px;
    }
    
    .category-count {
        font-size: 11px;
    }
}