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

body{
    font-family:Arial,Helvetica,sans-serif;
    background:#f5f5f5;
    color:#222;
}

.top-header{

    position:sticky;
    top:0;
    z-index:1000;

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:15px;

    padding:10px 15px;

    background:#ffffff;

    box-shadow:0 2px 8px rgba(0,0,0,.08);

}

.logo h1{

    color:#d60000;

    font-size:28px;

    font-weight:bold;

    white-space:nowrap;
}

.cat-icon{
    width:32px;
    height:32px;
    object-fit:contain;
}
.search-box{

    flex:1;

    display:flex;

    justify-content:center;

}

.search-box input{

    width:100%;

    max-width:650px;

    padding:11px 18px;

    border:2px solid #d60000;

    border-radius:25px;

    outline:none;

    font-size:16px;

}

.search-box input:focus{

    border-color:#ff0000;

}

.cart-box a{

    position:relative;

    text-decoration:none;

    color:#d60000;

    font-size:28px;

}

#cartCount{

    position:absolute;

    top:-8px;

    right:-10px;

    background:red;

    color:white;

    border-radius:50%;

    width:20px;

    height:20px;

    font-size:12px;

    display:flex;

    align-items:center;

    justify-content:center;

}
#categories{
    display:flex;
    flex-direction:row;
    gap:10px;
    align-items:center;
}
.categories-bar{

    display:flex;

    align-items:center;

    gap:10px;

    overflow-x:auto;

    white-space:nowrap;

    padding:8px 12px;

    background:#ffffff;

    border-bottom:1px solid #ddd;

}

.categories-bar::-webkit-scrollbar{

    height:5px;

}

.category-btn{

    display:flex;

    align-items:center;

    gap:6px;

    padding:8px 14px;

    border:none;

    border-radius:20px;

    background:#f2f2f2;

    cursor:pointer;

    color:#d60000;

    font-weight:bold;

    font-size:15px;

    transition:.3s;

}

.category-btn:hover{

    background:#d60000;

    color:#ffffff;

}

.category-btn.active{

    background:#d60000;

    color:white;

}

.cat-icon{

    width:22px;

    height:22px;

    object-fit:contain;

}


.subcategories-bar{

    display:flex;

    gap:8px;

    overflow-x:auto;

    white-space:nowrap;

    padding:8px 12px;

    background:#fafafa;

    border-bottom:1px solid #ddd;

}

.subcategory-btn{

    padding:7px 14px;

    border:none;

    border-radius:18px;

    background:white;

    color:#444;

    cursor:pointer;

    font-size:14px;

    transition:.3s;

}

.subcategory-btn:hover{

    background:#d60000;

    color:white;

}
.products-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px;
    padding:20px;
}


.card{

    background:#ffffff;

    border-radius:12px;

    overflow:hidden;

    box-shadow:0 2px 10px rgba(0,0,0,.08);

    transition:.3s;

}

.card:hover{

    transform:translateY(-4px);

    box-shadow:0 8px 20px rgba(0,0,0,.15);

}

.card img{
    width:300px;
    height:400px;
    object-fit:contain;
    display:block;
    margin:10px auto;
}


.card-content{

    padding:15px;

}

.product-id{

    font-size:12px;

    color:#888;

    margin-bottom:4px;

}

.product-code{

    color:#d60000;

    font-weight:bold;

    font-size:13px;

    margin-bottom:8px;

}
.card-content h3{

    font-size:18px;

    margin-bottom:8px;

    color:#222;

}

.card-content p{

    color:#666;

    font-size:14px;

    min-height:45px;

    margin-bottom:10px;

}

.price{

    font-size:22px;

    font-weight:bold;

    color:#d60000;

    margin-bottom:8px;

}

.stock{

    font-size:14px;

    color:#008000;

    margin-bottom:12px;

}


.card button{

    width:100%;

    border:none;

    background:#d60000;

    color:white;

    padding:12px;

    border-radius:8px;

    cursor:pointer;

    font-size:16px;

    font-weight:bold;

    transition:.3s;

}

.card button:hover{

    background:#b40000;

}

/* ==========================
   Checkout
========================== */

.checkout-product{
    max-width:400px;
    margin:20px auto;
    text-align:center;
    background:#fff;
    padding:20px;
    border-radius:10px;
    box-shadow:0 2px 10px rgba(0,0,0,.1);
}

.checkout-product image{
    width:250px;
    border-radius:10px;
    margin-bottom:20px;
}

