/* ==========================================================================
   Moroccan High - feuille de style de l'application
   Mobile d'abord : tout part de l'ecran de 390 px, puis on elargit.
   ========================================================================== */

:root {
    --brand: #A63A20;
    --brand-dark: #7E2A16;
    --brand-light: #F4E3DC;
    --brand-soft: #FBEDE8;
    --teal: #0E5C55;
    --teal-light: #E2EFED;
    --gold: #C98B2E;
    --gold-light: #FBF0DC;
    --ink: #241A15;
    --ink-soft: #4C3D34;
    --muted: #7C6B5F;
    --line: #E8DED6;
    --bg: #FAF6F1;
    --surface: #FFFFFF;
    --success: #1F7A4D;
    --success-bg: #E4F3EA;
    --warn: #B2740A;
    --warn-bg: #FCF1DC;
    --danger: #B32B22;
    --danger-bg: #FBE7E4;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --shadow: 0 4px 16px rgba(36, 26, 21, .07);
    --shadow-lg: 0 12px 34px rgba(36, 26, 21, .13);
    --nav-h: 64px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    width: 100%;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; }

.page {
    width: 100%;
    max-width: 100%;
    padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px));
}

.wrap { padding: 0 16px; }
.wrap-narrow { padding: 0 16px; max-width: 780px; margin: 0 auto; }

.section { margin-top: 26px; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.section-head h2 { font-size: 19px; letter-spacing: -.2px; }
.section-head h2 .dot { color: var(--brand); }
.section-head a { font-size: 13px; font-weight: 600; white-space: nowrap; }
.section-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------------------------------------------------------------- En-tete */

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 246, 241, .92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top, 0px);
}
.app-header .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 8px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px; letter-spacing: -.5px;
}
.brand-text { min-width: 0; }
.brand-text strong {
    display: block; font-family: var(--font-display); font-size: 17px;
    letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.header-bar-inner { display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px; }
.header-logo-only { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }

.icon-btn {
    width: 40px; height: 40px; flex: 0 0 40px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-soft);
    cursor: pointer;
    transition: transform .12s ease, background .2s ease;
    position: relative;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { background: var(--brand-soft); border-color: var(--brand-light); color: var(--brand); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge-dot {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--brand); color: #fff;
    font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---------------------------------------------------------- Barre du bas */

.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
.bottom-nav a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    padding: 6px 2px;
    transition: transform .12s ease, color .2s ease;
    position: relative;
}
.bottom-nav a:active { transform: scale(.94); }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a .pill {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 28px; border-radius: 14px;
    transition: background .2s ease;
}
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active .pill { background: var(--brand-soft); }
.bottom-nav a .nav-badge {
    position: absolute; top: 4px; right: 50%; transform: translateX(22px);
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--brand); color: #fff; border-radius: 8px;
    font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ------------------------------------------------------------- Boutons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    transition: transform .12s ease, opacity .2s ease, background .2s ease;
    text-align: center;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(166, 58, 32, .25); }
