@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
    /* Premium Color Palette - Precise Specs */
    --primary: #1A5C38;
    --primary-light: #2A7A4D;
    --primary-dark: #124027;
    --secondary: #C8A951;
    --secondary-light: #DBC078;
    --secondary-dark: #B3923D;
    
    --accent: #E8F0EA;
    --bg: #FFFFFF;
    --bg-soft: #F3F4F6;
    --surface: #FFFFFF;
    
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);

    --text-main: #1A1A1A;
    --text-muted: #666666;
    --text-on-primary: #FFFFFF;

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    /* Spacing: 4px Base Grid */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Premium Shadows & Radius */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-soft);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Hierarchy - Specific Scales */
.wordmark {
    font-family: 'DM Serif Display', serif;
}

h1, h2, h3, h4, .display {
    font-family: 'Inter', sans-serif; /* Per request for UI text */
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.display {
    font-size: 48px;
    font-weight: 700;
}

h1 {
    font-size: 32px;
    font-weight: 700;
}

h2 {
    font-size: 22px;
    font-weight: 600;
}

h3 {
    font-size: 16px;
    font-weight: 600;
}

.body-lg {
    font-size: 18px;
    font-weight: 400;
}

.body {
    font-size: 16px;
    font-weight: 400;
}

.small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

.label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.body-lg {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
}

.small {
    font-size: 14px;
    color: var(--text-muted);
}

/* Layout Containers */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.section-padding {
    padding: var(--space-20) 0;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-8);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Components: Buttons - Standardized Sizes */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1.5px solid transparent;
    text-decoration: none;
    gap: var(--space-2);
    padding: 0 var(--space-6);
    height: 40px; /* Default height for safety */
}

.btn-sm { height: 32px; font-size: 13px; }
.btn-md { height: 40px; }
.btn-lg { height: 52px; font-size: 16px; }

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

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-gold {
    background-color: var(--secondary);
    color: var(--primary-dark);
}

.btn-gold:hover {
    background-color: var(--secondary-light);
}

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

/* Form Inputs - Precise Specs */
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    font-size: 16px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-smooth);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 92, 56, 0.15);
}

/* Icon Standardization */
.icon-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Components: Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: var(--border);
}

.card-img-wrapper {
    position: relative;
    padding-top: 125%;
    /* 4:5 aspect ratio for premium look */
    overflow: hidden;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-content {
    padding: var(--space-6);
}

.card-tag {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}


/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: var(--transition-smooth);
    padding: var(--space-4) 0;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: var(--space-3) 0;
    box-shadow: var(--shadow-soft);
    border-bottom: 1px solid var(--border-light);
}

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

.nav-links {
    display: flex;
    gap: var(--space-8);
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition-smooth);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    font-family: 'DM Serif Display', serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary-dark);
}

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

/* Design System: Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
}

.badge-verified {
    background: #DCF2E8;
    color: #1A5C38;
    border: 1px solid rgba(26, 92, 56, 0.1);
}

.badge-new {
    background: #1A5C38;
    color: white;
}

.badge-rated {
    background: #FFF7E6;
    color: #B3923D;
    border: 1px solid rgba(179, 146, 61, 0.1);
}

.badge-available {
    background: #E6F4FF;
    color: #0066CC;
    border: 1px solid rgba(0, 102, 204, 0.1);
}

.badge-pending {
    background: #FFFBE6;
    color: #856404;
    border: 1px solid #FFE58F;
}

.badge-cancelled {
    background: #FFF1F0;
    color: #A8071A;
    border: 1px solid #FFA39E;
}

/* Design System: Icons */
.icon-container {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--primary);
}

.icon-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
}

.lang-btn {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    background: transparent;
    color: var(--text-muted);
}

.lang-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* West Africa Market Badges */
.market-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: white;
    border: 1px solid var(--border-light);
    margin-right: var(--space-2);
}

.flag-icon {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}


/* Hero Section */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 120px; /* Enhanced breathing room from fixed nav */
    background-color: var(--accent);
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    background: rgba(26, 92, 56, 0.08);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: var(--space-6);
}

.hero-search-wrapper {
    margin-top: var(--space-12);
    background: var(--surface);
    padding: var(--space-2);
    border-radius: var(--radius-full);
    display: flex;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-light);
    max-width: 700px;
}

.hero-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 var(--space-6);
    font-size: 16px;
    outline: none;
}

/* Footer Styling */
footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.9);
    padding: var(--space-20) 0 var(--space-10);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: var(--space-6);
}

