/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Amazon Ember', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: #ff9900;
    color: white;
}

.btn-primary:hover {
    background-color: #e68900;
}

.btn-secondary {
    background-color: #232f3e;
    color: white;
}

.btn-secondary:hover {
    background-color: #1a252f;
}

/* Header Styles */
.header {
    background-color: #232f3e;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    align-items: center;
    padding: 10px 0;
    gap: 20px;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar {
    flex: 1;
    max-width: 600px;
}

.search-bar form {
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.search-bar select {
    padding: 12px;
    border: none;
    background: #f3f3f3;
    min-width: 120px;
    font-size: 14px;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    border: none;
    font-size: 14px;
    outline: none;
}

.search-bar button {
    padding: 12px 16px;
    background: #ff9900;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.search-bar button:hover {
    background: #e68900;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-actions a {
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    position: relative;
}

.header-actions a i {
    font-size: 18px;
    margin-bottom: 2px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff9900;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.main-nav {
    background-color: #37475a;
    padding: 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 12px 16px;
    display: block;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.main-nav a:hover {
    background-color: #485769;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 300;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Products Grid */
.featured-products {
    padding: 60px 0;
    background: white;
}

.featured-products h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #232f3e;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 200px;
    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);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #232f3e;
    font-weight: 500;
}

.rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.rating i {
    color: #ddd;
    font-size: 14px;
}

.rating i.active {
    color: #ff9900;
}

.rating span {
    color: #666;
    font-size: 12px;
}

.price {
    margin-bottom: 15px;
}

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
}

.original-price {
    font-size: 14px;
    color: #666;
    text-decoration: line-through;
    margin-left: 8px;
}

.add-to-cart {
    width: 100%;
    font-size: 14px;
    padding: 10px;
}

/* Categories Section */
.categories-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.categories-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #232f3e;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.category-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-image {
    height: 150px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card h3 {
    padding: 20px;
    font-size: 18px;
    color: #232f3e;
}

/* Newsletter */
.newsletter {
    background: #232f3e;
    color: white;
    padding: 60px 0;
    text-align: center;
}

.newsletter h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.newsletter p {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.newsletter form {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

/* Footer */
.footer {
    background: #232f3e;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: #37475a;
    transition: background 0.3s ease;
}

.social-links a:hover {
    background: #ff9900;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #37475a;
    color: #ccc;
}

/* Product Detail Page */
.product-detail {
    padding: 40px 0;
    background: white;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.product-images {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
}

.image-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thumbnail {
    width: 100px;
    height: 100px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.thumbnail.active {
    border-color: #ff9900;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.main-image {
    position: relative;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #232f3e;
}

.product-brand {
    color: #0066c0;
    font-size: 14px;
    margin-bottom: 10px;
}

.product-price {
    margin-bottom: 20px;
}

.product-price .current-price {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
}

.product-price .original-price {
    font-size: 18px;
    color: #666;
    text-decoration: line-through;
    margin-left: 10px;
}

.product-description {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #555;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* Cart Page */
.cart-page {
    padding: 40px 0;
    background: white;
}

.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.cart-items {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h3 {
    margin-bottom: 8px;
    color: #232f3e;
}

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-summary {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-total {
    font-weight: bold;
    font-size: 18px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* Login/Register Forms */
.auth-page {
    padding: 40px 0;
    background: #f8f9fa;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-form {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #232f3e;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #ff9900;
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #0066c0;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Error and Success Messages */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff9900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .product-detail-content {
        grid-template-columns: 1fr;
    }
    
    .cart-content {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .newsletter form {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}