* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Couleurs de base et police globale (sans accents pour eviter bugs encodage) */
body {
    background: #f5f6fa;
    color: #222;
}

header {
    background: #1e90ff;
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
}

nav a {
    color: #fff;
    margin-left: 15px;
    text-decoration: none;
    font-weight: 500;
}

nav a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.hero {
    background: #ffffff;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.hero h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.hero p {
    margin-bottom: 25px;
    font-size: 16px;
    color: #555;
}

.btn-primary {
    background: #1e90ff;
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

.btn-primary:hover {
    background: #1171c4;
}

.cards {
    margin-top: 30px;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    color: #555;
    font-size: 14px;
}

.section-header {
    margin-top: 30px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.link-inline {
    color: #1e90ff;
    font-weight: 600;
    text-decoration: none;
}

.link-inline:hover {
    text-decoration: underline;
}

.product-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #f0f2f5;
}

.product-card h3 {
    margin-bottom: 8px;
}

.product-card p {
    color: #555;
    font-size: 14px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
}

.price {
    font-weight: 700;
    color: #1e90ff;
}

.muted {
    color: #666;
    margin-top: 8px;
}

form {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

input[type="submit"],
button {
    background: #1e90ff;
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
}

input[type="submit"]:hover,
button:hover {
    background: #1171c4;
}

.error {
    background: #ffe5e5;
    color: #b30000;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.success {
    background: #e6ffed;
    color: #067d3b;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    font-size: 14px;
}

.table th {
    background: #f0f2f5;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: #e5f2ff;
    color: #1e90ff;
}

.profile-box {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 13px;
    color: #777;
}

/* Mise en page du catalogue : colonne gauche (filtres) + produits */

/* Bloc panier */
.cart-form {
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    margin-top: 16px;
}

.cart-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-row {
    display: grid;
    grid-template-columns: 1fr 120px 120px 120px 90px;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}

.cart-product {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cart-product img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.cart-price,
.cart-total {
    text-align: right;
    font-weight: 600;
    color: #1e293b;
}

.cart-qty input {
    width: 70px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #d7dce5;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
}

.cart-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-disabled {
    background: #ccc;
    border: 1px solid #ccc;
    color: #666;
    cursor: not-allowed;
    padding: 10px 12px;
    border-radius: 6px;
}

.stock {
    font-weight: 600;
    margin: 6px 0;
}

.stock-ok {
    color: #0c9b2c;
}

.stock-out {
    color: #b30000;
}

@media (max-width: 900px) {
    .cart-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .cart-price,
    .cart-total {
        text-align: left;
    }
    .cart-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .cart-summary {
        flex-wrap: wrap;
    }
}

.catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.btn-secondary {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #1e90ff;
    color: #1e90ff;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: #1e90ff;
    color: #fff;
}

.dashboard-cards {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 16px;
}

.dashboard-card {
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.dashboard-card h4 {
    margin-bottom: 6px;
}

.dashboard-card .metric {
    font-size: 24px;
    font-weight: 700;
}

.dashboard-card small {
    color: #6b7280;
}

.invoice-box {
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-top: 16px;
}

.invoice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 14px;
}

.invoice-grid .box {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
}

.inline-form {
    display: inline;
}

.catalog-hero {
    background: linear-gradient(135deg, #1e90ff 0%, #4db6ff 100%);
    color: #fff;
    border-radius: 12px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 6px 18px rgba(0, 129, 255, 0.15);
}

.catalog-hero h2 {
    font-size: 30px;
    margin-bottom: 8px;
}

.catalog-hero .muted {
    color: rgba(255,255,255,0.85);
}

.catalog-toolbar {
    margin-top: 18px;
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.toolbar-search {
    display: flex;
    flex: 0 0 360px;
    min-width: 280px;
    gap: 8px;
}

.toolbar-search input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d7dce5;
    border-radius: 8px;
}

.toolbar-search button {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: #1e90ff;
    color: #fff;
    font-weight: 600;
}

.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.filters-label {
    font-weight: 700;
    font-size: 13px;
    color: #1f2937;
    white-space: nowrap;
}

.filters-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d7dce5;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.15s ease;
    background: #f8fafc;
}

.chip:hover {
    border-color: #1e90ff;
    color: #1e90ff;
    background: #f0f6ff;
}

.chip-active {
    background: #1e90ff;
    color: #fff;
    border-color: #1e90ff;
    font-weight: 600;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eef2f7;
}

.price-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-block small {
    color: #6b7280;
}

.badge-light {
    background: #eef2ff;
    color: #1d4ed8;
}

.strong-blue {
    color: #1d4ed8;
    font-weight: 700;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.stock.badge-style {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.catalog-intro h2 {
    margin-bottom: 6px;
}

.catalog-intro .muted {
    margin-top: 4px;
}

.catalog-search {
    display: grid;
    grid-template-columns: 1fr 200px auto;
    gap: 8px;
    min-width: 320px;
}

.catalog-search select,
.catalog-search input[type="text"] {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d7dce5;
}

.catalog-search button {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: #1e90ff;
    color: #fff;
    font-weight: 600;
}

.category-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 18px;
    overflow: hidden;
}

.chips-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    padding-bottom: 4px;
    white-space: nowrap;
}

.new-catalog-grid {
    margin-top: 16px;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.new-catalog-grid .product-card-modern .btn-secondary {
    width: 120px;
    text-align: center;
}

@media (max-width: 900px) {
    .catalog-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }
    .toolbar-search {
        width: 100%;
        flex: 1 1 auto;
    }
    .filters-chips {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

@media (max-width: 900px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) and (min-width: 901px) {
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1500px) and (min-width: 1201px) {
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (min-width: 1501px) {
    .catalog-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Harmonisation catalogue avec page d'accueil */
.new-catalog-grid {
    margin-top: 16px;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.new-catalog-grid .product-card img {
    height: 200px;
    object-fit: contain;
}

.new-catalog-grid .product-card .btn-secondary {
    width: 120px;
    text-align: center;
}

.invoice-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
