/* ============================================
   assets/css/style.css — Style global
   ============================================ */

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

:root {
    --orange:  #ff6e14;
    --dark:    #1a1a1a;
    --grey:    #f5f5f5;
    --border:  #e0e0e0;
    --text:    #333;
    --green:   #00b67a;
    --red:     #e53935;
    --radius:  10px;
    --shadow:  0 2px 16px rgba(0,0,0,.08);
}

body { font-family: 'Nunito Sans', 'Segoe UI', sans-serif; color: var(--text); background: #fff; }
a    { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
img  { max-width: 100%; display: block; }

/* ---- HEADER ---- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}
.site-header .logo { font-size: 1.4rem; font-weight: 800; color: var(--orange); }
.site-header nav a { margin-left: 1.5rem; color: var(--text); font-weight: 600; font-size: .95rem; }
.site-header nav a:hover { color: var(--orange); text-decoration: none; }

/* ---- CONTAINER ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ---- HERO ---- */
.hero { background: linear-gradient(135deg, var(--orange) 0%, #ff9a4f 100%);
        color: #fff; text-align: center; padding: 4rem 2rem; }
.hero h1 { font-size: 2.2rem; margin-bottom: .5rem; }
.hero p  { font-size: 1.1rem; opacity: .9; }

/* ---- GRILLE PRODUITS ---- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.product-card img  { width: 100%; height: 200px; object-fit: cover; }
.product-card .card-body { padding: 1rem; }
.product-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.product-card .prix { font-size: 1.3rem; font-weight: 800; color: var(--orange); margin-bottom: .8rem; }
.product-card .categorie { font-size: .75rem; background: var(--grey); padding: .2rem .6rem;
    border-radius: 20px; display: inline-block; margin-bottom: .6rem; color: #666; }

/* ---- BOUTONS ---- */
.btn { display: inline-block; padding: .7rem 1.4rem; border-radius: var(--radius);
       font-weight: 700; font-size: .95rem; cursor: pointer; border: none;
       transition: opacity .2s, transform .1s; text-align: center; }
.btn:hover { opacity: .88; text-decoration: none; transform: translateY(-1px); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-dark   { background: var(--dark);   color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--orange); color: var(--orange); }
.btn-green  { background: var(--green);  color: #fff; }
.btn-red    { background: var(--red);    color: #fff; }
.btn-sm     { padding: .45rem .9rem; font-size: .85rem; }
.btn-full   { width: 100%; display: block; }

/* ---- PAGE PRODUIT / RÉSERVATION ---- */
.reservation-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }
@media(max-width:800px){ .reservation-layout { grid-template-columns: 1fr; } }

.recap-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; background: #fff; box-shadow: var(--shadow); position: sticky; top: 80px;
}
.recap-card h3 { font-size: 1rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.recap-row { display: flex; justify-content: space-between; margin-bottom: .5rem; font-size: .95rem; }
.recap-row.total { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: .7rem; margin-top: .5rem; }
.recap-img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; margin-bottom: 1rem; }

/* ---- GARANTIES ---- */
.warranty-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin: 1rem 0 1.5rem; }
@media(max-width:600px){ .warranty-grid { grid-template-columns: 1fr; } }

.warranty-item {
    border: 2px solid var(--border); border-radius: var(--radius);
    padding: 1rem; cursor: pointer; position: relative; transition: border-color .2s;
    text-align: center;
}
.warranty-item:hover { border-color: var(--orange); }
.warranty-item.selected { border-color: var(--orange); background: #fff8f4; }
.warranty-item .badge {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: var(--orange); color: #fff; font-size: .7rem; padding: .15rem .5rem;
    border-radius: 20px; white-space: nowrap;
}
.warranty-item .duree { font-weight: 800; font-size: 1rem; }
.warranty-item .prix-garantie { font-size: 1.1rem; font-weight: 700; color: var(--orange); margin-top: .3rem; }

/* ---- FORMULAIRE ---- */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: .95rem; font-family: inherit;
    transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--orange);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-error { color: var(--red); font-size: .82rem; margin-top: .3rem; display: none; }
input:invalid:not(:placeholder-shown) + .form-error { display: block; }

/* ---- ALERTS ---- */
.alert { padding: 1rem 1.2rem; border-radius: 8px; margin-bottom: 1.2rem; font-size: .95rem; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid var(--green); }
.alert-error   { background: #fdecea; color: #b71c1c; border-left: 4px solid var(--red); }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }

/* ---- LOADER ---- */
#holder-loader {
    position: fixed; inset: 0; background: rgba(255,255,255,.95);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
}
.loader-box { text-align: center; }
.loader-box p { margin-bottom: 1rem; font-weight: 600; color: var(--orange); }
.spinner { width: 48px; height: 48px; border: 5px solid var(--border);
    border-top-color: var(--orange); border-radius: 50%;
    animation: spin .8s linear infinite; margin: 1rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- ADMIN ---- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 230px; background: var(--dark); color: #fff;
    padding: 1.5rem 0; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .brand { padding: 0 1.5rem 1.5rem; font-size: 1.2rem; font-weight: 800; color: var(--orange); border-bottom: 1px solid #333; }
.admin-sidebar nav a {
    display: block; padding: .75rem 1.5rem; color: #ccc;
    font-size: .95rem; transition: background .15s, color .15s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: #2a2a2a; color: #fff; text-decoration: none; }
.admin-sidebar nav a .icon { margin-right: .6rem; }
.admin-main { flex: 1; padding: 2rem; background: #f8f8f8; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-topbar h1 { font-size: 1.4rem; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff;
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { background: var(--dark); color: #fff; padding: .75rem 1rem; text-align: left; font-size: .85rem; }
.admin-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--grey); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.2rem 1.5rem;
    box-shadow: var(--shadow); border-left: 4px solid var(--orange); }
.stat-card .val { font-size: 1.8rem; font-weight: 800; color: var(--dark); }
.stat-card .lbl { font-size: .82rem; color: #888; margin-top: .2rem; }

.badge-statut { padding: .25rem .7rem; border-radius: 20px; font-size: .78rem; font-weight: 700; }
.badge-statut.en_attente { background: #fff8e1; color: #f57f17; }
.badge-statut.validee    { background: #e8f5e9; color: #2e7d32; }
.badge-statut.annulee    { background: #fdecea; color: #b71c1c; }

/* ---- PAGE CONFIRMATION RIB ---- */
.rib-box { border: 2px dashed var(--orange); border-radius: var(--radius);
    padding: 1.5rem; text-align: center; margin: 1.5rem 0; background: #fff8f4; }
.rib-box .iban { font-size: 1.1rem; font-weight: 800; letter-spacing: 1px; color: var(--dark); }
.rib-steps { list-style: none; counter-reset: steps; margin: 1.5rem 0; }
.rib-steps li { counter-increment: steps; padding: .8rem 1rem .8rem 3.5rem; position: relative;
    border-left: 3px solid var(--orange); margin-bottom: .8rem; background: #fff; border-radius: 0 8px 8px 0; }
.rib-steps li::before { content: counter(steps); position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; background: var(--orange); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .9rem; }

/* ---- FOOTER ---- */
.site-footer { background: var(--dark); color: #aaa; text-align: center;
    padding: 1.5rem; font-size: .85rem; margin-top: 4rem; }

/* ---- RESPONSIVE ---- */
@media(max-width:600px){
    .site-header .logo { font-size: 1.1rem; }
    .hero h1 { font-size: 1.5rem; }
    .admin-sidebar { display: none; }
}
