/* =====================================================================
   Soft Resto — Menu, panier, suivi client + composants partagés
   ===================================================================== */

:root {
    --sr-ink: #1d2130;
    --sr-ink-2: #3b4050;
    --sr-muted: #6a6f7d;
    --sr-line: #ebe6e1;
    --sr-paper: #ffffff;
    --sr-soft: #faf6f2;
    --sr-accent: #d63c42;
    --sr-accent-hover: #bd2f35;
    --sr-accent-soft: #fdeceb;
    --sr-ok: #17804a;
    --sr-ok-soft: #e7f5ed;
    --sr-warn: #a85d06;
    --sr-warn-soft: #fff4e2;
    --sr-info: #1f4fd1;
    --sr-info-soft: #eaf0ff;
    --sr-radius: 14px;
    --sr-radius-sm: 10px;
    --sr-shadow: 0 10px 30px rgba(29, 33, 48, 0.12);
    --sr-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------------------------------------------------------------------
   Réinitialisation locale (protège des styles du thème)
   --------------------------------------------------------------------- */

.sr-menu, .sr-drawer, .sr-cartbar, .sr-dialog, .sr-toasts, .sr-track, .sr-app, .sr-sheet {
    color: var(--sr-ink);
    -webkit-font-smoothing: antialiased;
}
.sr-menu *, .sr-drawer *, .sr-cartbar *, .sr-dialog *, .sr-track *, .sr-app *, .sr-sheet * {
    box-sizing: border-box;
}
.sr-menu button, .sr-drawer button, .sr-cartbar button, .sr-dialog button, .sr-track button, .sr-app button, .sr-sheet button {
    font-family: inherit;
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
    box-shadow: none;
    margin: 0;
    cursor: pointer;
}
.sr-menu h2, .sr-menu h3, .sr-menu h4, .sr-drawer h2, .sr-track h2, .sr-track h3, .sr-app h2, .sr-app h3, .sr-sheet h3, .sr-dialog h3 {
    font-family: inherit;
    letter-spacing: -0.01em;
    text-transform: none;
}
.sr-menu ul, .sr-drawer ul, .sr-track ul, .sr-track ol, .sr-app ul, .sr-sheet ul, .sr-dialog ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sr-menu svg, .sr-drawer svg, .sr-cartbar svg, .sr-track svg, .sr-app svg, .sr-sheet svg {
    width: 20px;
    height: 20px;
    flex: none;
}
.sr-app svg circle, .sr-sheet svg circle { fill: currentColor; }

html.sr-no-scroll, html.sr-no-scroll body { overflow: hidden; }

.sr-muted { color: var(--sr-muted); }

:where(.sr-menu, .sr-drawer, .sr-cartbar, .sr-dialog, .sr-track, .sr-app, .sr-sheet) :focus-visible {
    outline: 3px solid rgba(214, 60, 66, 0.45);
    outline-offset: 2px;
}

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

.sr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.sr-btn:active:not(:disabled) { transform: scale(0.98); }
.sr-btn:disabled { opacity: .5; cursor: not-allowed; }

.sr-btn--primary { background: var(--sr-accent); color: #fff !important; }
.sr-btn--primary:hover:not(:disabled) { background: var(--sr-accent-hover); }

.sr-btn--ghost { background: var(--sr-paper); color: var(--sr-ink) !important; border-color: var(--sr-line); }
.sr-btn--ghost:hover:not(:disabled) { border-color: var(--sr-ink-2); }

.sr-btn--danger { background: #b4232a; color: #fff !important; }
.sr-btn--danger:hover:not(:disabled) { background: #961c22; }
.sr-btn--danger-text { color: #b4232a !important; }

.sr-btn--text {
    background: none;
    border: 0;
    padding: 6px 4px;
    min-height: 0;
    color: var(--sr-accent) !important;
}
.sr-btn--small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
:is(.sr-menu, .sr-drawer, .sr-dialog, .sr-track, .sr-app, .sr-sheet) .sr-btn--small { font-size: 14px; }
:is(.sr-dialog, .sr-sheet, .sr-app) .sr-chip { font-size: 14px; text-align: left; line-height: 1.3; }
.sr-cartbar .sr-cartbar__btn { font-size: 16px; }
.sr-btn--block { display: flex; width: 100%; }
.sr-btn--split { justify-content: space-between; padding-left: 22px; padding-right: 22px; }

.sr-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.sr-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sr-spin .7s linear infinite;
}
.sr-btn--ghost.is-loading::after { border-color: rgba(29, 33, 48, .2); border-top-color: var(--sr-ink); }

@keyframes sr-spin { to { transform: rotate(360deg); } }

.sr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sr-ink-2);
}
.sr-icon-btn:hover { background: var(--sr-soft); }

/* ---------------------------------------------------------------------
   Champs de formulaire
   --------------------------------------------------------------------- */

.sr-form { display: grid; gap: 16px; }
.sr-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.sr-field { display: grid; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.sr-field__label { font-weight: 600; font-size: 14px; color: var(--sr-ink); padding: 0; }
.sr-field__help { font-size: 13px; color: var(--sr-muted); }
.sr-field__error { font-size: 13px; color: #b4232a; font-weight: 600; }
.sr-field.has-error .sr-input { border-color: #b4232a; background: #fff8f8; }

.sr-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1.5px solid var(--sr-line) !important;
    border-radius: var(--sr-radius-sm) !important;
    background: var(--sr-paper) !important;
    color: var(--sr-ink) !important;
    font: inherit;
    font-size: 16px; /* évite le zoom automatique sur iOS */
    line-height: 1.4;
    box-shadow: none !important;
    margin: 0;
}
.sr-input:focus { border-color: var(--sr-ink-2) !important; outline: none; }
textarea.sr-input { min-height: 0; resize: vertical; }
select.sr-input { padding-right: 36px; }

.sr-input-group { display: flex; align-items: stretch; }
.sr-input-group .sr-input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; min-width: 0; }
.sr-input-group__addon {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1.5px solid var(--sr-line);
    border-left: 0;
    border-radius: 0 var(--sr-radius-sm) var(--sr-radius-sm) 0;
    background: var(--sr-soft);
    color: var(--sr-muted);
    font-size: 14px;
    font-weight: 600;
}

.sr-form__error, .sr-alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--sr-radius-sm);
    font-size: 14px;
    line-height: 1.45;
}
.sr-form__error { background: #fff0f0; color: #8f1b21; font-weight: 600; }
.sr-alert--warn { background: var(--sr-warn-soft); color: #6f3d04; }
.sr-alert--info { background: var(--sr-info-soft); color: #18306f; }

.sr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-chip, .sr-chip-toggle span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 14px;
    border: 1.5px solid var(--sr-line);
    border-radius: 999px;
    background: var(--sr-paper);
    color: var(--sr-ink-2);
    font-size: 14px;
    font-weight: 500;
}
.sr-chip:hover { border-color: var(--sr-ink-2); }
.sr-chip-toggle { cursor: pointer; }
.sr-chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sr-chip-toggle input:checked + span { background: var(--sr-ink); border-color: var(--sr-ink); color: #fff; }
.sr-chip-toggle input:focus-visible + span { outline: 3px solid rgba(214, 60, 66, 0.45); outline-offset: 2px; }

/* Interrupteur */
.sr-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 0; }
.sr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sr-switch__track {
    position: relative;
    flex: none;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: #cfcac5;
    transition: background-color .2s;
}
.sr-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s var(--sr-ease);
}
.sr-switch input:checked + .sr-switch__track { background: var(--sr-ok); }
.sr-switch input:checked + .sr-switch__track::after { transform: translateX(18px); }
.sr-switch input:focus-visible + .sr-switch__track { outline: 3px solid rgba(214, 60, 66, 0.45); outline-offset: 2px; }
.sr-switch__text { display: grid; gap: 2px; font-size: 15px; line-height: 1.3; }
.sr-switch__text .sr-muted { font-size: 13px; }

/* Statuts */
.sr-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    background: #eef0f3;
    color: var(--sr-ink-2);
}
.sr-status--pending { background: var(--sr-warn-soft); color: #7a4304; }
.sr-status--accepted { background: var(--sr-info-soft); color: #18306f; }
.sr-status--preparing { background: #f1ebff; color: #4c1d95; }
.sr-status--ready { background: var(--sr-ok-soft); color: #0f5a33; }
.sr-status--completed { background: #eef0f3; color: #374151; }
.sr-status--rejected, .sr-status--cancelled { background: #fdecec; color: #8f1b21; }

.sr-empty { padding: 28px 8px; text-align: center; }
.sr-empty p { margin: 0 0 8px; }
.sr-empty .sr-btn { margin-top: 10px; }

/* ---------------------------------------------------------------------
   Menu public
   --------------------------------------------------------------------- */

.sr-menu { margin: 28px 0; }

.sr-menu__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sr-menu__title { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; }
.sr-menu__edit { font-size: 14px; font-weight: 600; color: var(--sr-accent); }

.sr-menu__notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--sr-radius-sm);
    background: var(--sr-warn-soft);
    color: #6f3d04;
    font-weight: 600;
    font-size: 14px;
}

.sr-menu__search { margin-bottom: 12px; }
.sr-menu__search-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 16px 10px 42px;
    border: 1.5px solid var(--sr-line) !important;
    border-radius: 999px !important;
    background: var(--sr-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a6f7d' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 18px !important;
    font-size: 16px;
    color: var(--sr-ink);
    box-shadow: none !important;
}

/* Navigation par sections, collante */
.sr-menu__nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 8px;
    margin: 0 -4px 8px;
    padding: 10px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.sr-menu__nav::-webkit-scrollbar { display: none; }
body.admin-bar .sr-menu__nav { top: 46px; }
@media (min-width: 783px) { body.admin-bar .sr-menu__nav { top: 32px; } }

.sr-menu__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--sr-soft);
    color: var(--sr-ink-2) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color .15s, color .15s;
}
.sr-menu__chip span { color: var(--sr-muted); font-weight: 500; font-size: 13px; }
.sr-menu__chip.is-active { background: var(--sr-ink); color: #fff !important; }
.sr-menu__chip.is-active span { color: rgba(255, 255, 255, .7); }

/* Plat du jour : le seul bloc mis en scène */
.sr-today {
    margin: 8px 0 26px;
    padding: 18px;
    border-radius: 20px;
    background: var(--sr-ink);
    color: #fff;
}
.sr-today__title { margin: 0 0 14px; font-size: 18px; font-weight: 800; color: #fff; }
.sr-today__list { display: grid; gap: 14px; }
.sr-today__item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.sr-today__item:not(:has(img)) { grid-template-columns: 1fr; }
.sr-today__item img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; }
.sr-today__body h4 { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: #fff; }
.sr-today__body .sr-price { color: #fff; }
.sr-today__body .sr-price del { color: rgba(255, 255, 255, .55); }
.sr-today__body .sr-qty-slot { margin-top: 10px; }
.sr-today .sr-stepper { background: rgba(255, 255, 255, .12); border-color: transparent; }
.sr-today .sr-stepper__btn, .sr-today .sr-stepper__qty { color: #fff; }

@media (min-width: 768px) {
    .sr-today__list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* Sections et plats */
.sr-menu__section { scroll-margin-top: 80px; margin-bottom: 18px; }
.sr-menu__section-title { margin: 18px 0 2px; font-size: 19px; font-weight: 800; }

.sr-dish {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--sr-line);
}
.sr-dish:last-child { border-bottom: 0; }
.sr-dish__body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sr-dish__name { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.sr-dish__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--sr-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sr-dish__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sr-dish__foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.sr-dish__soldout { font-size: 13px; font-weight: 700; color: #8f1b21; }
.sr-dish.is-unavailable .sr-dish__name, .sr-dish.is-unavailable .sr-price { color: var(--sr-muted); }
.sr-dish.is-unavailable .sr-dish__img { filter: grayscale(1); opacity: .6; }

.sr-dish__side { position: relative; display: flex; align-items: flex-end; justify-content: flex-end; min-width: 44px; }
.sr-dish__img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: var(--sr-radius); background: var(--sr-soft); }
.sr-dish__side .sr-qty-slot { position: absolute; right: 6px; bottom: -10px; }
.sr-dish__side:not(:has(img)) .sr-qty-slot { position: static; }
@media (min-width: 768px) { .sr-dish__img { width: 112px; height: 112px; } }

.sr-price { font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.sr-price strong { font-weight: 700; }
.sr-price del { color: var(--sr-muted); font-size: 13px; margin-right: 2px; }
.sr-price--promo strong { color: var(--sr-accent); }

.sr-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--sr-soft);
    color: var(--sr-ink-2);
    font-size: 12px;
    font-weight: 600;
}
.sr-tag--epice { background: #fdecec; color: #8f1b21; }
.sr-tag--vegetarien { background: var(--sr-ok-soft); color: #0f5a33; }
.sr-tag--halal { background: #e8f4f4; color: #0d5555; }
.sr-tag--nouveau { background: var(--sr-info-soft); color: #18306f; }
.sr-tag--populaire { background: var(--sr-warn-soft); color: #6f3d04; }

/* Bouton + et sélecteur de quantité */
.sr-add-btn--round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sr-paper);
    color: var(--sr-accent);
    box-shadow: 0 3px 10px rgba(29, 33, 48, .18) !important;
    transition: transform .12s;
}
.sr-add-btn--round:hover { transform: scale(1.06); }
.sr-add-btn--round:active { transform: scale(.94); }

.sr-stepper {
    display: inline-flex;
    align-items: center;
    height: 40px;
    border-radius: 999px;
    background: var(--sr-paper);
    border: 1.5px solid var(--sr-line);
    box-shadow: 0 3px 10px rgba(29, 33, 48, .12);
}
.sr-stepper__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sr-accent);
}
.sr-stepper__btn svg { width: 18px; height: 18px; }
.sr-stepper__qty { min-width: 20px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

.sr-dish.is-in-cart .sr-dish__name::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 8px 2px 0;
    border-radius: 50%;
    background: var(--sr-accent);
}

.sr-menu--empty { padding: 22px; border: 1.5px dashed var(--sr-line); border-radius: var(--sr-radius); }
.sr-menu--empty p { color: var(--sr-muted); }

/* ---------------------------------------------------------------------
   Barre flottante du panier
   --------------------------------------------------------------------- */

.sr-cartbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 9990;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.sr-cartbar[hidden] { display: none; }
.sr-cartbar__btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    min-height: 56px;
    padding: 8px 20px 8px 8px;
    border: 0;
    border-radius: 999px;
    background: var(--sr-accent);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 12px 28px rgba(214, 60, 66, .38) !important;
}
.sr-cartbar__btn:hover { background: var(--sr-accent-hover); }
.sr-cartbar__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    font-variant-numeric: tabular-nums;
}
.sr-cartbar__label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-cartbar__total { font-variant-numeric: tabular-nums; }
.sr-cartbar.is-bumped .sr-cartbar__count { animation: sr-bump .35s var(--sr-ease); }
@keyframes sr-bump { 40% { transform: scale(1.25); } }

html.sr-has-cartbar body { padding-bottom: 84px; }

/* ---------------------------------------------------------------------
   Tiroir du panier (feuille en bas sur mobile, panneau à droite sur ordinateur)
   --------------------------------------------------------------------- */

.sr-drawer { position: fixed; inset: 0; z-index: 99990; visibility: hidden; }
.sr-drawer.is-open { visibility: visible; }
.sr-drawer__backdrop { position: absolute; inset: 0; background: rgba(20, 22, 30, .5); opacity: 0; transition: opacity .25s; }
.sr-drawer.is-open .sr-drawer__backdrop { opacity: 1; }

.sr-drawer__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    max-height: 92dvh;
    background: var(--sr-paper);
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    transition: transform .3s var(--sr-ease);
}
.sr-drawer.is-open .sr-drawer__panel { transform: none; }

@media (min-width: 768px) {
    .sr-drawer__panel {
        left: auto;
        top: 0;
        width: 440px;
        max-height: none;
        border-radius: 0;
        transform: translateX(100%);
    }
}

.sr-drawer__head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 14px 10px 20px;
    border-bottom: 1px solid var(--sr-line);
}
.sr-drawer__title { flex: 1; margin: 0; font-size: 19px; font-weight: 800; }
.sr-drawer__back, .sr-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sr-soft);
    color: var(--sr-ink);
}
.sr-drawer__back[hidden] { display: none; }
.sr-drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; -webkit-overflow-scrolling: touch; }
.sr-drawer__foot {
    display: grid;
    gap: 10px;
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--sr-line);
    background: var(--sr-paper);
}
.sr-drawer__resto { margin: 0 0 8px; font-weight: 700; color: var(--sr-muted); font-size: 14px; }

