/* Modern E-commerce Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-color: #374151;
    --text-light: #6b7280;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

/* Header Styles */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-main {
    padding: 10px 0;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #006633;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 60px;
    width: auto;
}

.site-name {
    font-weight: 700;
    color: #006633;
}

.desktop-nav {
    display: flex;
    gap: 20px;
}

.desktop-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.desktop-nav a:hover {
    color: var(--primary-color);
}

.desktop-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.signup-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
}

.admin-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.mobile-right {
    display: none;
    align-items: center;
    gap: 15px;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav a {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

.mobile-auth-links {
    display: flex;
    flex-direction: column;
    border-top: 2px solid #eee;
    padding-top: 15px;
    margin-top: 10px;
}

.mobile-auth-links a {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--primary-color);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-icon {
    position: relative;
    color: var(--text-color);
    font-size: 24px;
    text-decoration: none;
}

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

/* Navigation */
.navbar {
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    padding: 15px 0;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Modern Hero Section */
.hero-modern {
    background: linear-gradient(135deg, #006633 0%, #004d26 100%);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-hero.primary {
    background: #fff;
    color: #006633;
    box-shadow: 0 4px 20px rgba(255,255,255,0.3);
}

.btn-hero.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255,255,255,0.4);
}

.btn-hero.secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.btn-hero.secondary:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.hero-visual {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.hero-card:hover {
    transform: translateX(10px);
    background: rgba(255,255,255,0.15);
}

.hero-card i {
    font-size: 24px;
    width: 40px;
}

.hero-card span {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Features Section */
.features-modern {
    padding: 40px 0;
    background: #f8fafc;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.section-header p {
    font-size: 1rem;
    color: #64748b;
    max-width: 500px;
    margin: 0 auto;
}

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

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--feature-color);
}

.feature-card.mpesa { --feature-color: #10b981; }
.feature-card.whatsapp { --feature-color: #25d366; }
.feature-card.delivery { --feature-color: #3b82f6; }
.feature-card.support { --feature-color: #f59e0b; }

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

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--feature-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.feature-card p {
    color: #64748b;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 30px 0;
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

.product-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #f1f5f9;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

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

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

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

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.product-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 1;
    transition: opacity 0.3s;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(128, 128, 128, 0.9);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(128, 128, 128, 1);
    transform: scale(1.1);
}

.action-btn.in-wishlist {
    background: #dc3545;
    color: #fff;
}

.action-btn.in-wishlist:hover {
    background: #c82333;
}

.product-info {
    padding: 15px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.original-price {
    font-size: 16px;
    color: var(--text-light);
    text-decoration: line-through;
}

.add-to-cart {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #006633 0%, #004d26 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 51, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .btn-hero {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    /* Header Mobile Styles */
    .desktop-nav,
    .desktop-auth {
        display: none;
    }
    
    .mobile-right {
        display: flex;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 12px;
        min-height: 100px;
    }
    
    .product-title {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .current-price {
        font-size: 16px;
    }
    
    .add-to-cart {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero-modern {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-info {
        padding: 8px;
        min-height: 90px;
    }
    
    .product-title {
        font-size: 13px;
        line-height: 1.2;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .add-to-cart {
        padding: 8px;
        font-size: 0.75rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-modern {
        padding: 40px 0;
    }
    
    .container {
        padding: 0 10px;
    }
    
    /* Header Mobile Small Styles */
    .logo {
        font-size: 1rem;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .btn-hero {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}