#checkoutForm{
    max-width:600px;
    margin:30px auto;
    background:#fff;
    padding:25px;
    border-radius:10px;
    box-shadow:0 2px 10px rgba(0,0,0,.1);
}

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

.form-group label{
    display:block;
    font-weight:bold;
    margin-bottom:8px;
}

.form-group input,
.form-group textarea{
    width:100%;
    padding:12px;
    font-size:16px;
    border:1px solid #ccc;
    border-radius:8px;
    box-sizing:border-box;
}

.form-group textarea{
    height:90px;
    resize:none;
}

h3{
    text-align:center;
    margin:25px 0;
    color:#e53935;
}

button{
    padding:12px 20px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-size:16px;
    margin-right:10px;
}

button[type="submit"]{
    background:#28a745;
    color:#fff;
}

button[type="button"]{
    background:#dc3545;
    color:#fff;
}
/* =======================================
   TOTAL
======================================= */

.total-box{

    margin-top:20px;

    padding:15px;

    background:#f8f8f8;

    border-radius:10px;

    text-align:center;

}

.total-box h2{

    color:#d60000;

    font-size:28px;

}

/* =======================================
   BOUTON COMMANDER
======================================= */

.checkout-form button{

    background:#d60000;

    color:white;

    border:none;

    padding:14px;

    border-radius:8px;

    font-size:18px;

    cursor:pointer;

    transition:.3s;

}

.checkout-form button:hover{

    background:#b30000;

}

/* =======================================
   BOUTON RETOUR
======================================= */

.back-btn{

    display:inline-block;

    margin-top:15px;

    text-decoration:none;

    color:#d60000;

    font-weight:bold;

}
/* =======================================
   DASHBOARD
======================================= */

.container{

    width:95%;

    max-width:1400px;

    margin:20px auto;

}

/* =======================================
   CARTES STATISTIQUES
======================================= */

.dashboard-cards{

    display:grid;

    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));

    gap:20px;

    margin-bottom:30px;

}

.dashboard-card{

    background:#ffffff;

    border-radius:12px;

    padding:20px;

    text-align:center;

    box-shadow:0 3px 10px rgba(0,0,0,.08);

}

.dashboard-card h3{

    color:#666;

    font-size:18px;

    margin-bottom:10px;

}

.dashboard-card h1{

    color:#d60000;

    font-size:34px;

}

/* =======================================
   BARRE OUTILS
======================================= */

.dashboard-tools{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:15px;

    margin-bottom:20px;

    flex-wrap:wrap;

}

.dashboard-tools input{

    flex:1;

    min-width:250px;

    padding:12px;

    border:2px solid #d60000;

    border-radius:8px;

    font-size:15px;

}

.dashboard-tools button{

    padding:12px 18px;

    border:none;

    border-radius:8px;

    background:#d60000;

    color:white;

    cursor:pointer;

    font-weight:bold;

}

.dashboard-tools button:hover{

    background:#b40000;

}

/* =======================================
   TABLEAU
======================================= */

table{

    width:100%;

    border-collapse:collapse;

    background:white;

    border-radius:12px;

    overflow:hidden;

    box-shadow:0 3px 10px rgba(0,0,0,.08);

}

thead{

    background:#d60000;

    color:white;

}

th{

    padding:14px;

    text-align:center;

}

td{

    padding:12px;

    text-align:center;

    border-bottom:1px solid #eeeeee;

}

tbody tr:hover{

    background:#f8f8f8;

}

/* =======================================
   SELECT STATUT
======================================= */

table select{

    padding:6px;

    border-radius:6px;

    border:1px solid #cccccc;

}

/* =======================================
   BOUTONS
======================================= */

table button{

    margin:2px;

    padding:7px 12px;

    border:none;

    border-radius:6px;

    cursor:pointer;

    background:#d60000;

    color:white;

    font-size:13px;

}

table button:hover{

    background:#b30000;

}

/* =======================================
   RESPONSIVE TABLE
======================================= */

.table-responsive{

    overflow-x:auto;

}
/* =======================================
   ADMINISTRATION
======================================= */

.admin-header{

    background:#d60000;

    color:white;

    padding:15px 25px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    flex-wrap:wrap;

}

.admin-header h1{

    font-size:28px;

}

.admin-header nav{

    display:flex;

    gap:15px;

    flex-wrap:wrap;

}

.admin-header nav a{

    color:white;

    text-decoration:none;

    font-weight:bold;

}

.admin-header nav a:hover{

    text-decoration:underline;

}