.sr-lines { display: grid; }
.sr-line {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    grid-template-areas: "img body total" "img stepper stepper";
    gap: 4px 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--sr-line);
}
.sr-line__img { grid-area: img; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--sr-soft); align-self: start; }
.sr-line__body { grid-area: body; display: grid; gap: 2px; min-width: 0; }
.sr-line__name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.sr-line__unit { font-size: 13px; color: var(--sr-muted); font-variant-numeric: tabular-nums; }
.sr-line__total { grid-area: total; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; align-self: start; }
.sr-line .sr-stepper { grid-area: stepper; justify-self: start; height: 36px; box-shadow: none; }
.sr-line .sr-stepper__btn { width: 34px; height: 34px; }

.sr-totals { margin: 14px 0 0; }
.sr-totals div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.sr-totals dt { margin: 0; color: var(--sr-ink-2); }
.sr-totals dd { margin: 0; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.sr-drawer .sr-alert { margin-top: 12px; }

.sr-pay { display: grid; gap: 6px; }
.sr-pay__method {
    margin: 0;
    padding: 12px 14px;
    border: 1.5px solid var(--sr-ink);
    border-radius: var(--sr-radius-sm);
    font-weight: 600;
    font-size: 15px;
}

/* Confirmation */
.sr-done { text-align: center; padding: 18px 0 6px; }
.sr-done__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--sr-ok-soft);
    color: var(--sr-ok);
    animation: sr-pop .45s var(--sr-ease);
}
.sr-done__mark svg { width: 38px; height: 38px; }
.sr-done__number { margin: 16px 0 6px; font-size: 22px; font-weight: 800; }
.sr-done__text { margin: 0 auto; max-width: 34ch; color: var(--sr-ink-2); line-height: 1.5; }
.sr-done .sr-totals { text-align: left; margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--sr-line); }
@keyframes sr-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------------
   Boîte de dialogue
   --------------------------------------------------------------------- */

