:root {
    --primary: #8B4513; /* Marron */
    --accent: #F4A460;  /* Orange/Doré */
    --bg: #F5F5F5;      /* Gris clair fond */
    --white: #FFFFFF;
    --text: #333333;
    --border: #DDDDDD;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    margin: 0;
    color: var(--text);
    font-size: 16px; /* Taille de base lisible */
}

/* --- Layout de base --- */
.app-view {
    display: none; /* Caché */
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg);
    padding-bottom: 80px; /* Place pour le menu bas */
}
.app-view.active { display: block; } /* Affiché */

.center-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* --- Composants Formulaire (SOLIDE) --- */
.logo-container { margin-bottom: 20px; text-align: center; }
.main-logo { width: 150px; height: auto; display: block; margin: 0 auto; }

.form-box {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.form-title { margin: 0 0 10px 0; color: var(--primary); font-size: 1.5rem; text-align: center; }
.form-subtitle { text-align: center; color: #666; margin-bottom: 20px; font-size: 0.9rem; }

.input-wrapper { margin-bottom: 15px; }
.input-wrapper label { display: block; margin-bottom: 5px; font-size: 0.9rem; font-weight: 500; color: #555; }

.std-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: #FAFAFA;
    outline: none;
}
.std-input:focus { border-color: var(--primary); background: #FFF; }

.password-row { position: relative; }
.password-row input { width: 100%; padding-right: 40px; } /* Place pour l'oeil */
.password-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 1.2rem; cursor: pointer; opacity: 0.6;
}

.main-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(139, 69, 19, 0.2);
}
.main-btn:active { transform: scale(0.98); }
.main-btn.outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); box-shadow: none; }

.form-links { text-align: center; margin-top: 20px; font-size: 0.9rem; }
.form-links a { color: var(--primary); text-decoration: none; }
.bold-link { font-weight: 700; }

/* --- Header App --- */
.app-header {
    background: var(--white);
    padding: 15px 20px;
    position: sticky; top: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.app-header.simple { justify-content: space-between; } /* Pour centrer le titre avec spacer */

.header-left { display: flex; align-items: center; gap: 10px; }
.profile-icon {
    width: 40px; height: 40px; background: #F0F0F0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer; border: 2px solid var(--primary);
}
.header-text { display: flex; flex-direction: column; }
.greeting { font-size: 0.8rem; color: #777; }
.username { font-weight: 700; color: var(--primary); font-size: 1rem; }

.icon-btn { background: none; border: none; font-size: 1.5rem; position: relative; cursor: pointer; }
.back-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.dot { width: 10px; height: 10px; background: red; border-radius: 50%; position: absolute; top: 5px; right: 0; display: none; border: 2px solid white; }

/* --- Contenu Scrollable --- */
.content-scroll { padding: 15px 20px; }

/* Bannière & Recherche */
.banner-container {
    width: 100%; height: 150px; border-radius: 15px; overflow: hidden;
    position: relative; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.banner-img { width: 100%; height: 100%; object-fit: cover; }
.banner-overlay {
    position: absolute; bottom: 0; width: 100%; padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white; font-weight: bold;
}

.search-box {
    position: relative; margin-bottom: 15px;
}
.search-icon { position: absolute; left: 15px; top: 12px; color: #999; }
.search-field {
    width: 100%; padding: 12px 15px 12px 40px;
    border-radius: 25px; border: none; background: #FFF;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); font-size: 1rem;
}

/* Filtres */
.filters-scroll {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 15px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.filters-scroll::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome */

.filter-chip {
    padding: 8px 16px; border-radius: 20px; border: none;
    background: #FFF; color: #555; font-weight: 600; white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); cursor: pointer; transition: 0.2s;
}
.filter-chip.active { background: var(--primary); color: white; }

/* Grille Produits */
.product-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
}
.product-card {
    background: white; border-radius: 15px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: relative;
}
.product-card img { width: 100%; height: 110px; object-fit: cover; background: #eee; }
.placeholder-img { width: 100%; height: 110px; background: #eee; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #ccc; }

.card-info { padding: 10px; }
.card-info h3 { margin: 0 0 5px 0; font-size: 0.9rem; color: var(--text); }
.price { font-weight: bold; color: var(--primary); }
.add-btn {
    position: absolute; bottom: 10px; right: 10px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: white; border: none;
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); cursor: pointer;
}

/* --- Menu Bas (Tab Bar) --- */
.tab-bar {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 70px;
    background: white; border-top-left-radius: 20px; border-top-right-radius: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 200;
}
.tab-item { background: none; border: none; font-size: 1.5rem; cursor: pointer; position: relative; opacity: 0.5; }
.tab-item.active { opacity: 1; transform: scale(1.1); }
.big-cart { 
    background: var(--primary); color: white; width: 60px; height: 60px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    transform: translateY(-20px); box-shadow: 0 4px 10px rgba(139,69,19,0.3); opacity: 1;
}
.cart-badge {
    position: absolute; top: 0; right: 0; background: red; color: white;
    font-size: 0.7rem; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--primary);
}

/* --- Panier & Autres --- */
.info-card { background: white; padding: 15px; border-radius: 15px; margin-bottom: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.cart-item { display: flex; align-items: center; background: white; padding: 10px; border-radius: 15px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.cart-item img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; margin-right: 15px; }
.item-details { flex: 1; }
.item-details h4 { margin: 0; font-size: 0.95rem; }
.item-price { color: var(--primary); font-weight: bold; font-size: 0.9rem; }
.qty-controls { display: flex; gap: 10px; align-items: center; }
.qty-circle { width: 25px; height: 25px; background: #f0f0f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; }

.bottom-checkout {
    position: fixed; bottom: 0; width: 100%; background: white; padding: 20px;
    border-top-left-radius: 20px; border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05); z-index: 300;
}
.total-row { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.2rem; margin-bottom: 15px; }
.checkout-btn { margin: 0; }

/* Profil */
.profile-header { text-align: center; margin-bottom: 20px; }
.avatar-big { width: 80px; height: 80px; background: var(--secondary); color: white; font-size: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-weight: bold; }
.menu-row { width: 100%; padding: 15px; background: white; border: none; border-radius: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; font-size: 1rem; box-shadow: 0 2px 5px rgba(0,0,0,0.05); cursor: pointer; }
.menu-row.logout { color: red; font-weight: bold; justify-content: center; background: #FFF0F0; }

/* Notif */
.notif-card { background: white; padding: 15px; border-radius: 15px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border-left: 4px solid var(--primary); }
.notif-new { background: #FFFBF0; }

/* Toast */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; width: 80%; }
.toast { background: #333; color: white; padding: 10px 20px; border-radius: 20px; text-align: center; margin-bottom: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); animation: fadeIn 0.3s; }