/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

nav ul li a:hover {
    color: #3498db;
    background: rgba(255,255,255,0.1);
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
}

.search-bar button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #2980b9;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 5rem 0;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Products Grid - FIXED */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    width: 100%;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

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

.product-card h3 {
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-size: 1.3rem;
    line-height: 1.4;
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.category {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.product-actions {
    margin-top: auto;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-add-cart, .btn-view {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.btn-add-cart {
    background: #27ae60;
    color: white;
}

.btn-add-cart:hover {
    background: #219a52;
    transform: translateY(-2px);
}

.btn-view {
    background: #3498db;
    color: white;
}

.btn-view:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Cart Count */
.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-left: 5px;
    min-width: 18px;
    display: inline-block;
    text-align: center;
}

/* Footer */
footer {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* User Menu */
.user-menu {
    font-weight: 600;
    color: #3498db !important;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
    border-left: 4px solid;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-bar {
        margin: 1rem 0;
        max-width: 100%;
        order: 3;
        width: 100%;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-add-cart, .btn-view {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .product-card {
        margin: 0 10px;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
button:focus,
a:focus,
input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}