/* Base visuelle */
:root {
    --brand: #f7b500;
    --brand-dark: #d89500;
    --ink: #172033;
    --muted: #667085;
    --surface: #ffffff;
    --soft: #f5f7fb;
    --line: #e7ebf2;
    --radius-lg: 1.25rem;
    --shadow-sm: 0 8px 24px rgba(23, 32, 51, .06);
    --shadow-md: 0 16px 40px rgba(23, 32, 51, .12);
}
html { scroll-behavior: smooth; }
body {
    background: linear-gradient(180deg, #f8fafc 0%, var(--soft) 100%);
    color: var(--ink);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    padding-bottom: 5rem;
}
.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 16px rgba(23, 32, 51, .06);
}
.navbar-brand { color: var(--ink) !important; letter-spacing: -.03em; font-size: 1.15rem; }
.navbar .nav-link,
.navbar .text-white { color: var(--ink) !important; border-radius: .55rem; padding: .55rem .75rem; transition: .2s ease; }
.navbar .nav-link:hover, .navbar .nav-link:focus { color: #8b6100 !important; background: #fff8e6; }
.navbar .btn-outline-light { color: var(--ink) !important; border-color: var(--line) !important; background: #fff; }
.navbar .btn-outline-light:hover { color: var(--ink) !important; border-color: var(--brand) !important; background: #fff8e6; }
.navbar-toggler { border: 1px solid var(--line); border-radius: .55rem; padding: .4rem .55rem; }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(247,181,0,.18); }
.navbar-light .navbar-toggler-icon { filter: brightness(.35); }
.navbar .dropdown-menu { border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; box-shadow: var(--shadow-sm) !important; }
.navbar .dropdown-item { padding: .65rem .9rem; }
.navbar .dropdown-item:hover { background: #fff8e6; color: var(--ink); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); min-height: 100vh; }
.admin-mobile-toggle { display: none; }
.admin-page main { min-width: 0; }
.admin-page .sidebar .nav-link { white-space: normal; }
@media (max-width: 767.98px) {
    .admin-page { padding-top: 4.5rem; }
    .admin-mobile-toggle { display: inline-flex; position: fixed; top: 66px; right: .8rem; z-index: 1045; align-items: center; gap: .4rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: .7rem; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
    .admin-page .sidebar { position: fixed; top: 58px; left: 0; z-index: 1040; width: min(86vw, 310px); height: calc(100vh - 58px); min-height: 0; overflow-y: auto; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 12px 0 30px rgba(23,32,51,.14); }
    .admin-page .sidebar.show { transform: translateX(0); }
    .admin-page main { width: 100%; margin-left: 0 !important; padding: .85rem !important; }
    .admin-page .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-page table { min-width: 650px; }
    .admin-page .card { overflow: hidden; }
}
.nav-link { color: var(--muted); font-weight: 600; transition: .2s ease; border-radius: .8rem; margin-bottom: .35rem; }
.nav-link:hover, .nav-link.active { color: #9a6900 !important; background: #fff7df; }
.card { border: 1px solid rgba(231,235,242,.9); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.mobile-bottom-bar { display: none; }
.mobile-bottom-link { color: var(--muted); text-decoration: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; font-size: .7rem; font-weight: 600; }
.mobile-bottom-link i { font-size: 1.05rem; }
.mobile-bottom-link.active, .mobile-bottom-link:hover { color: #9a6900; }
#det-capture, #det-share { display: none !important; }
#modalDetails .modal-body { background: #fff; }
#modalDetails .modal-content { overflow: hidden; }
#modalDetails .bg-light { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
#modalDetails .bg-light > small, #modalDetails .bg-light > h6 { flex: 0 0 100%; }
#modalDetails .bg-light > .btn { flex: 1 1 45%; width: auto !important; }
#modalDetails .modal-content { border: 1px solid var(--line) !important; }
#modalDetails .modal-dialog { max-width: 860px; }
#modalDetails .modal-content { border: 0 !important; border-radius: 1.25rem; box-shadow: 0 20px 60px rgba(23,32,51,.2); overflow: hidden; }
#modalDetails .modal-header { min-height: 3.25rem; padding: .85rem 1.1rem; background: linear-gradient(135deg, #172033, #263653); color: #fff; border: 0; }
#modalDetails .modal-header .btn-close { filter: invert(1); opacity: .9; }
#modalDetails .modal-body { padding: 0 !important; background: #fff; }
#modalDetails .modal-body > .row { margin: 0; align-items: stretch; }
#modalDetails .modal-body .img-fluid, #modalDetails .modal-body .carousel-item img { width: 100%; height: 300px; object-fit: cover; }
#modalDetails .modal-body .col-md-6 { padding: 1.25rem; }
#modalDetails .modal-body h4, #modalDetails .modal-body h5 { color: var(--ink); font-weight: 700; }
#modalDetails .modal-body .text-warning { color: #a66f00 !important; font-weight: 700; }
#modalDetails .modal-header { min-height: 3rem; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(247,181,0,.45); }
.img-prod { height: 220px; object-fit: cover; background: #eef2f7; transition: transform .35s ease; }
.card-hover:hover .img-prod { transform: scale(1.035); }
.category-scroll-wrapper { position: sticky; top: 56px; z-index: 1020; border-radius: 1rem; box-shadow: var(--shadow-sm); background: #fff; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.x-small { font-size: .75rem; }
.btn { border-radius: .75rem; font-weight: 600; transition: .2s ease; }
.btn-warning { color: #241900; background: var(--brand); border-color: var(--brand); }
.btn-warning:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-1px); }
.form-control, .form-select { border-color: var(--line); border-radius: .75rem; min-height: 44px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(247,181,0,.18); }
body:has(#form-connexion), body:has(#form-inscription) { background: radial-gradient(circle at top, #fff8e6 0%, #f5f7fb 48%, #eef2f7 100%); }
body:has(#form-connexion) .container.my-5, body:has(#form-inscription) .container.my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
body:has(#form-connexion) .container.my-5 .card, body:has(#form-inscription) .container.my-5 .card { border: 1px solid var(--line) !important; border-radius: 1.25rem !important; box-shadow: 0 20px 50px rgba(23,32,51,.1) !important; overflow: hidden; }
body:has(#form-connexion) .container.my-5 .card-body, body:has(#form-inscription) .container.my-5 .card-body { padding: 1.5rem !important; }
body:has(#form-connexion) h3, body:has(#form-inscription) h3 { color: var(--ink); letter-spacing: -.02em; }
body:has(#form-connexion) .input-group, body:has(#form-inscription) .input-group { border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; background: #fff; }
body:has(#form-connexion) .input-group-text, body:has(#form-inscription) .input-group-text { border: 0; color: #9a6900 !important; }
body:has(#form-connexion) .input-group .form-control, body:has(#form-inscription) .input-group .form-control, body:has(#form-inscription) .input-group .form-select { border: 0; box-shadow: none; }
body:has(#form-connexion) .btn-primary, body:has(#form-inscription) .btn-primary { background: var(--ink); border-color: var(--ink); border-radius: .8rem; }
body:has(#form-connexion) .btn-primary:hover, body:has(#form-inscription) .btn-primary:hover { background: #263653; border-color: #263653; transform: translateY(-1px); }
#preloader { position: fixed; inset: 0; background: rgba(255,255,255,.97); z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity .25s ease, visibility .25s ease; }
#preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 767.98px) {
    body { padding-bottom: 4rem; }
    .container-fluid { padding-left: .75rem; padding-right: .75rem; }
    body { padding-top: 58px; }
    .navbar { min-height: 58px; position: fixed; top: 0; left: 0; right: 0; z-index: 1030; }
    .navbar-toggler, .navbar-collapse { display: none !important; }
    .navbar .container { justify-content: center; }
    .navbar-brand { margin-right: 0; }
    .container-fluid { padding-top: 120px; }
    .navbar .container { justify-content: flex-start; }
    .navbar-brand { flex: 0 0 112px; white-space: nowrap; }
    .container-fluid > .row.mb-3.justify-content-center.mx-2 { position: fixed; top: 0; left: 128px; right: .75rem; height: 58px; z-index: 1032; margin: 0 !important; padding: .55rem .25rem; background: #fff; }
    .container-fluid > .row.mb-3.justify-content-center.mx-2 > .col-md-6:first-child { display: none; }
    .container-fluid > .row.mb-3.justify-content-center.mx-2 > .col-md-6:last-child { flex: 1 0 100%; max-width: 100%; padding: 0 !important; }
    .container-fluid > .row.mb-3.justify-content-center.mx-2 .input-group { margin: 0 !important; height: 40px; }
    .category-scroll-wrapper { position: fixed; top: 58px; left: 0; right: 0; z-index: 1031; margin: 0 !important; border-radius: 0; }
    .category-scroll-wrapper > div { padding-top: .45rem !important; padding-bottom: .45rem !important; }
    .category-scroll-wrapper { position: fixed; top: 58px; left: 0; right: 0; z-index: 1031; margin: 0 !important; border-radius: 0; }
    .category-scroll-wrapper > div { padding-top: .45rem !important; padding-bottom: .45rem !important; }
    .navbar .container { padding: 0 .85rem; }
    .navbar-brand { font-size: 1rem; }
    .navbar-toggler { padding: .35rem .5rem; }
    .navbar-collapse { margin: .55rem -.15rem -.2rem; padding: .5rem .35rem .35rem; background: #fff; border: 1px solid var(--line); border-radius: .8rem; box-shadow: var(--shadow-sm); }
    .navbar-nav { align-items: stretch !important; gap: .15rem; }
    .navbar .nav-link { display: block; padding: .6rem .7rem; border-bottom: 1px solid #f0f1f4; }
    .navbar .nav-item:last-child .nav-link { border-bottom: 0; }
    .navbar .btn { width: 100%; min-height: 40px; }
    .navbar .dropdown-menu { margin-top: .25rem; box-shadow: none !important; }
    .img-prod { height: 145px !important; }
    .mobile-bottom-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; height: 62px; padding: .35rem .5rem; background: rgba(255,255,255,.98); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(23,32,51,.1); justify-content: space-around; }
    .mobile-bottom-link { flex: 1; max-width: 120px; }
    .row.g-4 > [class*="col-"], .row.g-3 > [class*="col-"] { width: 100%; max-width: 100%; flex: 0 0 100%; }
    .row.g-4 > [class*="col-"] > .card, .row.g-3 > [class*="col-"] > .card { display: flex; flex-direction: row; min-height: 150px; }
    #zone-produits > .item-produit > .card > .carousel { flex: 0 0 38%; width: 38%; height: 150px; min-width: 0; overflow: hidden; }
    #zone-produits > .item-produit > .card > .carousel .carousel-inner,
    #zone-produits > .item-produit > .card > .carousel .carousel-item,
    #zone-produits > .item-produit > .card > .carousel .img-prod { height: 150px !important; }
    #zone-produits > .item-produit > .card > .carousel .img-prod { width: 100%; object-fit: cover; }
    .row.g-4 > [class*="col-"] .img-prod, .row.g-3 > [class*="col-"] .img-prod { flex: 0 0 38%; width: 38%; height: 150px !important; border-radius: .9rem 0 0 .9rem; }
    .row.g-4 > [class*="col-"] .card-body, .row.g-3 > [class*="col-"] .card-body { flex: 1; min-width: 0; }
    body { padding-bottom: 5rem; }
    .row.g-4, .row.g-3 { --bs-gutter-x: .65rem; --bs-gutter-y: .65rem; }
    .row.g-4 > [class*="col-"], .row.g-3 > [class*="col-"] { width: 100% !important; max-width: 100% !important; flex-basis: 100% !important; }
    .row.g-2 > .col-3:first-child { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .row.g-2 > .col-6 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .row.g-2 .btn { white-space: nowrap; word-break: normal; }
    .card { border-radius: .9rem; }
    .card-body { padding: .65rem !important; }
    .card-title { font-size: .9rem; line-height: 1.2; }
    .btn { min-height: 36px; padding: .4rem .55rem; font-size: .82rem; }
    .form-control, .form-select { min-height: 39px; font-size: .9rem; }
}