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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header and Navigation */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.nav-logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    color: #ffd700;
    transform: translateY(-2px);
}

.nav-search form {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    overflow: hidden;
}

.nav-search input {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: white;
    width: 250px;
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.nav-search button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.5rem 1rem;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.nav-search button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages */
.messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 200;
    max-width: 400px;
}

.alert {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    display: flex;
    align-items: center;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.3s both;
}

.hero-cta {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.6s both;
}

.hero-cta:hover {
    background: #ff5252;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.floating-elements {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
}

.floating-item {
    font-size: 3rem;
    position: absolute;
    animation: float 3s ease-in-out infinite;
}

.floating-item:nth-child(1) {
    top: -50px;
    right: 0;
    animation-delay: 0s;
}

.floating-item:nth-child(2) {
    top: 20px;
    right: 80px;
    animation-delay: 1s;
}

.floating-item:nth-child(3) {
    top: 100px;
    right: 20px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
.featured-section,
.categories-section {
    padding: 4rem 0;
    background: white;
}

.featured-section h2,
.categories-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.product-image {
    position: relative;
    height: 250px;
    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.1);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ccc;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.view-product {
    background: white;
    color: #333;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.view-product:hover {
    background: #ff6b6b;
    color: white;
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

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

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.add-to-cart-form {
    width: 100%;
}

.add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
}

.add-to-cart-btn.primary {
    background: #ff6b6b;
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.add-to-cart-btn.primary:hover {
    background: #ff5252;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.category-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.category-link {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.category-link:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

/* Product List Page */
.page-header {
    text-align: center;
    margin: 2rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.search-results {
    color: #666;
    font-size: 1.1rem;
}

.products-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* Sidebar Filters */
.filters-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.category-filter {
    list-style: none;
}

.category-filter li {
    margin-bottom: 0.5rem;
}

.category-filter a {
    color: #666;
    text-decoration: none;
    padding: 0.5rem;
    display: block;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.category-filter a:hover,
.category-filter a.active {
    background: #667eea;
    color: white;
}

/* Product Detail Page */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.product-images .main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
}

.breadcrumb {
    margin-bottom: 1rem;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.product-detail h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.product-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category {
    background: #f0f0f0;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.availability {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: bold;
}

.availability.in_stock {
    color: #28a745;
}

.availability.out_of_stock {
    color: #dc3545;
}

.product-detail .product-price {
    font-size: 2rem;
    color: #ff6b6b;
    margin: 1rem 0;
}

.product-description {
    margin: 2rem 0;
}

.product-description h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* Product Form */
.product-form {
    margin-top: 2rem;
}

.quantity-selector {
    margin-bottom: 1.5rem;
}

.quantity-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

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

.quantity-input input {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 2px solid #f0f0f0;
    border-radius: 5px;
    font-weight: bold;
}

/* Related Products */
.related-products {
    margin: 3rem 0;
}

.related-products h2 {
    margin-bottom: 2rem;
    color: #333;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.page-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-links a {
    padding: 0.5rem 1rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.page-links a:hover {
    background: #667eea;
    color: white;
}

.current-page {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border-radius: 5px;
}

/* No Products */
.no-products {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-products i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ddd;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 1rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.social-links a:hover {
    background: #667eea;
}

.footer-bottom {
    border-top: 1px solid #555;
    text-align: center;
    padding: 1rem;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-search input {
        width: 200px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .products-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .floating-elements {
        display: none;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
