/* Custom Color Palette Variables */
:root {
    --primary-color: #ba487f;
    --primary-variant: #722323;
    --secondary-color: #8fa31e;
    --secondary-variant: #556b2f;
    --background: #c6d870;
    --surface: #FFFFFF;
    --error: #B00020;
    --accent-coral: #ff9587;
    --accent-cream: #ffeccc;
    --accent-light-green: #eff5d2;
    --on-primary: #FFFFFF;
    --on-secondary: #000000;
    --on-background: #000000;
    --on-surface: #000000;
    --on-error: #FFFFFF;
    
    /* Elevation shadows */
    --elevation-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --elevation-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --elevation-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --elevation-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    --elevation-5: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    
    /* Typography */
    --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--background), var(--accent-light-green));
    color: var(--on-background);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 56px; /* App bar height */
    padding-bottom: 80px; /* Bottom navigation height */
}

/* App Bar */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--primary-color);
    color: var(--on-primary);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    box-shadow: var(--elevation-2);
    z-index: 1000;
}

.nav-button,
.action-button {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--on-primary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.nav-button:hover,
.action-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-button:active,
.action-button:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.app-title {
    flex: 1;
    font-size: 20px;
    font-weight: 500;
    margin: 0 var(--spacing-md);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Navigation Drawer */
.nav-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--surface);
    box-shadow: var(--elevation-5);
    z-index: 1100;
    transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    overflow-y: auto;
}

.nav-drawer.open {
    left: 0;
}

.nav-drawer-header {
    height: 150px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-variant));
    color: var(--on-primary);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--spacing-lg);
}

.nav-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: var(--spacing-sm);
}

.nav-drawer-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.nav-drawer-content {
    padding: var(--spacing-sm) 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--on-surface);
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
    background-color: rgba(186, 72, 127, 0.08);
    color: var(--primary-color);
}

.nav-item i {
    margin-right: var(--spacing-lg);
    font-size: 16px;
    width: 24px;
    text-align: center;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    padding: var(--spacing-md);
    max-width: 100%;
}

/* Search Bar */
.search-container {
    margin-bottom: var(--spacing-md);
}

.search-bar {
    position: relative;
    background-color: var(--surface);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--elevation-1);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    height: 48px;
}

.search-bar i {
    color: rgba(0, 0, 0, 0.54);
    margin-right: var(--spacing-sm);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 16px;
    color: var(--on-surface);
}

.search-bar input::placeholder {
    color: rgba(0, 0, 0, 0.54);
}

/* Category Chips */
.category-chips {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-xs);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    background-color: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: var(--elevation-1);
}

.chip.active {
    background-color: var(--primary-color);
    color: var(--on-primary);
    border-color: var(--primary-color);
}

.chip a {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* Products Grid */
.products-section {
    margin-bottom: var(--spacing-xl);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing-md);
}

@media (min-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Product Cards */
.product-card {
    background-color: var(--surface);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--elevation-1);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    box-shadow: var(--elevation-3);
    transform: translateY(-2px);
}

.product-card:active {
    transform: translateY(0);
    box-shadow: var(--elevation-1);
}

.product-image {
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(0, 0, 0, 0.38);
    font-size: 48px;
}

.product-content {
    padding: var(--spacing-md);
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--on-surface);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-details {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.detail-chip {
    background-color: rgba(98, 0, 238, 0.08);
    color: var(--primary-color);
    padding: 2px var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-chip i {
    font-size: 10px;
}

.price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.fab-button {
    width: 40px;
    height: 40px;
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elevation-2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fab-button:hover {
    background-color: #128C7E;
    box-shadow: var(--elevation-3);
}

.fab-button:active {
    box-shadow: var(--elevation-1);
    transform: scale(0.95);
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--surface);
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
    box-shadow: var(--elevation-5);
    z-index: 1200;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 32px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
    margin: var(--spacing-md) auto var(--spacing-sm);
}

.bottom-sheet-content {
    padding: 0 var(--spacing-lg) var(--spacing-xl);
}

.product-detail-image {
    aspect-ratio: 1;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
    background-color: #f5f5f5;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
    color: var(--on-surface);
}

.detail-specs {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.spec-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: rgba(98, 0, 238, 0.08);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    color: var(--primary-color);
    font-weight: 500;
}

.detail-price {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
}

.cta-button {
    width: 100%;
    height: 48px;
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: var(--elevation-2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #128C7E;
    box-shadow: var(--elevation-3);
}

.cta-button:active {
    box-shadow: var(--elevation-1);
    transform: scale(0.98);
}

/* Bottom Navigation */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--surface);
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    z-index: 900;
}

.bottom-nav {
    display: flex;
    height: 56px;
}

.nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.54);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link.active {
    color: var(--primary-color);
}

.nav-link i {
    font-size: 18px;
    margin-bottom: 2px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: rgba(0, 0, 0, 0.54);
}

.empty-icon {
    font-size: 72px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.3;
}

.empty-state h2 {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: var(--spacing-sm);
    color: var(--on-surface);
}

.empty-state p {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.54);
}

/* Ripple Effect */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    .main-content {
        padding: var(--spacing-sm);
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--spacing-sm);
    }
}

@media (min-width: 768px) {
    body {
        padding-left: 280px;
    }
    
    .nav-drawer {
        left: 0;
    }
    
    .nav-button {
        display: none;
    }
    
    .overlay {
        display: none;
    }
}

/* Animations */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 600ms linear;
    background-color: rgba(255, 255, 255, 0.6);
}