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

body {
    font-family: 'Amazon Ember', Arial, sans-serif;
    background-color: #f3f3f3;
    color: #333;
}

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

/* Header Styles */
.header {
    background-color: #232f3e;
    color: white;
    padding: 8px 0;
}

.header-container {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
}

.logo img {
    height: 30px;
}

.search-container {
    flex: 1;
    display: flex;
    max-width: 600px;
}

.search-category {
    background-color: #f3f3f3;
    border: none;
    padding: 8px 12px;
    border-radius: 4px 0 0 4px;
    color: #333;
    font-size: 12px;
    min-width: 60px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-btn {
    background-color: #febd69;
    border: none;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background-color: #f3a847;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.account, .orders {
    cursor: pointer;
    font-size: 12px;
    line-height: 1.2;
}

.account:hover, .orders:hover {
    border: 1px solid white;
    padding: 4px;
    border-radius: 2px;
}

.cart {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    position: relative;
    padding: 4px;
    border-radius: 2px;
    background: none;
    border: none;
    font: inherit;
    color: inherit;
}

.cart:hover {
    border: 1px solid white;
}

.cart-count {
    background-color: #ff9900;
    color: #232f3e;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    left: 15px;
}

/* Navigation Styles */
.nav {
    background-color: #37475a;
    padding: 8px 0;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 2px;
    font-size: 14px;
}

.nav-links a:hover {
    background-color: #485769;
}

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

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Products Section */
.products-section {
    padding: 40px 0;
}

.products-section h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #232f3e;
}

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

.product-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: #f8f8f8;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    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-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #232f3e;
    font-weight: 500;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.stars {
    color: #ff9900;
}

.rating-count {
    color: #007185;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #B12704;
    margin-bottom: 15px;
}

.add-to-cart {
    width: 100%;
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-to-cart:hover {
    background-color: #e68900;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #232f3e;
    color: white;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background-color: #f8f8f8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.cart-item-title {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #232f3e;
}

.cart-item-price {
    font-weight: bold;
    color: #B12704;
    margin-bottom: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

.remove-item {
    background: none;
    border: none;
    color: #007185;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    background-color: #f8f8f8;
}

.cart-total {
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: right;
}

.checkout-btn {
    width: 100%;
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.checkout-btn:hover {
    background-color: #e68900;
}

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

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

/* Empty Cart Message */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        max-width: none;
    }
    
    .header-actions {
        order: 2;
        justify-content: space-between;
        width: 100%;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
}