:root {
    --primary: #FF5722;
    --secondary: #FF9800;
    --accent: #4CAF50;
    --background: #F5F5F5;
    --white: #FFFFFF;
    --black: #000000;
    --text-primary: #212121;
    --text-secondary: #9A9FA9;
    --success: #4CAF50;
    --error: #F44336;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container principal */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== */
/* NAVIGATION DESKTOP (en haut) */
/* ==================== */
.desktop-nav {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: none; /* Caché par défaut sur mobile */
}

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

.desktop-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-logo i {
    font-size: 1.8rem;
}

.desktop-nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.desktop-nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.desktop-nav-item:hover {
    color: var(--primary);
    background: rgba(255,87,34,0.1);
}

.desktop-nav-item.active {
    color: var(--primary);
    background: rgba(255,87,34,0.1);
}

.desktop-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ==================== */
/* NAVIGATION MOBILE (en bas) */
/* ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 8px 0;
}

.nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon i {
    font-size: 24px;
    transition: all 0.2s ease;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon i {
    transform: translateY(-2px);
}

.nav-item.active .nav-label {
    font-weight: 600;
}

/* Badges pour mobile */
.cart-badge, .messages-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--error);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Animation badges */
@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-badge:not(:empty), .messages-badge:not(:empty) {
    animation: badgePulse 0.5s ease;
}

/* Contenu principal */
.main-content {
    flex: 1;
    padding-bottom: 0;
}

/* ==================== */
/* RESPONSIVE */
/* ==================== */
@media (min-width: 769px) {
    /* Desktop: navigation en haut */
    .desktop-nav {
        display: block;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: 0;
    }
}

@media (max-width: 768px) {
    /* Mobile: navigation en bas */
    .desktop-nav {
        display: none;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    .main-content {
        padding-bottom: 65px;
    }
}

/* Pour les très petits mobiles */
@media (max-width: 480px) {
    .bottom-nav {
        height: 60px;
    }
    
    .nav-icon i {
        font-size: 22px;
    }
    
    .nav-label {
        font-size: 10px;
    }
    
    .main-content {
        padding-bottom: 60px;
    }
}

/* Pour les écrans larges desktop */
@media (min-width: 1200px) {
    .desktop-nav-container {
        padding: 0 4rem;
    }
}

/* ==================== */
/* STYLES EXISTANTS (compléments) */
/* ==================== */

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #e64a19;
    transform: translateY(-2px);
}

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

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

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0.5rem 0;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.product-actions .btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--background);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Trust Badges */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.trust-item {
    padding: 1.5rem;
    background: var(--white);
    border-radius: 12px;
}

.trust-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: #ffebee;
    color: var(--error);
    border: 1px solid var(--error);
}
/* ==================== */
/* BOUTONS AUTHENTIFICATION DESKTOP */
/* ==================== */
.desktop-auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.desktop-login-btn,
.desktop-register-btn {
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.desktop-login-btn {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.desktop-login-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

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

.desktop-register-btn:hover {
    background: #e64a19;
    transform: translateY(-2px);
}

/* Menu utilisateur connecté */
.user-menu {
    position: relative;
}

.user-menu-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s;
}

.user-menu-btn:hover {
    background: rgba(255,87,34,0.1);
}

.user-menu-btn i:first-child {
    font-size: 20px;
    color: var(--primary);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-dropdown a,
.user-menu-dropdown .logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
    border: none;
    background: white;
    cursor: pointer;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown .logout-btn:hover {
    background: #f5f5f5;
}

.user-menu-dropdown hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.user-menu-dropdown i {
    width: 20px;
    color: var(--primary);
}

.logout-btn {
    color: var(--error) !important;
}

.logout-btn i {
    color: var(--error) !important;
}

/* Responsive pour desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    .desktop-nav-links {
        gap: 1rem;
    }
    
    .desktop-nav-item {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .desktop-login-btn,
    .desktop-register-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .user-menu-btn span {
        display: none;
    }
}

/* Cache les boutons d'auth sur mobile (ils sont déjà cachés car .desktop-nav est hidden) */
@media (max-width: 768px) {
    .desktop-auth-buttons {
        display: none;
    }
}
/* Bouton déconnexion mobile */
#mobileLogoutBtn {
    color: var(--error);
}

#mobileLogoutBtn.active,
#mobileLogoutBtn:hover {
    color: var(--error);
}

#mobileLogoutBtn .nav-icon i {
    font-size: 22px;
}

/* Amélioration du dropdown utilisateur */
.user-menu-dropdown .logout-btn {
    color: var(--error) !important;
}

.user-menu-dropdown .logout-btn i {
    color: var(--error) !important;
}

.user-menu-dropdown .logout-btn:hover {
    background: #ffebee;
}

/* Animation pour le chargement */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
/* Styles supplémentaires pour l'affichage Alibaba */
.product-card {
    position: relative;
    transition: all 0.3s ease;
}

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

.product-image-container {
    position: relative;
    overflow: hidden;
    background: #fafafa;
}

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

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

.discount-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #FF5722;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
}

.verified-badge i {
    color: #4CAF50;
}

.category-item {
    position: relative;
}

.category-item::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #FF5722;
    transition: width 0.3s;
}

.category-item.active::after,
.category-item:hover::after {
    width: 80%;
}

/* Animation de chargement */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f6f6f6 0%, #f0f0f0 50%, #f6f6f6 100%);
    background-size: 1000px 100%;
}
