:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Main Content Spacing */
main {
    padding-top: 80px; /* Add padding to account for fixed header */
    min-height: calc(100vh - 80px - 60px); /* Adjust for header and footer heights */
}

.product-page-container {
    padding-top: 20px;
    margin-top: 0;
}

/* Categories sidebar */
.categories-sidebar {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: fit-content;
    margin-top: 20px;
}

/* Header and Navigation Styles */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1500; /* Increased z-index to be higher than other elements */
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.icon-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-count {
    background-color: #ff6b6b;
}

.cart-count {
    background-color: #28a745;
}

/* Hero Section */
.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 2rem;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
}

.carousel-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: slideInUp 0.8s ease;
}

.carousel-content p {
    font-size: 1.5rem;
    animation: slideInUp 0.8s ease 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 3;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background: var(--white);
}

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

/* Popular Stores Section */
.popular-stores {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.stores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    justify-content: center;
}

.store-container {
    display: flex;
    flex-direction: column;
}

.store-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0.7rem;
    text-align: center;
    font-weight: 600;
}

.store-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
    position: relative;
}

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

.store-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    /* Default text color class will be added via JavaScript */
}

.store-card-overlay.dark-bg {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.store-card-overlay.light-bg {
    background: linear-gradient(to top, rgba(255,255,255,0.8), transparent);
    color: var(--primary-color);
}

.store-card-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 0;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.store-card-overlay p {
    font-size: 1rem;
    opacity: 0.9;
}

.store-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Categories Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.view-all {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.categories {
    padding: 4rem 2rem;
    background-color: white;
}

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

.category-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
    border: 1px solid #eee;
}

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

.category-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
}

.category-card i {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.category-info {
    flex: 1;
}

.category-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.product-count {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-color);
}

/* Store Pages */
.stores-section {
    padding: 4rem 2rem;
    margin-top: 60px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    margin-top: 70px; /* Add space for the fixed header */
}

.store-header {
    padding: 2rem;
    margin-top: 60px;
    background: white;
    text-align: center;
}

.store-cover {
    max-width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.store-description {
    max-width: 800px;
    margin: 1rem auto;
    color: #666;
}

.store-products {
    padding: 4rem 2rem;
    background: var(--background-color);
}

/* Updated Products Grid */
.products-grid,
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 1.5rem;
}

/* Featured Products Section Styles */
.featured-products-section {
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.featured-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.featured-product-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.featured-product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.featured-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.featured-product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    line-height: 1.3;
    /* Prevent text overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    min-height: 2.6em;
}

.featured-product-meta {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.featured-product-category {
    color: #666;
    margin-bottom: 0.2rem;
}

.featured-product-store {
    color: #888;
    font-style: italic;
}

.featured-product-price {
    margin-top: auto;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.featured-product-actions {
    display: flex;
    padding: 0.5rem 1rem 1rem;
    gap: 0.5rem;
}

.featured-product-actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.view-product-btn {
    background-color: var(--secondary-color);
    color: white;
}

.wishlist-btn {
    background-color: #f8f9fa;
    color: #dc3545;
    border: 1px solid #dee2e6;
}

.sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--accent-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Mobile Styles for Featured Products */
@media (max-width: 768px) {
    .featured-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .featured-product-name {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .featured-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-product-image {
        height: 220px;
    }
    
    .featured-product-name {
        font-size: 1.1rem;
        -webkit-line-clamp: 2;
    }
}

/* Updated Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* Ensure enough space for text */
    min-height: 120px;
}

.product-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    /* Ensure product name doesn't overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.6em;
}

.product-price {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: bold;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8rem;
    margin-right: 0.4rem;
}

.discounted-price {
    color: var(--accent-color);
}

.discount-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 0.3rem;
}

.category-tag {
    display: inline-block;
    background: var(--background-color);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-bottom: 0.8rem;
}

.product-info .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    margin-top: auto;
}

.product-placeholder,
.store-placeholder {
    height: 150px;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-placeholder i,
.store-placeholder i {
    font-size: 2rem;
    color: #999;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    margin-top: 4rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Header Scroll Effects */
header {
    transition: transform 0.3s ease;
}

header.scroll-down {
    transform: translateY(-100%);
}

header.scroll-up {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--background-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid var(--background-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-result-item:hover {
    background-color: var(--background-color);
}

.search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-right: 1rem;
}

/* Product Filters */
.filter-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    background: none;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Cart Button */
.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.cart-count.bump {
    animation: bump 0.3s ease;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: #2ecc71;
    color: white;
}

.toast-error {
    background: #e74c3c;
    color: white;
}

/* Product Card Animations */
.product-card {
    animation: fadeIn 0.5s ease;
}

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

.product-card img {
    transition: transform 0.3s ease;
}

/* Add to Cart Button */
.add-to-cart {
    position: relative;
    overflow: hidden;
}

.add-to-cart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.add-to-cart:active::after {
    width: 300px;
    height: 300px;
}

.add-to-cart.adding {
    background: var(--secondary-color);
    pointer-events: none;
}

/* Authentication Pages */
.auth-container {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--background-color) 0%, #f8f9fa 100%);
}

.auth-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    animation: slideInUp 0.5s ease;
}