.sr-dialog {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    background: rgba(20, 22, 30, .5);
}
@media (min-width: 600px) { .sr-dialog { align-items: center; } }
.sr-dialog__panel {
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 22px;
    border-radius: 20px;
    background: var(--sr-paper);
    box-shadow: var(--sr-shadow);
    animation: sr-rise .22s var(--sr-ease);
}
.sr-dialog__title { margin: 0 0 8px; font-size: 19px; font-weight: 800; line-height: 1.3; }
.sr-dialog__text { margin: 0 0 16px; color: var(--sr-ink-2); line-height: 1.5; }
.sr-dialog .sr-field { margin-bottom: 16px; }
.sr-dialog .sr-history { margin-bottom: 16px; }
.sr-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes sr-rise { from { transform: translateY(16px); opacity: 0; } }

/* ---------------------------------------------------------------------
   Notifications
   --------------------------------------------------------------------- */

.sr-toasts {
    position: fixed;
    left: 50%;
    top: 16px;
    z-index: 100001;
    display: grid;
    gap: 8px;
    width: min(92vw, 420px);
    transform: translateX(-50%);
    pointer-events: none;
}
.sr-toast {
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--sr-ink);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    box-shadow: var(--sr-shadow);
    animation: sr-drop .25s var(--sr-ease);
    transition: opacity .35s, transform .35s;
}
.sr-toast--success { background: #10603a; }
.sr-toast--error { background: #9b1d23; }
.sr-toast--warn { background: #8a4a05; }
.sr-toast.is-leaving { opacity: 0; transform: translateY(-8px); }
@keyframes sr-drop { from { transform: translateY(-12px); opacity: 0; } }

/* ---------------------------------------------------------------------
   Suivi client
   --------------------------------------------------------------------- */

.sr-track { max-width: 760px; margin: 0 auto; }
.sr-track__loading, .sr-app__loading { padding: 40px 0; text-align: center; color: var(--sr-muted); }
.sr-track__title { margin: 0 0 16px; font-size: 24px; font-weight: 800; }

.sr-track__card {
    padding: 22px;
    border-radius: 20px;
    background: var(--sr-soft);
    margin-bottom: 18px;
}
.sr-track__card.is-failed { background: #fdf1f1; }
.sr-track__meta { margin: 0 0 6px; color: var(--sr-muted); font-size: 14px; font-weight: 600; }
.sr-track__headline { margin: 0 0 18px; font-size: 24px; font-weight: 800; line-height: 1.2; }

.sr-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0 0 18px; }
.sr-progress__step { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; }
.sr-progress__step::before {
    content: "";
    position: absolute;
    top: 7px;
    left: calc(-50% + 9px);
    right: calc(50% + 9px);
    height: 3px;
    border-radius: 3px;
    background: var(--sr-line);
}
.sr-progress__step:first-child::before { display: none; }
.sr-progress__step.is-done::before, .sr-progress__step.is-current::before { background: var(--sr-ok); }
.sr-progress__dot {
    position: relative;
    z-index: 1;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 3px solid var(--sr-line);
    background: var(--sr-paper);
}
.sr-progress__step.is-done .sr-progress__dot { border-color: var(--sr-ok); background: var(--sr-ok); }
.sr-progress__step.is-current .sr-progress__dot { border-color: var(--sr-ok); box-shadow: 0 0 0 5px rgba(23, 128, 74, .18); animation: sr-pulse 1.8s infinite; }
.sr-progress__label { font-size: 12px; font-weight: 600; color: var(--sr-muted); line-height: 1.25; }
.sr-progress__step.is-current .sr-progress__label { color: var(--sr-ink); }
@keyframes sr-pulse { 50% { box-shadow: 0 0 0 9px rgba(23, 128, 74, 0); } }

.sr-track__resto { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sr-track__resto-name { font-weight: 700; color: var(--sr-ink) !important; }

.sr-track__grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .sr-track__grid { grid-template-columns: 1.2fr 1fr; } }
.sr-track__block { padding: 18px; border: 1px solid var(--sr-line); border-radius: var(--sr-radius); }
.sr-track__block h3 { margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.sr-track__note { margin: 10px 0 0; font-style: italic; color: var(--sr-ink-2); }
.sr-track__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.sr-receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.sr-receipt li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-receipt__total { display: flex; justify-content: space-between; margin: 8px 0 4px; padding-top: 10px; border-top: 1.5px dashed var(--sr-line); font-weight: 800; font-size: 17px; }

.sr-history li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid var(--sr-line); font-size: 14px; }
.sr-history li:last-child { border-bottom: 0; }
.sr-history__time { color: var(--sr-muted); font-variant-numeric: tabular-nums; }
.sr-history__label { font-weight: 700; }
.sr-history__note { grid-column: 2; color: var(--sr-ink-2); font-style: italic; }

.sr-orderlist { display: grid; gap: 10px; margin-bottom: 26px; }
.sr-orderlist__item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--sr-line);
    border-radius: var(--sr-radius);
    color: var(--sr-ink) !important;
    text-decoration: none !important;
    transition: border-color .15s;
}
.sr-orderlist__item:hover { border-color: var(--sr-ink-2); }
.sr-orderlist__main { display: grid; gap: 4px; min-width: 0; }
.sr-orderlist__main strong { font-weight: 700; font-size: 16px; }
.sr-orderlist__main .sr-muted { font-size: 13.5px; }
.sr-orderlist__side { display: grid; justify-items: end; gap: 6px; }
.sr-orderlist__total { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.sr-lookup { padding: 20px; border-radius: var(--sr-radius); background: var(--sr-soft); }
.sr-lookup h3 { margin: 0; font-size: 17px; font-weight: 800; }
.sr-lookup__row { display: grid; gap: 12px; }
@media (min-width: 600px) { .sr-lookup__row { grid-template-columns: 1fr 1fr; } }
.sr-lookup .sr-btn { justify-self: start; }

/* ---------------------------------------------------------------------
   Accessibilité : mouvements réduits
   --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .sr-drawer__panel, .sr-drawer__backdrop, .sr-toast, .sr-dialog__panel, .sr-done__mark, .sr-progress__dot, .sr-cartbar__count {
        transition: none !important;
        animation: none !important;
    }
}

.screen-reader-text:not(:focus) {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
