:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-alt: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    padding-top: 70px; /* Default for desktop */
}

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

/* Navigation */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.marketplace-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}

.search-bar {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    overflow: hidden;
    background: white;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    font-size: 1rem;
}

.category-select {
    padding: 0.75rem;
    border: none;
    border-left: 1px solid var(--border-color);
    background: white;
    outline: none;
    cursor: pointer;
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.signin-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

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

.signin-btn i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-action-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.8rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem;
}

.nav-action-link:hover {
    color: var(--primary-color);
}

.nav-action-link i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.action-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Mobile Filter Bar */
.mobile-filter-bar {
    display: none;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 999;
    gap: 0.5rem;
    height: 60px; /* Fixed height for consistent spacing */
    align-items: center;
}

.filter-btn {
    flex: 1;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly */
}

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

.filter-btn i {
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
}

/* Hero Banner */
.hero-banner {
    background: var(--gradient);
    color: white;
    padding: 3rem 0;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-features {
    display: flex;
    gap: 2rem;
}

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

.feature i {
    font-size: 1.2rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.world-map {
    max-width: 100%;
    height: auto;
    opacity: 0.8;
    filter: brightness(0) invert(1);
}

/* Featured Categories */
.featured-categories {
    padding: 4rem 0;
    background: white;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    padding: 2rem 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

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

.category-icon i {
    font-size: 1.5rem;
    color: white;
}

.category-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Trending Section */
.trending-section {
    padding: 4rem 0;
    background: var(--bg-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.see-all-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

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

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.product-badge:not(.sale):not(.new) {
    background: var(--danger-color);
}

.product-badge.sale {
    background: var(--warning-color);
}

.product-badge.new {
    background: var(--success-color);
}

.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.product-info {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stars {
    color: var(--warning-color);
}

.rating-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

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

.product-shipping {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-color);
    font-size: 0.9rem;
}

/* Daily Deals */
.daily-deals {
    padding: 4rem 0;
    background: white;
}

.deals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.countdown {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
}

.countdown-timer {
    display: flex;
    gap: 0.5rem;
}

.time-unit {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    min-width: 50px;
}

.time-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
}

.time-label {
    font-size: 0.7rem;
}

.deals-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
}

.deal-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
}

.deal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.featured-deal {
    grid-row: span 2;
}

.deal-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 2;
}

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

.featured-deal .deal-image img {
    height: 300px;
}

.deal-info {
    padding: 1.5rem;
}

.deal-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.deal-pricing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.deal-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--danger-color);
}

.deal-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Selling Section */
.selling-section {
    padding: 4rem 0;
    background: var(--gradient);
    color: white;
}

.selling-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.selling-info h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.selling-info p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.selling-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.selling-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selling-feature i {
    font-size: 1.2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.selling-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat p {
    opacity: 0.9;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

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

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    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: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    /* Hide hero banner on mobile */
    .hero-banner {
        display: none !important;
    }
    
    /* Show mobile filter bar */
    .mobile-filter-bar {
        display: flex !important;
        top: 120px; /* Position below taller mobile header */
    }
    
    /* Body adjustments for mobile header + filter bar */
    body {
        padding-top: 180px; /* Header (120px) + filter bar (60px) */
    }
    
    /* Compact header for tablet */
    .nav-container {
        padding: 5px 1rem;
        height: 120px; /* Fixed height to accommodate wrapped search */
        flex-wrap: wrap;
        gap: 0.5rem;
        align-content: flex-start;
    }
    
    .logo-img {
        height: 30px;
    }
    
    .marketplace-label {
        font-size: 18px;
    }
    
    .search-container {
        margin: 0;
        width: 100%;
        order: 2;
        margin-top: 0.5rem;
    }
    
    .search-input {
        padding: 6px 1rem;
        font-size: 12px;
    }
    
    .search-btn {
        padding: 6px 1rem;
    }
    
    .search-btn i {
        font-size: 14px;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .nav-action-link i,
    .signin-btn i {
        font-size: 16px;
    }
    
    .signin-btn span,
    .nav-action-link span:not(.action-count) {
        display: none;
    }
    
    /* Product-first ordering */
    .more-to-love {
        order: 1;
    }
    
    .todays-deals {
        order: 2;
    }
    
    .featured-categories {
        order: 3;
    }
    
    .selling-section {
        order: 4;
    }
    
    /* 2-column product grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    /* Compact product cards */
    .product-card {
        padding: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .product-image img {
        height: 120px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-title {
        font-size: 12px;
        line-height: 1.2;
        margin-bottom: 0.25rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .original-price {
        font-size: 10px;
    }
    
    .product-rating {
        margin-bottom: 0.25rem;
    }
    
    .stars {
        font-size: 0.8rem;
    }
    
    .rating-count {
        font-size: 0.7rem;
    }
    
    .product-shipping {
        font-size: 0.7rem;
    }
    
    /* Compact deals grid */
    .deals-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .deal-info {
        padding: 15px;
    }
    
    /* Minimize sections */
    .trending-section,
    .daily-deals,
    .featured-categories,
    .selling-section {
        padding: 20px 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Compact categories - 3 columns */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .category-card {
        padding: 1rem 0.5rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto 0.5rem;
    }
    
    .category-card h3 {
        font-size: 12px;
        margin-bottom: 0.25rem;
    }
    
    .category-card p {
        font-size: 0.7rem;
    }
    
    /* Selling section minimized */
    .selling-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .selling-info h2 {
        font-size: 18px;
    }
    
    .selling-info p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .selling-stats {
        display: none; /* Hide stats on mobile */
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .deals-header {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .countdown-timer {
        gap: 0.25rem;
    }
    
    .time-unit {
        padding: 0.25rem;
        min-width: 40px;
    }
    
    .time-value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    /* Small mobile adjustments - header + filter bar */
    body {
        padding-top: 160px; /* Header (100px) + filter bar (60px) */
    }
    
    .nav-container {
        padding: 3px 0.5rem;
        height: 100px; /* Smaller header height for small mobile but still accommodates search */
    }
    
    .logo-img {
        height: 25px;
    }
    
    .marketplace-label {
        font-size: 16px;
    }
    
    /* Adjust filter bar position for smaller header */
    .mobile-filter-bar {
        top: 100px;
    }
    
    .search-input {
        padding: 4px 0.75rem;
        font-size: 11px;
    }
    
    .search-btn {
        padding: 4px 0.75rem;
    }
    
    .search-btn i {
        font-size: 13px;
    }
    
    .nav-action-link i,
    .signin-btn i {
        font-size: 15px;
    }
    
    .action-count {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
} 