/* ============================================================
   Commande Photo — Interface client PWA
   Mobile-first · Touch-optimized · min-width 320px
   ============================================================ */

:root {
    --primary:      #00a651;
    --primary-dark: #007a3d;
    --success:      #34a853;
    --danger:       #ea4335;
    --warning:      #fbbc04;
    --bg:           #f1f3f4;
    --surface:      #ffffff;
    --border:       #dadce0;
    --text:         #202124;
    --text2:        #5f6368;
    --text3:        #9aa0a6;
    --radius:       12px;
    --shadow:       0 1px 3px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   En-tête
   ============================================================ */
.app-header {
    background: #ffffff;
    border-bottom: 3px solid var(--primary);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.header-logo-img {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.header-subtitle {
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* ============================================================
   Barre d'étapes
   ============================================================ */
.step-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.step-bar::-webkit-scrollbar { display: none; }

.step {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 6px;
    gap: 3px;
    opacity: .45;
    position: relative;
    transition: opacity .2s;
}
.step.active { opacity: 1; }
.step.done   { opacity: .75; }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
    transition: background .2s, color .2s;
}
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done   .step-num { background: var(--success);  color: #fff; }

.step-label {
    font-size: 10px;
    color: var(--text2);
    white-space: nowrap;
}

/* Connecteurs entre étapes */
.step::before, .step::after {
    content: '';
    position: absolute;
    top: 22px;
    height: 2px;
    background: var(--border);
}
.step:not(:first-child)::before { left: 0;   width: calc(50% - 14px); }
.step:not(:last-child)::after   { right: 0;  width: calc(50% - 14px); }

/* ============================================================
   Contenu principal
   ============================================================ */
.app-main {
    flex: 1;
    padding: 14px 14px 120px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================================
   Panneaux d'étapes
   ============================================================ */
.step-panel         { display: none; }
.step-panel.active  { display: block; }

/* ============================================================
   Carte
   ============================================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px 16px;
    box-shadow: var(--shadow);
    margin: 0 auto 12px;
    max-width: 680px;
    width: 100%;
}
.card h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}
.step-intro {
    color: var(--text2);
    font-size: 14px;
    margin-bottom: 18px;
    line-height: 1.4;
}

/* ============================================================
   Formulaire (étape 1)
   ============================================================ */
.form-group          { margin-bottom: 14px; }
.form-group:last-of-type { margin-bottom: 0; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: 5px;
}
.optional { font-weight: 400; color: var(--text3); }

.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=tel] {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 16px;   /* 16px min evite le zoom iOS */
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
}
.form-group input:focus  { border-color: var(--primary); }
.form-group input.error  { border-color: var(--danger); }

/* ============================================================
   RGPD / Checkbox
   ============================================================ */
.rgpd-notice {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text2);
    border: 1px solid var(--border);
}
.checkbox-label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.4;
}
.checkbox-label input[type=checkbox] {
    margin-top: 1px;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}
.checkbox-label a { color: var(--primary); text-decoration: underline; }

/* ============================================================
   Zone d'upload (étape 2)
   ============================================================ */
.upload-zone {
    background: var(--surface);
    border: 2.5px dashed var(--primary);
    border-radius: var(--radius);
    padding: clamp(8px, 1.8vh, 22px) 16px;
    text-align: center;
    cursor: pointer;
    margin: 0 auto 10px;
    max-width: 600px;
    width: 100%;
    position: relative;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.upload-zone:active { background: #e0f5eb; }

.upload-icon  { font-size: clamp(26px, 4vh, 38px); margin-bottom: clamp(3px, 0.8vh, 7px); }
.upload-text  { font-size: 16px; font-weight: 600; color: var(--primary); margin-bottom: 3px; }
.upload-sub   { font-size: 13px; color: var(--text3); }

.file-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    font-size: 0;
}

/* Bouton "Prendre une photo" — affiché par JS uniquement si caméra détectée */
.upload-capture-wrap {
    display: none;   /* JS passe à 'block' si navigator.mediaDevices détecte une caméra */
    margin: 0 auto 10px;
    max-width: 600px;
    width: 100%;
}

.upload-capture-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: clamp(8px, 1.3vh, 12px) 16px;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.upload-capture-btn:active { background: #e0f5eb; }


/* ============================================================
   Cartes photo
   ============================================================ */
.photos-list { }

/* Base commune */
@keyframes card-highlight {
    0%   { box-shadow: 0 0 0 3px var(--primary), var(--shadow); background: #e6f7ee; }
    65%  { box-shadow: 0 0 0 3px var(--primary), var(--shadow); background: #e6f7ee; }
    100% { box-shadow: var(--shadow);                           background: var(--surface); }
}
.photo-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}
.photo-card--new { animation: card-highlight 1.4s ease-out forwards; }

/* Portrait : image + contrôles en haut (2 colonnes), pied pleine largeur */
.photo-card--portrait {
    display: grid;
    grid-template-columns: 46% 1fr;
    grid-template-areas:
        "preview controls"
        "footer  footer";
    column-gap: 10px;
    row-gap: 10px;
    align-items: start;
}
.photo-card--portrait .photo-preview-wrap { grid-area: preview; }
.photo-card--portrait .photo-controls     { grid-area: controls; min-width: 0; }
.photo-card--portrait .photo-footer       { grid-area: footer; }

/* Paysage : tout empilé verticalement, footer déjà pleine largeur */
.photo-card--landscape .photo-preview-wrap {
    width: 100%;
    margin-bottom: 10px;
}

/* Pied de carte partagé (cadrage + dupliquer + supprimer) */
.photo-footer {
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Conteneur canvas — aspect-ratio piloté par style inline */
.photo-canvas-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #e8eaed;
    border: 1px solid #161616;
}
.photo-canvas-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Petit spinner en coin quand preview locale disponible mais upload en cours */
.photo-upload-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.6);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

/* Overlay upload / erreur */
.photo-status-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    gap: 5px;
}

/* Bouton supprimer */
.photo-delete-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--text3);
    font-size: 12px;
    padding: 8px 0 2px;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.photo-delete-btn:active { color: var(--danger); }

/* Message d'erreur */
.photo-error-msg {
    font-size: 12px;
    color: var(--danger);
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Label de section (au-dessus d'un contrôle) */
.ctrl-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: 3px;
    margin-top: 8px;
}

/* Sélecteur de format pleine largeur */
.format-select {
    display: block;
    width: 100%;
    height: 36px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 0 8px;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    -webkit-appearance: auto;
    margin-bottom: 6px;
}
.format-select:focus { outline: none; border-color: var(--primary); }

/* Boutons d'action pleine largeur */
.btn-ctrl-wide {
    display: block;
    width: 100%;
    font-size: 11px;
    color: var(--primary);
    background: none;
    border: 1px solid var(--primary);
    border-radius: 5px;
    padding: 6px 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
    margin-bottom: 6px;
}
.btn-ctrl-wide:active { background: #e0f5eb; }

/* Variante "Dupliquer" — secondaire, moins accentuée */
.btn-ctrl-duplicate {
    color: var(--text2);
    border-color: var(--border);
    margin-top: 4px;
}
.btn-ctrl-duplicate:active { background: var(--bg); }

/* Quantité */
.qty-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    margin-bottom: 8px;
}
.qty-label {
    font-size: 12px;
    color: var(--text2);
    flex-shrink: 0;
}
.qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { background: #e0f5eb; }
.qty-value {
    font-size: 16px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}
.qty-prix {
    flex: 0 0 100%;   /* nouvelle ligne, pleine largeur */
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* Cadrage fit/fill */
.rendu-toggle {
    display: flex;
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.rendu-btn {
    flex: 1;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text2);
    -webkit-tap-highlight-color: transparent;
}
.rendu-btn.active { background: var(--primary); color: #fff; }
.rendu-btn:not(.active):active { background: #e0f5eb; }

/* ============================================================
   Barre total (étape 2, sticky)
   ============================================================ */
.total-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    background: #f0faf4;
}
.total-label  { font-size: 13px; color: var(--text2); flex: 1; }
.total-amount { font-size: 18px; font-weight: 700; color: var(--text); }
.total-info   { font-size: 11px; color: var(--primary); font-weight: 600; white-space: nowrap; }

/* ============================================================
   Récapitulatif (étape 3)
   ============================================================ */
.recap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 14px;
}
.recap-table th {
    text-align: left;
    font-size: 11px;
    color: var(--text3);
    font-weight: 500;
    padding: 4px 4px 8px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.recap-table td {
    padding: 8px 4px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}
.recap-table tr:last-child td { border-bottom: none; }
.recap-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--border);
}
.recap-photo-icon {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.total-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 0;
    border-top: 2px solid var(--border);
    font-size: 17px;
    font-weight: 700;
}

/* ============================================================
   Confirmation (étape 4)
   ============================================================ */
.confirmation-card { text-align: center; padding: 24px 16px 24px; }

/* Icône ✓ dans un carré arrondi vert */
.confirm-check-wrap {
    width: 72px; height: 72px;
    background: var(--primary);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.confirm-check-wrap svg { width: 44px; height: 44px; }

.confirm-title {
    font-size: 32px; font-weight: 800;
    line-height: 1.2; margin: 0 0 18px;
    color: var(--text);
}

.order-number {
    font-size: 24px; font-weight: 800;
    color: var(--primary); letter-spacing: 2px;
    margin: 0 auto 14px; padding: 10px 28px;
    background: #e0f5eb; border-radius: 50px;
    display: inline-block;
}

.confirm-photos-total {
    font-size: 17px; font-weight: 600;
    color: var(--text); margin: 0 0 18px;
}

.confirm-rdv-label {
    font-size: 12px; color: var(--text3);
    text-align: left; margin: 0 0 5px;
}

.confirm-shop-box {
    display: block;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 16px; margin-bottom: 6px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}
.confirm-shop-box:hover { background: #f0faf4; }
.confirm-shop-itineraire {
    font-size: 12px; color: var(--primary);
    margin-top: 6px; font-weight: 600;
}
.confirm-shop-name {
    color: var(--primary); font-weight: 700;
    font-size: 15px; margin-bottom: 3px;
}
.confirm-shop-addr { color: var(--text); font-size: 14px; }

.confirm-rdv-suite {
    font-size: 13px; color: var(--text2);
    text-align: left; margin: 0 0 10px;
}

.confirm-payment-note {
    font-size: 13px; color: var(--primary);
    text-align: left; margin: 0 0 8px;
}

.confirm-delai-label {
    font-size: 12px; color: var(--text3);
    text-align: left; margin: 0 0 2px;
}

.confirm-delai {
    font-size: 26px; font-weight: 800;
    color: var(--text); margin: 0 0 12px;
}

.confirm-email-note {
    font-size: 12px; color: var(--text3);
    text-align: left; margin: 0 0 10px;
    display: flex; align-items: center; gap: 6px;
}
.confirm-email-dot { color: var(--primary); font-size: 9px; flex-shrink: 0; }

.confirm-sep {
    border: none; border-top: 1px solid var(--border);
    margin: 4px 0 16px;
}

.confirm-contact {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px; margin-bottom: 20px;
}
.confirm-contact a {
    color: var(--primary); text-decoration: none; font-size: 14px;
}
.confirm-new-btn { width: 100%; display: block; }

/* ============================================================
   Boutons
   ============================================================ */
.btn {
    height: 48px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 22px;
    transition: background .15s, opacity .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:active            { background: var(--primary-dark); }
.btn-primary:disabled          { background: var(--border); color: var(--text3); cursor: not-allowed; }

.btn-success          { background: var(--success); color: #fff; }
.btn-success:active   { opacity: .85; }
.btn-success:disabled { background: var(--border); color: var(--text3); cursor: not-allowed; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:active { background: #e0f5eb; }

/* Bouton "Ajouter Photos" dans la barre de navigation bas
   → taille fixe pour laisser de la place au bouton "Suivant" */
.btn-add-photos {
    flex: 0 0 auto !important;
    font-size: 13px;
    line-height: 1.25;
    padding: 0 14px;
    min-width: 90px;
}

/* ============================================================
   FAB — Bouton flottant "Ajouter des photos"
   Apparaît dès qu'une photo est présente (JS toggle)
   ============================================================ */
.fab-add {
    position: fixed;
    bottom: 80px;        /* au-dessus de la barre de navigation */
    right: 16px;
    z-index: 90;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 28px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    display: none;       /* masqué par défaut — JS le montre */
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(0,166,81,.45);
    cursor: pointer;
    transition: opacity .2s, transform .2s;
    -webkit-tap-highlight-color: transparent;
}
.fab-add:active { opacity: .85; transform: scale(.96); }

/* ============================================================
   Navigation bas de page
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    max-width: 1200px;
    margin: 0 auto;
}
.bottom-nav-btns {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
}
.bottom-nav-btns .btn { flex: 1; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-body {
    padding: 16px;
    font-size: 14px;
    color: var(--text2);
    line-height: 1.65;
}
.modal-body p { margin-bottom: 12px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.modal-footer .btn { width: 100%; }

/* Avertissement résolution insuffisante */
.resolution-warn {
    font-size: 11px;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 5px 8px;
    margin: 4px 0 6px;
    line-height: 1.4;
}

/* Bouton retry upload échoué */
.btn-retry {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1.5px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.btn-retry:active { background: #e6f7ee; }

/* Boutons de choix de format (modal duplication) */
.format-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 18px 16px;
    margin-bottom: 10px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
}
.format-choice-btn:last-of-type { margin-bottom: 0; }
.format-choice-btn:active,
.format-choice-btn:focus-visible {
    border-color: var(--primary);
    background: #e6f7ee;
    outline: none;
}
.format-choice-label {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
}
.format-choice-price {
    font-size: 13px;
    color: var(--text2);
    font-weight: 400;
}

/* ============================================================
   Spinner de chargement
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #e0e0e0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .65s linear infinite;
}

/* ============================================================
   Notice d'erreur inline
   ============================================================ */
.error-notice {
    background: #fce8e6;
    color: var(--danger);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* ============================================================
   En-tête — info boutique
   ============================================================ */
.header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.header-boutique-name {
    font-size: 10px;
    color: var(--text3);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* ============================================================
   Bandeau "Comment ça marche" (étape 1)
   ============================================================ */
.how-it-works {
    background: var(--surface);
    border-radius: var(--radius);
    padding: clamp(8px, 1.5vh, 12px) 16px clamp(6px, 1.2vh, 10px);
    box-shadow: var(--shadow);
    margin: 0 auto clamp(6px, 1.2vh, 12px);
    max-width: 600px;
    width: 100%;
    border-left: 3px solid var(--primary);
}
.how-it-works-steps {
    display: flex;
    gap: 4px;
    align-items: flex-start;
    margin-bottom: clamp(6px, 1vh, 10px);
}
.how-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
    position: relative;
    padding: 0 4px;
}
.how-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -5px;
    top: 9px;
    font-size: 13px;
    color: var(--text3);
}
.how-step-icon  { font-size: 22px; line-height: 1; }
.how-step-label { font-size: 10px; color: var(--text2); line-height: 1.3; }
.how-it-works-note {
    font-size: 11px;
    color: var(--text3);
    text-align: center;
    line-height: 1.4;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin: 0;
}

/* ============================================================
   Bloc coordonnées boutique (étapes 2-4)
   ============================================================ */
.shop-contact {
    background: #f0faf4;
    border: 1px solid #b2dfcc;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text2);
    line-height: 1.65;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 12px auto 0;
    max-width: 680px;
    width: 100%;
}
.shop-contact-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.shop-contact-name { font-weight: 600; color: var(--text); font-size: 14px; }
.shop-contact a    { color: var(--primary); text-decoration: none; }

/* Variante centrée — étapes 2 et 3 (tout empilé, centré, sans icône 🏪) */
.shop-contact--centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 14px 16px;
}
.shop-contact--centered .shop-contact-name {
    font-size: 15px;
    margin-bottom: 2px;
}

/* Variante carte de visite — étape 1 (logo centré + infos dessous) */
.shop-contact--card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(6px, 1.2vh, 10px);
    padding: clamp(8px, 1.5vh, 14px) 20px;
}
.shop-contact-logo {
    max-width: 150px;
    width: 55%;
    height: auto;
    display: block;
}
.shop-contact-card-body { line-height: 1.6; }
/* Le logo fait déjà office de nom — on masque la ligne texte en mode carte */
.shop-contact--card .shop-contact-name { display: none; }

/* Sentinelle invisible en bas de l'étape 2 */
#step2Sentinel { height: 1px; margin: 0; padding: 0; }

/* ============================================================
   Desktop
   ============================================================ */
/* ============================================================
   Tablette — ≥ 640 px : 2 colonnes de photos
   ============================================================ */
@media (min-width: 640px) {
    .app-main { padding: 20px 20px 90px; }

    .bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        border-radius: 0;
    }
    .modal-overlay { align-items: center; }

    /* Grille 2 colonnes */
    .photos-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        align-items: start;
    }
    .photo-card { margin-bottom: 0; }
}

/* ============================================================
   Desktop — ≥ 980 px : 3 colonnes de photos
   ============================================================ */
@media (min-width: 980px) {
    .photos-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   Grand écran — ≥ 1300 px : 4 colonnes de photos
   ============================================================ */
@media (min-width: 1300px) {
    .photos-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================================
   Bouton "Modifier" sur la vignette + badge "édité"
   ============================================================ */
.photo-canvas-container { position: relative; }

.photo-edit-btn {
    position: absolute;
    bottom: 6px;
    left: 6px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: background .15s;
    z-index: 2;
}
.photo-edit-btn:hover { background: rgba(0,0,0,.75); }

.photo-edit-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ============================================================
   Boutons de choix (dialog Remplacer / Ajouter)
   ============================================================ */
.choice-btn {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-family: inherit;
}
.choice-btn:hover { border-color: var(--primary); background: #f0faf5; }
.choice-btn strong { font-size: 14px; color: var(--text); }
.choice-btn span   { font-size: 12px; color: var(--text2); }

/* ============================================================
   Éditeur photo — modal plein écran
   ============================================================ */
.editor-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 300;
    display: flex;
    flex-direction: column;
}

.editor-modal {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #111;
    flex-shrink: 0;
}

.editor-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.editor-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-apply-btn {
    padding: 7px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* Zone de prévisualisation */
.editor-frame-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    padding: 12px;
    min-height: 0;
}

.editor-frame {
    position: relative;
    overflow: hidden;
    cursor: grab;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.editor-frame:active { cursor: grabbing; }

.editor-frame img {
    display: block;
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    will-change: transform;
}

/* Onglets */
.editor-tabs {
    display: flex;
    background: #1a1a1a;
    border-top: 1px solid #333;
    flex-shrink: 0;
}

.editor-tab {
    flex: 1;
    padding: 10px 4px;
    background: none;
    border: none;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    font-family: inherit;
}

.editor-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Panneaux */
.editor-panel {
    display: none;
    padding: 16px;
    background: #1a1a1a;
    flex-shrink: 0;
    color: #ddd;
}

.editor-panel.active { display: block; }

.editor-hint {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-bottom: 12px;
}

.editor-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.editor-slider-lbl {
    font-size: 12px;
    color: #aaa;
    width: 80px;
    flex-shrink: 0;
}

.editor-slider-row input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.editor-slider-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
}

.editor-slider-val {
    font-size: 12px;
    color: #aaa;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.editor-reset-btn {
    display: block;
    margin: 0 auto;
    padding: 6px 18px;
    background: rgba(255,255,255,.1);
    color: #ccc;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.editor-filter-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 8px 0;
}

.editor-filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 10px;
    color: #ccc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s;
    font-family: inherit;
    min-width: 70px;
}

.editor-filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

.editor-filter-icon {
    font-size: 24px;
    display: block;
}