.btn-primary:active { background: var(--brand-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-outline { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.btn-light { background: #fff; color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 13px; font-size: 13px; border-radius: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

/* -------------------------------------------------------------- Cartes */

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.card + .card { margin-top: 12px; }
.card-flat { box-shadow: none; border: 1px solid var(--line); }
.card-link { display: block; color: inherit; transition: transform .12s ease; }
.card-link:active { transform: scale(.985); }

.list { display: grid; gap: 12px; }

/* Fiche prestataire */

.pro-card {
    display: flex;
    gap: 13px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: inherit;
    transition: transform .12s ease;
}
.pro-card:active { transform: scale(.985); }
.pro-thumb {
    width: 92px; height: 92px; flex: 0 0 92px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--brand-light);
}
.pro-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pro-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.pro-name { display: flex; align-items: center; gap: 6px; }
.pro-name strong { font-size: 15.5px; letter-spacing: -.2px; }
.pro-name .verified { color: var(--teal); display: flex; }
.pro-name .verified svg { width: 15px; height: 15px; }
.pro-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pro-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pro-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.pro-price { font-size: 13px; color: var(--muted); }
.pro-price strong { color: var(--brand); font-size: 15px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 650;
    background: var(--bg);
    color: var(--ink-soft);
    white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-home { background: var(--teal-light); color: var(--teal); }
.badge-studio { background: var(--gold-light); color: #8A5E12; }
.badge-verified { background: var(--teal-light); color: var(--teal); }
.badge-featured { background: var(--brand-soft); color: var(--brand); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-confirmed { background: var(--success-bg); color: var(--success); }
.badge-completed { background: #EDEAE7; color: var(--ink-soft); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }

.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 650; }
.rating svg { width: 14px; height: 14px; color: var(--gold); }
.rating span { color: var(--muted); font-weight: 500; }

.stars-row { display: flex; gap: 2px; }
.stars-row svg { width: 14px; height: 14px; color: var(--gold); }

/* ------------------------------------------------------------- Grilles */

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
.stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --------------------------------------------------------------- Hero */

.hero {
    position: relative;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    padding: 20px 16px 22px;
    background: #2A211B;
    color: #fff;
}
.hero > img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    opacity: .55;
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(36, 26, 21, .25) 0%, rgba(36, 26, 21, .82) 100%);
}
.hero-inner { position: relative; z-index: 2; width: 100%; }
.hero h1 {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -.6px;
    margin-bottom: 8px;
}
.hero p { font-size: 14.5px; color: rgba(255, 255, 255, .86); max-width: 420px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-badges span {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-top: -22px;
    position: relative;
    z-index: 10;
    padding: 0 16px;
}
.search-bar form { display: flex; gap: 8px; width: 100%; }
.search-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    padding: 0 12px;
    height: 50px;
}
.search-input svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 18px; }
.search-input input {
    border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%;
}

/* --------------------------------------------------------- Categories */

.cat-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 16px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-tile {
    flex: 0 0 106px;
    scroll-snap-align: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 10px;
    text-align: center;
    color: var(--ink);
    transition: transform .12s ease;
}
.cat-tile:active { transform: scale(.96); }
.cat-tile .ico {
    width: 40px; height: 40px; margin: 0 auto 8px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}
.cat-tile .ico svg { width: 21px; height: 21px; }
.cat-tile strong { display: block; font-size: 12.5px; }
.cat-tile span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.cat-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cat-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .12s ease;
}
.cat-card:active { transform: scale(.97); }
.cat-card .ico {
    width: 42px; height: 42px; border-radius: 13px;
    background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}
.cat-card .ico svg { width: 22px; height: 22px; }
.cat-card strong { font-size: 14.5px; }
.cat-card span { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- Chiffres */

.stat {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    text-align: center;
}
.stat strong { display: block; font-size: 22px; font-family: var(--font-display); color: var(--brand); }
.stat span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------ Filtres */

.chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 16px 8px;
    -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.filters-panel { display: grid; gap: 14px; }

/* ------------------------------------------------------------ Formulaires */

.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 650; color: var(--ink-soft); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease;
    -webkit-appearance: none;
    appearance: none;
}
.textarea { min-height: 96px; resize: vertical; }
.select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C6B5F' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 38px;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(166, 58, 32, .1);
}
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr; }

