:root {
    /* Palette de couleurs (Thème Santé/Nature) */
    --primary-color: #2c7a7b; /* Teal */
    --primary-dark: #234e52;
    --secondary-color: #f6ad55; /* Orange doux pour les CTA */
    --secondary-dark: #dd6b20;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --danger-color: #e53e3e;
    --success-color: #48bb78;

    /* Espacements & Dimensions */
    --container-width: 1200px;
    --header-height: 70px;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Typographie */
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

main { flex: 1; padding: 40px 0; }

/* --- TYPOGRAPHY --- */
h1, h2, h3 { color: var(--primary-dark); margin-bottom: 1rem; line-height: 1.2; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
p { margin-bottom: 1rem; }

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

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

.btn-success { background-color: var(--secondary-color); color: var(--white); }
.btn-success:hover { background-color: var(--secondary-dark); }

.btn-outline { border: 2px solid var(--primary-color); color: var(--primary-color); background: transparent; }
.btn-outline:hover { background-color: var(--primary-color); color: var(--white); }

.btn-block { display: block; width: 100%; }

/* --- HEADER & NAV --- */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-brand img { height: 40px; }

.nav-menu { display: flex; gap: 30px; align-items: center; }
.nav-link { font-weight: 500; color: var(--text-color); position: relative; }
.nav-link:hover { color: var(--primary-color); }
.nav-link.active { color: var(--primary-color); font-weight: 700; }

.nav-icons { display: flex; gap: 20px; align-items: center; }
.nav-icon { font-size: 1.2rem; color: var(--text-color); position: relative; }
.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Mobile Menu Button */
.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; }

/* --- HERO SECTION (Homepage) --- */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 80px 0;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 60px;
}
.hero h1 { color: white; margin-bottom: 20px; }
.hero p { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; }

/* --- PRODUCT CARDS --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.product-image {
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.product-image img { height: 100%; width: auto; object-fit: contain; }

.product-info { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.product-category { font-size: 0.85rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.product-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
.product-title a:hover { color: var(--primary-color); }
.product-price { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); margin-top: auto; margin-bottom: 15px; }

/* --- PRODUCT DETAIL --- */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.product-gallery-main {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.pd-price { font-size: 2.5rem; color: var(--primary-color); font-weight: 700; margin: 20px 0; }
.pd-meta { color: var(--text-light); font-size: 0.9rem; margin-bottom: 20px; }

.add-to-cart-form {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    align-items: center;
}
.qty-input {
    width: 80px;
    padding: 10px;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
}

/* --- CART --- */
.cart-container { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-table th { background: var(--bg-light); text-align: left; padding: 15px; font-weight: 600; }
.cart-table td { padding: 15px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.cart-product-thumb { display: flex; align-items: center; gap: 15px; }
.cart-summary {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 1.1rem; }
.summary-total { border-top: 2px solid var(--border-color); padding-top: 20px; margin-top: 20px; font-weight: 700; font-size: 1.5rem; color: var(--primary-dark); }

/* --- FORMS (Login, etc) --- */
.auth-card {
    max-width: 450px;
    margin: 40px auto;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}
.form-control:focus { outline: none; border-color: var(--primary-color); }

/* --- ALERTS --- */
.alert {
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-success { background-color: #c6f6d5; color: #2f855a; border: 1px solid #9ae6b4; }
.alert-danger { background-color: #fed7d7; color: #c53030; border: 1px solid #feb2b2; }

/* --- FOOTER --- */
footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 60px 0 30px;
    margin-top: auto;
}
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: var(--white); margin-bottom: 20px; font-size: 1.2rem; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { opacity: 0.8; }
.footer-col ul li a:hover { opacity: 1; text-decoration: underline; }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 0.9rem; opacity: 0.6; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .nav-menu.active { display: flex; }
    
    .product-detail-container { grid-template-columns: 1fr; }
    .cart-container { grid-template-columns: 1fr; }
    
    /* Table responsive pour le panier */
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table tr { margin-bottom: 20px; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 10px; }
    .cart-table td { text-align: right; padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
    .cart-table td::before { content: attr(data-label); font-weight: 600; text-align: left; }
}

/* --- TOAST NOTIFICATION (Panier) --- */
#cart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--primary-dark);
    color: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 20px;
    
    /* Animation */
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#cart-toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-content i {
    font-size: 1.5rem;
    color: var(--success-color);
}

.toast-content strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.toast-content p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.toast-total {
    font-weight: bold;
    margin-top: 2px;
    color: var(--secondary-color);
}

#cart-toast .btn {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

#cart-toast .btn:hover {
    background: white;
    color: var(--primary-dark);
}

/* --- BADGES STATUT COMMANDE --- */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-success {
    background-color: #c6f6d5;
    color: #22543d;
}

.status-warning {
    background-color: #feebc8;
    color: #744210;
}

.status-danger {
    background-color: #fed7d7;
    color: #742a2a;
}

.status-info {
    background-color: #bee3f8;
    color: #2a4365;
}