/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: #d32f2f; /* Red header like zurimall */
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
}

.search-container {
    display: flex;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px 0 0 4px;
}

.search-btn {
    padding: 0.5rem;
    background: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.cart-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#cart-count {
    background: #fff;
    color: #d32f2f;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-weight: bold;
}

.cart-toggle {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

/* Main content */
.main {
    display: flex;
    margin-top: 2rem;
}

.products-section {
    flex: 1;
    margin-right: 2rem;
}

.products-section h2 {
    margin-bottom: 1rem;
    color: #d32f2f;
}

.category-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.category-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-btn:hover {
    background: #e0e0e0;
}

.category-btn.active {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 100px;
    object-fit: contain;
}

.product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 0.5rem;
}

.product-description {
    margin-bottom: 1rem;
    color: #666;
    flex: 1;
}

.add-to-cart {
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: auto;
    margin-bottom: 0;
    position: relative;
}

.add-to-cart::after {
    content: " →";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Cart sidebar */
.cart-sidebar {
    width: 420px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem;
    position: fixed;
    right: 20px;
    top: 100px;
    bottom: 20px;
    overflow-y: auto;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 1;
    pointer-events: auto;
}

.cart-sidebar.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    margin-bottom: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item-name {
    flex: 1;
}

.cart-item-price {
    font-weight: bold;
}

.remove-item {
    background: #f44336;
    color: #fff;
    border: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.cart-summary {
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.checkout-btn {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.close-modal {
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .search-container {
        margin: 0;
        max-width: 100%;
    }

    .main {
        flex-direction: column;
    }

    .products-section {
        margin-right: 0;
    }

    .cart-sidebar {
        width: 100%;
        position: static;
        transform: translateX(0);
    }

    .cart-sidebar.hidden {
        display: none;
    }

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