:root {
    --primary: #25d366;
    /* WhatsApp Green */
    --primary-dark: #128c7e;
    --secondary: #ff9800;
    /* Orange accent */
    --text-main: #1c1e21;
    --text-muted: #65676b;
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header & Nav */
header {
    background: var(--bg-card);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container img {
    height: 50px;
    width: 50px;
    object-fit: contain;
    border-radius: 50%;
}

.store-info h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.store-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-toggle {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 3rem 5%;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

#product-search {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    box-shadow: var(--shadow);
}

/* Categories */
.categories {
    padding: 0 5%;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-pill {
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Product Grid */
.products-grid {
    padding: 0 5% 5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
}

.product-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-price {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.add-to-cart {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.add-to-cart:hover {
    background: var(--primary-dark);
}

/* Cart Panel */
.cart-panel {
    position: fixed;
    right: -100%;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 2000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 1rem;
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.item-details {
    flex: 1;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.checkout-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

/* Modal for Customer Info */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Footer */
footer {
    background: var(--text-main);
    color: white;
    padding: 3rem 5%;
    text-align: center;
}

.footer-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Loading & Empty States */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--primary-dark);
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Checkout Button Styles */
.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 1.8rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}