/* =======================================
   FORMULAIRES
======================================= */

form{

    background:white;

    padding:20px;

    border-radius:12px;

    box-shadow:0 3px 10px rgba(0,0,0,.08);

    margin-bottom:25px;

}

.form-group{

    margin-bottom:18px;

}

.form-group label{

    display:block;

    font-weight:bold;

    margin-bottom:8px;

}

.form-group input,

.form-group textarea,

.form-group select{

    width:100%;

    padding:12px;

    border:1px solid #cccccc;

    border-radius:8px;

    font-size:15px;

}

.form-group textarea{

    resize:vertical;

}

.form-group input:focus,

.form-group textarea:focus,

.form-group select:focus{

    border-color:#d60000;

    outline:none;

}

/* =======================================
   APERÇU IMAGE
======================================= */

#preview{

    max-width:180px;

    max-height:180px;

    border-radius:10px;

    border:1px solid #dddddd;

    object-fit:cover;

    margin-top:10px;

}

/* =======================================
   BOUTONS
======================================= */

.btn-save,

button[type="submit"]{

    background:#d60000;

    color:white;

    border:none;

    padding:12px 25px;

    border-radius:8px;

    cursor:pointer;

    font-size:16px;

    font-weight:bold;

}

.btn-save:hover,

button[type="submit"]:hover{

    background:#b30000;

}

/* =======================================
   TABLEAUX ADMIN
======================================= */

table{

    width:100%;

    border-collapse:collapse;

    background:white;

    border-radius:10px;

    overflow:hidden;

    box-shadow:0 3px 10px rgba(0,0,0,.08);

}

table img{

    width:60px;

    height:60px;

    object-fit:cover;

    border-radius:8px;

}

th{

    background:#d60000;

    color:white;

    padding:12px;

}

td{

    padding:10px;

    text-align:center;

    border-bottom:1px solid #eeeeee;

}

tbody tr:hover{

    background:#fafafa;

}

/* =======================================
   ACTIONS
======================================= */

table button{

    padding:8px 12px;

    margin:2px;

    border:none;

    border-radius:6px;

    cursor:pointer;

    color:white;

    font-size:13px;

}

table button:first-child{

    background:#ff9800;

}

table button:last-child{

    background:#e53935;

}

table button:hover{

    opacity:.85;

}
/* =======================================
   RESPONSIVE
======================================= */

@media screen and (max-width:992px){

    .top-header{

        flex-wrap:wrap;

        gap:10px;

        padding:10px;

    }

    .logo{

        width:100%;

        text-align:center;

    }

    .search-box{

        width:100%;

    }

    .search-box input{

        max-width:100%;

    }

    .cart-box{

        position:absolute;

        right:15px;

        top:15px;

    }

    .products-grid{

        grid-template-columns:repeat(3,1fr);

        gap:12px;

    }

    .checkout-grid{

        grid-template-columns:1fr;

    }

}

/* ============================= */

@media screen and (max-width:768px){

    .products-grid{

        grid-template-columns:repeat(2,1fr);

        gap:10px;

        padding:10px;

    }

    .card img{

        height:170px;

    }

    .card-content{

        padding:10px;

    }

    .card-content h3{

        font-size:15px;

    }

    .price{

        font-size:18px;

    }

    .dashboard-cards{

        grid-template-columns:1fr 1fr;

    }

    table{

        font-size:12px;

    }

    th,td{

        padding:6px;

    }

    .admin-header{

        flex-direction:column;

        text-align:center;

    }

    .admin-header nav{

        justify-content:center;

    }

}

/* ============================= */

@media screen and (max-width:480px){

    .logo h1{

        font-size:22px;

    }

    .search-box input{

        font-size:14px;

        padding:10px;

    }

    .category-btn{

        font-size:13px;

        padding:7px 10px;

    }

    .subcategory-btn{

        font-size:12px;

        padding:6px 10px;

    }

    .products-grid{

        grid-template-columns:repeat(2,1fr);

        gap:8px;

    }

    .card img{

        height:150px;

    }

    .card-content h3{

        font-size:14px;

    }

    .price{

        font-size:17px;

    }

    .card button{

        font-size:14px;

        padding:10px;

    }

    .dashboard-cards{

        grid-template-columns:1fr;

    }

    .dashboard-tools{

        flex-direction:column;

    }

    .dashboard-tools input{

        width:100%;

    }

    .dashboard-tools button{

        width:100%;

    }

    form{

        padding:15px;

    }

}
