/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #333; line-height: 1.6; background: #f5f5f5; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Header */
.site-header { background: #1a1a2e; color: #fff; padding: 0; position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; padding: 0.75rem 1rem; flex-wrap: wrap; }
.logo { font-size: 1.5rem; font-weight: 700; color: #fff; }
.logo:hover { text-decoration: none; color: #60a5fa; }
.search-form { display: flex; flex: 1; max-width: 400px; }
.search-form input { flex: 1; padding: 0.5rem 0.75rem; border: none; border-radius: 4px 0 0 4px; font-size: 0.9rem; }
.search-form button { padding: 0.5rem 1rem; background: #2563eb; color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 0.9rem; }
.search-form button:hover { background: #1d4ed8; }
.nav-links { display: flex; list-style: none; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: #ddd; font-size: 0.9rem; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.cart-link { background: #2563eb; padding: 0.4rem 0.8rem; border-radius: 4px; color: #fff !important; }

/* Main */
.main-content { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; min-height: 60vh; }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.85rem; color: #666; margin-bottom: 1rem; }
.breadcrumbs a { color: #2563eb; }
.breadcrumbs .separator { margin: 0 0.4rem; color: #999; }

/* Category Grid */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.category-card { background: #fff; border-radius: 8px; padding: 1.5rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform 0.2s; }
.category-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); text-decoration: none; }
.category-card h3 { color: #333; margin-bottom: 0.5rem; }
.category-card p { color: #666; font-size: 0.85rem; }

/* Product Grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform 0.2s; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.product-card a { text-decoration: none; color: inherit; }
.product-card-image { width: 100%; height: 200px; background: #e5e7eb; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 3rem; }
.product-card-body { padding: 1rem; }
.product-card-body h3 { font-size: 1rem; margin-bottom: 0.5rem; color: #333; }
.product-card-body .price { font-size: 1.25rem; font-weight: 700; color: #059669; }
.product-card-body .rating { color: #f59e0b; font-size: 0.9rem; margin-top: 0.25rem; }
.product-card-body .short-desc { color: #666; font-size: 0.85rem; margin-top: 0.5rem; }
.stock-badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.stock-badge.in-stock { background: #d1fae5; color: #065f46; }
.stock-badge.out-of-stock { background: #fee2e2; color: #991b1b; }

/* Filters */
.page-with-sidebar { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; }
.sidebar-filters { background: #fff; border-radius: 8px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); height: fit-content; position: sticky; top: 80px; }
.sidebar-filters h3 { font-size: 1rem; margin-bottom: 1rem; }
.filter-group { margin-bottom: 1.5rem; }
.filter-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.85rem; color: #555; }
.filter-group input, .filter-group select { width: 100%; padding: 0.4rem; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; }
.filter-group .price-range { display: flex; gap: 0.5rem; align-items: center; }
.filter-group .price-range input { width: 45%; }
.filter-btn { width: 100%; padding: 0.5rem; background: #2563eb; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.filter-btn:hover { background: #1d4ed8; }

/* Product Detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; background: #fff; border-radius: 8px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.product-image { width: 100%; height: 400px; background: #e5e7eb; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 5rem; }
.product-info h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.product-info .price { font-size: 2rem; font-weight: 700; color: #059669; margin-bottom: 1rem; }
.product-info .rating { color: #f59e0b; margin-bottom: 1rem; }
.product-info .description { color: #555; margin-bottom: 1.5rem; line-height: 1.7; }
.add-to-cart-form { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.add-to-cart-form input[type="number"] { width: 60px; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; text-align: center; }
.btn { display: inline-block; padding: 0.6rem 1.5rem; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; font-weight: 600; text-align: center; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; text-decoration: none; }

/* Specs Table */
.specs-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.specs-table th, .specs-table td { padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.specs-table th { background: #f9fafb; font-weight: 600; width: 35%; color: #555; }

/* Reviews */
.reviews-section { margin-top: 2rem; background: #fff; border-radius: 8px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.reviews-section h2 { margin-bottom: 1rem; }
.review-card { border-bottom: 1px solid #e5e7eb; padding: 1rem 0; }
.review-card:last-child { border-bottom: none; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.review-author { font-weight: 600; }
.review-rating { color: #f59e0b; }
.review-title { font-weight: 600; margin-bottom: 0.25rem; }
.review-body { color: #555; font-size: 0.95rem; }

/* Related Products */
.related-products { margin-top: 2rem; }
.related-products h2 { margin-bottom: 1rem; }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.cart-table th, .cart-table td { padding: 1rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.cart-table th { background: #f9fafb; font-weight: 600; }
.cart-table .quantity-input { width: 60px; padding: 0.3rem; border: 1px solid #ddd; border-radius: 4px; text-align: center; }
.cart-summary { background: #fff; border-radius: 8px; padding: 1.5rem; margin-top: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.cart-summary .total-row { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 1.1rem; }
.cart-summary .total-row.grand-total { font-weight: 700; font-size: 1.3rem; border-top: 2px solid #333; padding-top: 1rem; margin-top: 0.5rem; }
.promo-form { display: flex; gap: 0.5rem; margin: 1rem 0; }
.promo-form input { flex: 1; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; }
.empty-cart { text-align: center; padding: 3rem; color: #666; }

/* Checkout */
.checkout-form { background: #fff; border-radius: 8px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 600px; }
.checkout-form h1 { margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.form-group input, .form-group textarea { width: 100%; padding: 0.6rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.form-group textarea { min-height: 80px; resize: vertical; }

/* Order */
.order-confirmation { background: #fff; border-radius: 8px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 700px; }
.order-confirmation h1 { color: #059669; margin-bottom: 1rem; }
.order-details { margin: 1.5rem 0; }
.order-details dt { font-weight: 600; color: #555; }
.order-details dd { margin-bottom: 0.75rem; margin-left: 0; }
.order-status { display: inline-block; padding: 0.3rem 0.75rem; border-radius: 4px; font-weight: 600; font-size: 0.9rem; }
.order-status.confirmed { background: #dbeafe; color: #1e40af; }
.order-status.shipped { background: #fef3c7; color: #92400e; }
.order-status.delivered { background: #d1fae5; color: #065f46; }

/* Track Order */
.track-form { background: #fff; border-radius: 8px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 500px; margin: 0 auto; text-align: center; }
.track-form h1 { margin-bottom: 1rem; }
.track-form input { padding: 0.6rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; width: 250px; }

/* Messages */
.message { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.message.success { background: #d1fae5; color: #065f46; }
.message.error { background: #fee2e2; color: #991b1b; }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span { padding: 0.5rem 0.75rem; border-radius: 4px; font-size: 0.9rem; }
.pagination a { background: #fff; border: 1px solid #ddd; }
.pagination a:hover { background: #f3f4f6; text-decoration: none; }
.pagination .current { background: #2563eb; color: #fff; }

/* Section titles */
.section-title { font-size: 1.5rem; margin-bottom: 1rem; }

/* Footer */
.site-footer { background: #1a1a2e; color: #aaa; padding: 1.5rem; margin-top: 3rem; text-align: center; font-size: 0.85rem; }
.site-footer a { color: #60a5fa; }

/* Responsive */
@media (max-width: 768px) {
    .page-with-sidebar { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; }
    .nav-container { flex-direction: column; gap: 0.75rem; }
    .search-form { max-width: 100%; }
}
