:root {
    --grass: #8F9779;
    --brown: #8B4513;
    --yellow: #FFD700;
    --green: #2E8B57;
    --light-green: #90EE90;
    --cream: #FFFDD0;
    --white: #FFFFFF;
    --dark: #2F4F4F;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: #333;
    background-color: var(--cream);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    color: var(--brown);
}

/* Navbar Styles */
.navbar {
    background-color: var(--grass) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-family: 'Merriweather', serif;
    font-weight: 900;
    font-size: 2rem;
    color: var(--yellow) !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.navbar-brand span {
    color: var(--white);
}

.nav-link {
    color: var(--white) !important;
    font-weight: 600;
    margin: 0 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--yellow) !important;
    transform: translateY(-2px);
}

/* Search Bar */
#searchContainer {
    max-width: 300px;
}

#searchInput {
    border-color: var(--yellow);
    background-color: rgba(255, 255, 255, 0.9);
}

#searchInput:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 0.25rem rgba(46, 139, 87, 0.25);
    background-color: var(--white);
}

/* Hero Section with African Sunset Background */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
                url('https://images.unsplash.com/photo-1544551763-46a013bb70d5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 180px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    max-width: 600px;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.2);
    animation: float 6s ease-in-out infinite;
}

.floating-element-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element-2 {
    width: 150px;
    height: 150px;
    bottom: 10%;
    right: 15%;
    animation-delay: 2s;
}

.floating-element-3 {
    width: 80px;
    height: 80px;
    top: 40%;
    right: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s;
    height: 100%;
    background-color: var(--white);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-top: 5px solid var(--green);
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.product-img {
    height: 220px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.5s;
    background-color: #f8f9fa; /* Fallback color while loading */
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-price {
    color: var(--green);
    font-weight: 700;
    font-size: 1.4rem;
}

.product-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--green);
    border-color: var(--green);
    padding: 10px 25px;
    font-weight: 700;
    border-radius: 30px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: var(--brown);
    border-color: var(--brown);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-outline-primary {
    color: var(--green);
    border-color: var(--green);
    border-radius: 30px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--green);
    border-color: var(--green);
    color: white;
}

/* Category Badges */
.category-badge {
    background-color: var(--grass);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 1rem;
    margin-right: 10px;
    margin-bottom: 10px;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.category-badge.active {
    background-color: var(--yellow);
    color: var(--brown);
    border-color: var(--brown);
    transform: scale(1.05);
}

.category-badge:hover:not(.active) {
    background-color: var(--green);
    transform: translateY(-3px);
}

/* Cart Sidebar */
.cart-sidebar {
    background-color: var(--cream);
    border-left: 1px solid var(--grass);
    height: 100vh;
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    transition: right 0.4s;
    z-index: 1050;
    box-shadow: -5px 0 20px rgba(0,0,0,0.15);
}

.cart-sidebar.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
}

.cart-overlay.active {
    display: block;
}

.cart-item {
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--grass);
}

.cart-total {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--green);
}

/* Featured Products Animation */
.featured-products {
    position: relative;
    overflow: hidden;
}

.product-slide {
    animation: slideIn 1s ease-out forwards;
    opacity: 0;
}

.product-slide:nth-child(1) { animation-delay: 0.2s; }
.product-slide:nth-child(2) { animation-delay: 0.4s; }
.product-slide:nth-child(3) { animation-delay: 0.6s; }
.product-slide:nth-child(4) { animation-delay: 0.8s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    background-color: var(--dark);
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer a {
    color: var(--yellow);
    text-decoration: none;
    transition: all 0.3s;
}

.footer a:hover {
    color: var(--light-green);
    text-decoration: underline;
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: var(--grass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--yellow);
    font-size: 1.8rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.feature-icon:hover {
    background-color: var(--yellow);
    color: var(--brown);
    transform: translateY(-5px);
}

.product-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--yellow);
    color: var(--brown);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    z-index: 1;
}

.cart-count {
    background-color: var(--yellow);
    color: var(--brown);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    position: absolute;
    top: -5px;
    right: -5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-header h2 {
    display: inline-block;
    padding-bottom: 15px;
    position: relative;
}

.section-header h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--yellow);
    border-radius: 2px;
}

/* Hero Products Animation */
.hero-product {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    animation: heroFloat 5s ease-in-out infinite;
    border: 2px solid var(--yellow);
}

@keyframes heroFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.hero-product img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .hero-section {
        padding: 80px 0 60px;
    }
    
    #searchContainer {
        max-width: 100%;
        margin-bottom: 15px;
    }
}

/* Animated Text */
.animated-text {
    display: inline-block;
    overflow: hidden;
    border-right: 3px solid var(--yellow);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--yellow) }
}

/* Price Filter */
#priceValue {
    font-weight: bold;
    color: var(--green);
}

/* Dropdown */
.dropdown-menu {
    border-color: var(--grass);
}

.dropdown-item:hover {
    background-color: var(--light-green);
    color: var(--dark);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 50px;
    color: var(--brown);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--grass);
}

/* Image optimization for low resolution */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Loading placeholders */
.img-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}