.auth-box h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
}

.toggle-password:hover {
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    width: auto;
    margin-right: 0.5rem;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.password-strength {
    height: 4px;
    margin-top: 0.5rem;
    border-radius: 2px;
    background: var(--border-color);
    overflow: hidden;
}

.password-strength::before {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength.weak::before {
    width: 33.33%;
    background: #ef4444;
}

.password-strength.medium::before {
    width: 66.66%;
    background: #f59e0b;
}

.password-strength.strong::before {
    width: 100%;
    background: #10b981;
}

.terms {
    font-size: 0.9rem;
}

.terms a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .auth-box {
        padding: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Featured Products Section */
.featured-products {
    padding: 4rem 2rem;
    background-color: var(--background-color);
}

.products-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 0 1rem;
}

.product-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
}

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

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.product-image {
    height: 200px;
    overflow: hidden;
}

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

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

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #6c757d;
}

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

.product-name {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    line-height: 1.3;
    min-height: 2.6rem;
}

.product-meta {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.product-category {
    color: #6c757d;
}

.product-store {
    color: var(--secondary-color);
}

.product-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9rem;
}

.discounted-price, .regular-price {
    font-weight: bold;
    color: #28a745;
}

.discount-badge {
    background-color: #dc3545;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem 1rem;
    margin-top: auto;
}

.product-actions .btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.25rem;
}

.view-product-btn {
    background-color: #007bff;
    color: white;
}

.view-product-btn:hover {
    background-color: #0056b3;
}

.wishlist-btn {
    background-color: #f8f9fa;
    color: #dc3545;
}

.wishlist-btn:hover {
    background-color: #e2e6ea;
}

/* Sale badge styling */
.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #dc3545;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 2;
}

/* Notification System */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 250px;
    min-width: 180px;
    word-wrap: break-word;
    line-height: 1.3;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.notification:before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 8px;
    font-size: 14px;
}

.notification.success:before {
    content: "\f00c"; /* checkmark icon */
}

.notification.error:before {
    content: "\f00d"; /* X icon */
}

.notification.info:before {
    content: "\f129"; /* info icon */
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.info {
    background-color: var(--secondary-color);
}

@media (max-width: 768px) {
    .notification {
        left: 15px;
        right: 15px;
        bottom: 15px;
        text-align: left;
        max-width: none;
        width: auto;
        font-size: 11px;
        padding: 8px 15px;
    }
}

/* Wishlist Page Styles */
.wishlist-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.wishlist-item-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.wishlist-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.wishlist-item-image {
    height: 200px;
    overflow: hidden;
}

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

.wishlist-item-image .sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #dc3545;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 10;
}

.wishlist-item-details {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.wishlist-item-price {
    color: #28a745;
    font-weight: bold;
    margin-top: auto;
}

.wishlist-item-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem 1rem;
    margin-top: auto;
}

.wishlist-item-footer .view-btn,
.wishlist-item-footer .remove-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.25rem;
    background-color: transparent;
    position: static;
    opacity: 1;
    width: auto;
    height: auto;
    font-size: 0.9rem;
}

.wishlist-item-footer .view-btn {
    background-color: #007bff;
    color: white;
}

.wishlist-item-footer .view-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.wishlist-item-footer .remove-btn {
    background-color: #f8f9fa;
    color: #dc3545;
}

.wishlist-item-footer .remove-btn:hover {
    background-color: #e2e6ea;
    transform: translateY(-2px);
}

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

.wishlist-item-image img {
    transition: transform 0.5s ease;
}

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

.wishlist-item-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.wishlist-item-details h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.wishlist-item-details h3 a:hover {
    color: var(--secondary-color);
}

.wishlist-item-details .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
    margin: 0.5rem 0 1rem;
}

.wishlist-item-details .add-to-cart-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.wishlist-item-details .add-to-cart-btn:hover {
    background-color: #2980b9;
}

.added-to-cart {
    background-color: #28a745 !important;
}

.wishlist-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.continue-shopping-btn, .clear-wishlist-btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.continue-shopping-btn {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border: 1px solid #dee2e6;
}

.continue-shopping-btn:hover {
    background-color: #e9ecef;
}

.clear-wishlist-btn {
    background-color: #f8d7da;
    color: #721c24;
    border: none;
    cursor: pointer;
}

.clear-wishlist-btn:hover {
    background-color: #f5c6cb;
}