.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.check input { accent-color: var(--brand); width: 18px; height: 18px; }
.check.on { border-color: var(--brand); background: var(--brand-soft); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.tabs {
    display: flex;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 4px;
}
.tabs button {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 10px 8px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--muted);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.tabs button.on { background: var(--brand); color: #fff; }

/* --------------------------------------------------------------- Avis */

.review {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px;
}
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-head .who { flex: 1; min-width: 0; }
.review-head .who strong { display: block; font-size: 14px; }
.review-head .who span { font-size: 11.5px; color: var(--muted); }
.review p { font-size: 14px; color: var(--ink-soft); }

.rating-bars { display: grid; gap: 6px; }
.rating-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.rating-bar .track { flex: 1; height: 7px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.rating-bar .fill { height: 100%; background: var(--gold); border-radius: 4px; }

/* ------------------------------------------------------ Lignes de liste */

.row-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: inherit;
    transition: transform .12s ease;
}
.row-item:active { transform: scale(.985); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .grow strong { display: block; font-size: 14.5px; }
.row-item .grow span { font-size: 12.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .chev { color: var(--muted); flex: 0 0 auto; }
.row-item .chev svg { width: 18px; height: 18px; }

.resa { display: grid; gap: 10px; }
.resa-top { display: flex; gap: 12px; align-items: center; }
.resa-top img { width: 54px; height: 54px; border-radius: 13px; object-fit: cover; flex: 0 0 54px; }
.resa-info { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--ink-soft); }
.resa-info .k { color: var(--muted); font-size: 11.5px; display: block; }
.resa-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.resa-total { font-size: 15px; font-weight: 700; color: var(--brand); margin-left: auto; }

/* ------------------------------------------------------------- Sheets */

.sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(36, 26, 21, .5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
.sheet-backdrop.on { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 210;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(102%);
    transition: transform .28s cubic-bezier(.22, .8, .3, 1);
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}
.sheet.on { transform: translateY(0); }
.sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 14px; }
.sheet h3 { font-size: 18px; margin-bottom: 4px; }
.sheet .sheet-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.toast-host {
    position: fixed;
    left: 16px; right: 16px;
    bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px));
    z-index: 300;
    display: grid;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--ink);
    color: #fff;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toastIn .25s ease;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.empty {
    text-align: center;
    padding: 34px 20px;
    color: var(--muted);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.empty .ico { width: 52px; height: 52px; margin: 0 auto 12px; color: var(--line); }
.empty .ico svg { width: 52px; height: 52px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.empty p { font-size: 13.5px; margin-bottom: 14px; }

.skeleton { background: linear-gradient(90deg, #EFE9E3 25%, #F7F3EF 50%, #EFE9E3 75%); background-size: 200% 100%; animation: shim 1.3s infinite; border-radius: 12px; }
@keyframes shim { to { background-position: -200% 0; } }
.skel-card { height: 116px; }
.spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2.5px solid rgba(166, 58, 32, .22);
    border-top-color: var(--brand);
    animation: spin .8s linear infinite;
    margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- Divers */

.notice {
    display: flex;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.notice svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.notice-info { background: var(--teal-light); color: #0B4A44; }
.notice-warn { background: var(--warn-bg); color: #7C5209; }

.sep { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

.kv { display: grid; gap: 10px; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 14px; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 650; text-align: right; }

.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.price-line + .price-line { border-top: 1px dashed var(--line); }
.price-line.total { font-weight: 750; font-size: 16px; color: var(--brand); }

.chat-wrap { display: grid; gap: 10px; }
.bubble {
    max-width: 82%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    justify-self: start;
}
.bubble.me { background: var(--brand); color: #fff; justify-self: end; }
.bubble time { display: block; font-size: 10.5px; opacity: .7; margin-top: 4px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer .input { flex: 1; }

.service-card { display: flex; gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.service-card img { width: 76px; height: 76px; border-radius: 13px; object-fit: cover; flex: 0 0 76px; }
.service-card .grow { flex: 1; min-width: 0; }
.service-card h4 { font-size: 14.5px; margin-bottom: 3px; }
.service-card .desc { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

.gallery { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: var(--radius-sm); }

.gallery-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 8px; }
.gallery-strip img { width: 200px; height: 130px; object-fit: cover; border-radius: var(--radius); flex: 0 0 200px; }
.gallery-strip::-webkit-scrollbar { display: none; }

.install-card {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 15px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    border: 1px solid var(--brand-light);
}
.install-card .ico {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px;
    background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}
.install-card .ico svg { width: 24px; height: 24px; }
.install-card .grow { flex: 1; min-width: 0; }
.install-card strong { display: block; font-size: 14.5px; }
.install-card span { font-size: 12.5px; color: var(--muted); }

.store-logos { display: flex; gap: 16px; align-items: center; color: var(--muted); }
.store-logos svg { width: 26px; height: 26px; }

/* Ecran d'ouverture de l'application installee */
#app-splash {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
}
#app-splash img { width: 96px; height: 96px; border-radius: 22px; }
#app-splash strong { font-family: var(--font-display); font-size: 20px; letter-spacing: .3px; }
#app-splash.show { display: flex; animation: splashOut .4s ease 1.2s forwards; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

.admin-accent { --brand: #0E5C55; --brand-dark: #09423D; --brand-soft: #E2EFED; --brand-light: #CFE4E1; }
.admin-accent .btn-primary { box-shadow: 0 6px 18px rgba(14, 92, 85, .25); }

/* ------------------------------------------------------------ Desktop */

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

@media (min-width: 768px) {
    .wrap, .wrap-narrow, .section-head, .header-bar-inner { padding-left: 24px; padding-right: 24px; }
    .hero { min-height: 400px; padding: 34px 24px 30px; border-radius: 0 0 28px 28px; }
    .hero h1 { font-size: 44px; }
    .hero p { font-size: 16px; }
    .search-bar { padding: 0 24px; margin-top: -26px; }
    .cat-scroll, .chip-row, .gallery-strip { padding-left: 24px; padding-right: 24px; }
    .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pro-thumb { width: 112px; height: 112px; flex-basis: 112px; }
    .sheet {
        max-width: 560px;
        margin: 0 auto;
        border-radius: 22px;
        bottom: 24px;
        left: 50%;
        transform: translate(-50%, 120%);
    }
    .sheet.on { transform: translate(-50%, 0); }
    .toast-host { left: 50%; transform: translateX(-50%); max-width: 460px; }
}

@media (min-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ==========================================================================
   Ajustements de robustesse mobile
   Aucune grille ne doit jamais serrer son contenu sur un ecran de 390 px.
   ========================================================================== */

.section-head { flex-wrap: wrap; }

.tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; white-space: nowrap; padding: 10px 12px; }

.resa-top { flex-wrap: wrap; }
.service-card { flex-wrap: wrap; }
.service-card .grow { min-width: 190px; }
.kv-row, .price-line { flex-wrap: wrap; }
.pro-foot { flex-wrap: wrap; }

.bottom-nav a {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.bottom-nav a .pill { width: 42px; }

.hero h1 { overflow-wrap: anywhere; }

@media (max-width: 380px) {
    .pro-card { flex-direction: column; }
    .pro-thumb { width: 100%; height: 168px; flex-basis: auto; }
    .gallery { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
}
