/* ── Reset et base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f9;
    color: #1a1a2e;
    line-height: 1.6;
}

a { color: #2E75B6; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────── */
header {
    background: #1F3864;
    color: white;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

header h1 { font-size: 1.4rem; font-weight: 700; }
header h1 span { color: #BDD7EE; }

nav { display: flex; gap: 10px; flex-wrap: wrap; }
nav a {
    background: rgba(255,255,255,0.12);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    transition: background 0.2s;
}
nav a:hover { background: rgba(255,255,255,0.25); text-decoration: none; }
nav a.active { background: #2E75B6; }

main {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 24px;
}

footer-bar {
    display: block;
    text-align: center;
    padding: 20px;
    font-size: 0.82rem;
    color: #888;
    border-top: 1px solid #dde;
    margin-top: 48px;
}

/* ── Grille produits ─────────────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}

.card-body { padding: 20px; flex: 1; }
.card-body h2 { font-size: 1.05rem; margin-bottom: 8px; color: #1F3864; }
.card-body p  { font-size: 0.88rem; color: #555; margin-bottom: 14px; line-height: 1.5; }
.card-footer {
    padding: 14px 20px;
    background: #f8f9fc;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prix { font-size: 1.2rem; font-weight: 700; color: #1F3864; }
.stock { font-size: 0.82rem; color: #666; }
.stock.low { color: #C62828; font-weight: 600; }

.badge {
    display: inline-block;
    background: #DEEAF1;
    color: #1F3864;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    text-align: center;
}
.btn-primary { background: #2E75B6; color: white; }
.btn-primary:hover { background: #1F3864; text-decoration: none; }
.btn-sm { padding: 5px 14px; font-size: 0.82rem; }

/* ── Page détail produit ─────────────────────────────────────── */
.detail-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 36px;
    max-width: 640px;
}
.detail-card .categorie { color: #2E75B6; font-size: 0.9rem; margin-bottom: 8px; }
.detail-card h1 { font-size: 1.7rem; color: #1F3864; margin-bottom: 16px; }
.detail-card .description { color: #444; margin-bottom: 24px; line-height: 1.7; }
.detail-card .prix-detail { font-size: 2rem; font-weight: 700; color: #1F3864; }
.detail-card .stock-detail { font-size: 0.9rem; color: #666; margin-top: 6px; margin-bottom: 24px; }
.back-link { display: inline-block; margin-top: 20px; font-size: 0.9rem; }

/* ── Messages ────────────────────────────────────────────────── */
.empty {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 1.05rem;
}

.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.92rem;
}
.alert-error   { background: #FFEBEE; color: #C62828; border-left: 4px solid #C62828; }
.alert-success { background: #E8F5E9; color: #1B5E20; border-left: 4px solid #2E7D32; }