.footer-logo img {
    height: 48px;
    filter: brightness(0) invert(1);
}

.footer-heading {
    color: white;
    font-size: 16px;
    margin-bottom: var(--space-6);
    font-weight: 600;
}

.footer-link {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    margin-bottom: var(--space-3);
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: var(--secondary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {

    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .hero {
        text-align: center;
    }

    .hero-search-wrapper {
        flex-direction: column;
        border-radius: var(--radius-md);
        padding: var(--space-4);
    }

    .hero-search-input {
        padding: var(--space-4) 0;
        text-align: center;
    }

    .nav-links {
        display: none;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* Marketplace Specific Styles */
.marketplace-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-12);
}

.filter-section {
    position: sticky;
    top: 100px;
}

.filter-group {
    margin-bottom: var(--space-8);
}

.filter-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
    color: var(--text-main);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    cursor: pointer;
    font-size: 15px;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.filter-item:hover {
    color: var(--primary);
}

.product-card {
    background: transparent;
    transition: var(--transition-smooth);
}

.product-card .card-img-wrapper {
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.product-card:hover .card-img-wrapper {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-soft);
}

/* Modal & Order Flow */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    box-shadow: var(--shadow-premium);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-light);
}

.order-step {
    display: none;
}

.order-step.active {
    display: block;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
}

.step-dot {
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    transition: var(--transition-smooth);
}

.step-dot.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* Dashboard Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-soft);
}

.admin-sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0c2b1a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: var(--space-8) var(--space-6);
    display: flex;
    flex-direction: column;
    z-index: 1100;
}

.admin-sidebar .nav-logo img {
    filter: brightness(0) invert(1);
    height: 40px;
}

.admin-main {
    flex: 1;
    margin-left: 280px;
    padding: var(--space-8) var(--space-12);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link .icon-svg {
    color: rgba(255, 255, 255, 0.68);
}

.sidebar-link.active .icon-svg {
    color: #f8f0c9;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-12);
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(32, 59, 52, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(4, 22, 15, 0.04);
}

/* Mobile Responsive Refinements */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 80px;
        padding: var(--space-8) var(--space-2);
    }
    .sidebar-link span { display: none; }
    .admin-main { margin-left: 80px; padding: var(--space-8); }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0 var(--space-4);
        border-right: none;
        border-top: 1px solid var(--border-light);
        justify-content: space-around;
        z-index: 2000;
        background: white;
    }
    .admin-sidebar .nav-logo, 
    .admin-sidebar div:last-child { display: none; }
    .sidebar-nav {
        flex-direction: row;
        margin-top: 0;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }
    .sidebar-link {
        flex-direction: column;
        gap: var(--space-1);
        font-size: 10px;
        padding: var(--space-2);
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    .sidebar-link .icon-svg { width: 22px; height: 22px; }
    .sidebar-link span { display: block; }
    
    .admin-main {
        margin-left: 0;
        padding: var(--space-6) var(--space-4) 90px var(--space-4);
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
    .admin-header div:last-child {
        width: 100%;
        display: flex !important;
        justify-content: space-between;
        background: white;
        padding: var(--space-3);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
    }
    
    .stats-grid { grid-template-columns: 1fr !important; }
    .grid { grid-template-columns: 1fr !important; }
}

/* Page Hero & Integrated Search */
.page-hero {
    padding: var(--space-20) 0 var(--space-16);
    margin-top: 80px; /* Offset for fixed header */
    background-color: var(--primary-dark);
    position: relative;
    overflow: hidden;
    color: white;
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    z-index: 1;
}

.page-hero .container {
    position: relative;
    z-index: 2;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(18, 64, 39, 0.4), rgba(18, 64, 39, 0.8));
    z-index: 1;
}

.hero-search-container {
    max-width: 800px;
    margin: var(--space-12) auto 0;
    width: 100%;
    padding: 0 var(--space-8);
}

.search-box {
    background: white;
    padding: var(--space-2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
    transition: var(--transition-smooth);
}

.search-box:focus-within {
    box-shadow: 0 15px 50px rgba(26, 92, 56, 0.1);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    border: none;
    padding: var(--space-4) var(--space-8);
    font-size: 16px;
    outline: none;
    color: var(--text-main);
    background: transparent;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .page-hero { padding: var(--space-16) 0 var(--space-10); }
    .hero-search-container { padding: 0 var(--space-4); margin-top: var(--space-8); }
    .search-input { padding: var(--space-3) var(--space-4); font-size: 14px; }
    .search-btn { width: 44px; height: 44px; }
}