.wishlist-empty {
    text-align: center;
    padding: 3rem 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.wishlist-empty-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.wishlist-empty p {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.wishlist-empty-subtext {
    color: #6c757d;
    margin-bottom: 2rem;
}

.wishlist-empty .continue-shopping-btn {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
}

.wishlist-empty .continue-shopping-btn:hover {
    background-color: #2980b9;
}

/* Animation for removing wishlist items */
.remove-animation {
    animation: removeItemAnimation 0.3s forwards;
}

@keyframes removeItemAnimation {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Responsive Styles for Wishlist Page */
@media (max-width: 768px) {
    .wishlist-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .wishlist-item-image {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .wishlist-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .wishlist-items-grid {
        grid-template-columns: 1fr;
    }
    
    .wishlist-item-card {
        display: flex;
        align-items: center;
    }
    
    .wishlist-item-image {
        width: 120px;
        height: 120px;
        flex-shrink: 0;
    }
    
    .wishlist-item-details {
        flex-grow: 1;
    }
    
    .remove-btn {
        opacity: 1;
    }
    
    .wishlist-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .continue-shopping-btn, .clear-wishlist-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Debug Information Styling */
.debug-info {
    margin-top: 3rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    font-family: monospace;
    font-size: 0.8rem;
}

.debug-info h3 {
    margin-top: 0;
    color: #6c757d;
}

.debug-info pre {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    background-color: #f1f3f5;
    padding: 0.5rem;
    border-radius: 4px;
}

/* Mobile Menu Styles */
.desktop-only {
    display: flex;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1501; /* Higher than header */
}

.mobile-side-menu {
    position: fixed;
    top: 0;
    right: -300px; /* Start off-screen */
    width: 300px;
    height: 100vh;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 2000; /* Higher than overlay */
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    padding-bottom: 30px; /* Add padding at bottom for better scrolling */
    display: none; /* Hide by default on desktop */
}

.mobile-side-menu.open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-header span {
    font-weight: bold;
    font-size: 1.3rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.mobile-menu-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
}

.mobile-menu-links a:hover {
    background-color: #f8f9fa;
}

.mobile-menu-links a i {
    width: 20px;
    text-align: center;
    color: var(--secondary-color);
}

.mobile-menu-links a:last-child {
    border-bottom: none;
}

.mobile-menu-links .count-badge {
    position: relative;
    top: -2px;
    right: auto;
    margin-left: 8px;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1999; /* Just below the side menu */
    display: none;
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.mobile-menu-overlay.open {
    display: block;
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .stores-grid,
    .categories-grid,
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Adjust header for mobile */
    .nav-container {
        padding: 0.8rem 1rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .mobile-side-menu {
        display: block; /* Show on mobile */
    }
}

@media (max-width: 576px) {
    .stores-grid,
    .categories-grid,
    .product-grid,
    .products-container {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        margin-bottom: 1rem;
        min-height: auto;
    }
    
    .product-card img {
        height: 200px;
    }
    
    .product-info {
        padding: 1rem;
        min-height: 100px;
    }
    
    .product-info h3 {
        font-size: 1.1rem;
        height: auto;
        -webkit-line-clamp: 2;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Products Page */
.products-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 30px;
    padding: 0 20px;
    position: relative;
    z-index: 1; /* Lower than header */
}

/* Override inline styles in products.php */
.container {
    padding-top: 80px !important; /* Force top padding to account for fixed header */
    position: relative;
    z-index: 1;
}

.products-page {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.filters-sidebar {
    position: relative;
    z-index: 1;
}

.products-main {
    position: relative;
    z-index: 1;
}

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

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

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

.product-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.product-store {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.product-price {
    font-weight: bold;
    color: var(--primary-color);
    margin-top: auto;
    margin-bottom: 10px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    grid-column: 1 / -1;
}

.empty-state img {
    max-width: 120px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Category Sidebar */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.category-list a:hover,
.category-list a.active {
    background-color: rgba(0,123,255,0.1);
    color: var(--primary-color);
}

.category-list .count {
    background-color: #e9ecef;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.categories-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 600;
}

/* Products Page Specific Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 80px !important; /* Force top padding to account for fixed header */
}

.products-page {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Sidebar Styles */
.filters-sidebar {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px; /* Updated to account for fixed header and main padding */
    z-index: 1;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.category-list li.active a {
    background-color: #e9ecef;
    font-weight: bold;
}

.count {
    color: #6c757d;
    font-size: 0.9rem;
}

#sort-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-form {
    display: flex;
}

.search-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-form button {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Main Content Styles */
.products-main {
    min-height: 500px;
    position: relative;
    z-index: 1;
}

.products-header {
    margin-bottom: 2rem;
}

.products-header h1 {
    margin-bottom: 0.5rem;
}

.products-header p {
    color: #6c757d;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 0.25rem;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-color);
    background-color: white;
    min-width: 40px;
    height: 40px;
}

.pagination-link:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.pagination-link.current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-link.prev, .pagination-link.next {
    padding: 0.5rem 1rem;
    min-width: auto;
}

.pagination-link.view-all {
    background-color: #f8f9fa;
    margin-left: 1rem;
    font-weight: 500;
}

.pagination-link.view-all.current {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.pagination-ellipsis {
    margin: 0 0.5rem;
    color: #6c757d;
}

.pagination-numbers {
    display: flex;
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .products-page {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}
