/* tolbo v2 — feuille de style unique, pensée d'abord pour le téléphone */

:root {
    --brand: #F05025;
    --brand-dark: #C93D17;
    --text: #1F2328;
    --muted: #5F6672;
    --bg: #FFFFFF;
    --surface: #F6F7F9;
    --border: #E3E6EA;
    --radius: 10px;
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    /* place réservée pour que le pied de page fixe ne cache pas le bas des pages */
    padding-bottom: 48px;
}

a { color: var(--brand-dark); }

.topbar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--brand);
}

.logo {
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
}

.hero h1 {
    font-size: 24px;
    line-height: 1.25;
    margin: 8px 0;
}

.hero p { color: var(--muted); margin: 8px 0; }

.notice {
    display: inline-block;
    padding: 6px 10px;
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 14px;
}

.button {
    display: inline-block;
    padding: 12px 18px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.topbar { justify-content: space-between; }

.topnav a {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}

.muted { color: var(--muted); }
.small { font-size: 14px; }

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0 0 16px;
}

.card h1 { font-size: 22px; line-height: 1.25; margin: 4px 0 8px; }
.card h2 { font-size: 18px; margin: 0 0 8px; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

.eyebrow {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--brand-dark);
}

/* Formulaires : grands champs faciles à toucher */
.form label {
    display: block;
    font-weight: 600;
    margin: 14px 0 6px;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    font: inherit;
    font-size: 16px; /* 16 px : évite le zoom automatique sur iPhone */
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: 2px solid var(--brand);
    border-color: var(--brand);
}

.form .button { margin-top: 18px; }
.optional { font-weight: 400; color: var(--muted); }

.phone-field { display: flex; }
.phone-field .prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    font-weight: 600;
}
.phone-field input { border-radius: 0 var(--radius) var(--radius) 0; }

.code-input {
    font-size: 26px !important;
    letter-spacing: 6px;
    text-align: center;
}

.field-error { color: #B42318; font-size: 14px; margin: 6px 0 0; }

.flash {
    padding: 10px 12px;
    border-radius: var(--radius);
    margin: 0 0 16px;
    font-size: 15px;
}
.flash-succes { background: #E7F6EC; color: #1A6B35; }
.flash-erreur { background: #FDECEA; color: #8A1C12; }
.flash-info { background: #EAF2FD; color: #174A8B; }

.button { border: 0; cursor: pointer; font: inherit; font-weight: 600; text-align: center; }
.button.block { display: block; width: 100%; margin-top: 10px; }
.button.whatsapp { background: #1FAF5A; }
.button.ghost { background: var(--surface); color: var(--text); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }

.share-link {
    word-break: break-all;
    padding: 10px;
    background: var(--surface);
    border-radius: var(--radius);
    font-size: 15px;
}

.badge {
    display: inline-block;
    vertical-align: middle;
    padding: 2px 8px;
    border-radius: 999px;
    background: #E7F6EC;
    color: #1A6B35;
    font-size: 13px;
    font-weight: 600;
}

.shop-description { white-space: normal; }

.logout { text-align: center; }
.link-button {
    background: none;
    border: 0;
    color: var(--muted);
    text-decoration: underline;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

/* Pied de page : une fine barre orange fixée en bas de l'écran */
.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--brand);
    color: #fff;
    text-align: center;
    font-size: 13px;
}

.footer p { margin: 0; }
.footer a { color: #fff; }

@media (min-width: 768px) {
    .hero h1 { font-size: 32px; }
}

/* ---------- Catalogue ---------- */
.center { text-align: center; }
.hero.compact h1 { font-size: 22px; margin: 4px 0; }
.hero.compact p { margin: 0 0 12px; }
.section-title { font-size: 18px; margin: 20px 0 10px; }
.list-title { font-size: 20px; margin: 12px 0 0; }
.sub { font-size: 16px; margin: 18px 0 6px; }

/* Barre de recherche + ville : en haut, rien au-dessus */
.searchbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin: 0 0 12px;
}
.searchbar input[type=search] {
    grid-column: 1 / -1;
    font: inherit;
    font-size: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.searchbar select {
    font: inherit;
    font-size: 15px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    min-width: 0;
}
.searchbar .button { padding: 10px 16px; }

/* Catégories : une rangée qui défile au doigt */
.category-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 10px;
    margin: 0 0 4px;
    scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }
.category-strip a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.category-strip a.active { background: var(--brand); color: #fff; }
.category-strip small { color: var(--muted); }

/* Grille de produits : 2 colonnes sur téléphone */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    background: #fff;
}
.product-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--surface);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card.is-sold img { opacity: 0.55; }
.sold-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--text);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.product-info { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.product-price { font-weight: 700; color: var(--brand-dark); }
.product-title {
    font-size: 14px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-place { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { text-align: center; }
.cta { margin-top: 24px; text-align: center; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 16px 0; }

/* Fiche produit : photos qui défilent au doigt, sans script */
.gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 6px;
    border-radius: var(--radius);
    margin: 0 0 6px;
    background: var(--surface);
}
.gallery img {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    scroll-snap-align: center;
    background: #fff;
}
.gallery-hint { margin: 0 0 12px; text-align: center; }
.big-price { font-size: 24px; font-weight: 800; color: var(--brand-dark); margin: 4px 0 12px; }
.eyebrow a { color: inherit; text-decoration: none; }
.shop-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
    text-decoration: none;
}
.safety { text-align: center; }

/* Formulaire produit */
.photo-list, .photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.photo-item { display: flex; flex-direction: column; align-items: center; }
.photo-item img, .photo-preview img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.form input[type=file] { padding: 10px; background: var(--surface); }
.choice { border: 0; padding: 0; margin: 14px 0 0; }
.choice legend { font-weight: 600; margin-bottom: 6px; }
.choice label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 400; }
.form .choice input { width: auto; }
.button:disabled { opacity: 0.6; }

/* Espace vendeur : liste des produits */
.row-between { display: flex; align-items: center; justify-content: space-between; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.stats div { background: var(--surface); border-radius: var(--radius); padding: 10px; text-align: center; }
.stats strong { display: block; font-size: 22px; }
.stats span { font-size: 13px; color: var(--muted); }
.my-products { list-style: none; padding: 0; margin: 8px 0 0; }
.my-product { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.my-product img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: 0 0 64px; }
.my-product-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.my-product-title { font-weight: 600; color: var(--text); text-decoration: none; }
.my-product-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 5px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.chip.danger { color: #B42318; }
.status { font-weight: 600; }
.status-ok { color: #1A6B35; }
.status-sold { color: var(--muted); }
.status-off { color: #B42318; }

/* Boutons photo : appareil du téléphone ou galerie */
.form .label { font-weight: 600; margin: 14px 0 6px; }
.photo-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-buttons .button { padding: 12px 8px; font-size: 15px; }
.photo-button.is-disabled { opacity: 0.45; pointer-events: none; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.preview-item { position: relative; }
.preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: var(--text);
    color: #fff;
    font-size: 18px;
    line-height: 26px;
    cursor: pointer;
}

/* ---------- Simplicité ---------- */
.topnav { display: flex; align-items: center; gap: 14px; }
.sell-button {
    background: #fff;
    color: var(--brand-dark) !important;
    padding: 7px 14px;
    border-radius: 999px;
    font-weight: 700 !important;
}
.button.big { padding: 16px; font-size: 18px; }
.dash-head { margin: 0 0 16px; }
.dash-head h1 { font-size: 22px; margin: 2px 0 12px; }

.published { border-color: #1FAF5A; background: #F2FBF5; }
.published-title { font-size: 20px; font-weight: 800; color: #1A6B35; margin: 0 0 4px; }

.chip-whatsapp { background: #1FAF5A; border-color: #1FAF5A; color: #fff; }
.more { display: inline-block; position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more[open] { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 2px; }
.more[open] summary { display: none; }

.shop-settings summary { cursor: pointer; list-style: none; }
.shop-settings summary::-webkit-details-marker { display: none; }
.shop-settings summary h2 { display: inline; font-size: 16px; color: var(--brand-dark); }
.shop-settings summary h2::after { content: ' ▾'; }
.shop-settings[open] summary h2::after { content: ' ▴'; }

/* Barre de recherche sous l'en-tête (fiche produit, page boutique…) */
.topsearch {
    display: flex;
    gap: 6px;
    padding: 0 16px 12px;
    background: var(--brand);
}
.topsearch input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 16px;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--radius);
}
.topsearch button {
    border: 0;
    border-radius: var(--radius);
    padding: 0 14px;
    background: #fff;
    color: var(--brand-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

/* Couleur légère sur la recherche et le choix de la ville */
:root { --soft: #FFF3EE; --soft-border: #F7CDBE; }
.searchbar input[type=search],
.searchbar select {
    background: var(--soft);
    border-color: var(--soft-border);
}
.searchbar input[type=search]:focus,
.searchbar select:focus {
    outline: 2px solid var(--brand);
    border-color: var(--brand);
    background: #fff;
}
.topsearch input { background: var(--soft); }
.topsearch input:focus { background: #fff; outline: 2px solid #fff; }

/* Logo tolbo (lettres de couleur sur l'orange) */
.logo { display: flex; align-items: center; line-height: 0; }
.logo img { height: 32px; width: auto; display: block; }

/* Bouton « Installer l'appli » */
.install-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 0 0 16px;
    border-radius: var(--radius);
    background: var(--soft, #FFF3EE);
    border: 1px solid var(--soft-border, #F7CDBE);
}
.install-card[hidden] { display: none; }
.install-card img { border-radius: 12px; }
.install-text { display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.install-text span { color: var(--muted); }
.install-card .button { padding: 10px 14px; }
.install-ios { grid-column: 1 / -1; margin: 0; }

/* Carte d'installation en violet (couleur du « t » du logo) */
:root { --violet: #5D17E9; }
.install-card { background: var(--violet); border-color: var(--violet); color: #fff; }
.install-text span { color: rgba(255, 255, 255, 0.85); }
.install-card .button { background: #fff; color: var(--violet); }
.install-ios { color: #fff; }

/* Fenêtre « Installer tolbo » sur iPhone */
.ios-sheet {
    width: min(100% - 24px, 440px);
    max-height: 90vh;
    border: 0;
    border-radius: 16px;
    padding: 16px 18px 18px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
}
.ios-sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
.ios-sheet-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.ios-sheet-head img { border-radius: 8px; }
.ios-sheet-head h2 { flex: 1; margin: 0; font-size: 19px; }
.ios-close { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.ios-sheet ol { padding-left: 22px; margin: 6px 0 12px; }
.ios-sheet li { margin: 6px 0; }
.ios-key {
    display: inline-block;
    padding: 0 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    line-height: 20px;
    vertical-align: middle;
}
.ios-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 22px;
    border-radius: 6px;
    background: #1D6FE8;
    vertical-align: middle;
}
.ios-sheet .button[data-ios-done] { background: var(--violet, #5D17E9); }

/* Signalement et espace admin */
.report-link { display: block; margin-top: 6px; color: var(--muted); text-decoration: underline; }
.admin-tabs { margin-bottom: 12px; }
.admin-item .field-error { display: block; }
.admin-reason { width: 100%; margin: 6px 0; padding: 8px 10px; border: 1px solid var(--soft-border); border-radius: var(--radius); font: inherit; font-size: 16px; }
.admin-search { margin: 0 0 12px; padding: 0; background: none; }
.admin-search button { background: var(--brand); color: #fff; }
.admin-entry { margin-bottom: 14px; }
.given-code { font-size: 1.4em; letter-spacing: 3px; }
#code-donne .button { margin-top: 10px; }

/* Connexion gratuite par WhatsApp */
.button.big { padding: 16px; font-size: 1.1em; }
.steps { margin: 14px 0; padding-left: 20px; line-height: 1.8; }
.waiting { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; color: var(--muted); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--soft-border); border-top-color: #1FAF5A; border-radius: 50%; animation: tourne 0.9s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.help-box { margin-top: 10px; }
.help-box .form { margin-top: 10px; }

/* Boost */
.boost-tag { position: absolute; top: 8px; left: 8px; background: #FFC93C; color: #3D2B00; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.boost-tag.inline { position: static; display: inline-block; }
.chip-boost { background: #FFF6D6; border-color: #FFC93C; color: #6B4E00; font-weight: 600; }
.boost-product { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.boost-product img { border-radius: var(--radius); object-fit: cover; }
.boost-perks { list-style: none; padding: 0; margin: 12px 0; line-height: 2; }
.boost-price { font-size: 1.3em; margin: 10px 0; }

/* Logo de boutique */
.shop-logo { display: block; width: 72px; height: 72px; object-fit: contain; border-radius: 12px; border: 1px solid var(--border, #e5e5e5); background: #fff; margin: 0 0 10px; }

/* Reprise de l'ancien site (admin) */
.reprise-list { padding-left: 18px; margin: 12px 0; }
.reprise-list li { margin: 6px 0; }
.reprise-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.reprise-table td { padding: 6px 4px; border-top: 1px solid var(--border); vertical-align: top; }
.reprise-table td:last-child { text-align: right; white-space: nowrap; }
.reprise-run .spinner { display: inline-block; vertical-align: middle; margin-right: 6px; }

/* Liens vers les pages ville + catégorie (référencement) */
.nearby { margin: 24px 0 8px; }
.nearby .small-title { font-size: 16px; }
.nearby-links { list-style: none; padding: 0; margin: 8px 0 0; columns: 2; column-gap: 16px; font-size: 14px; }
.nearby-links li { margin: 0 0 8px; break-inside: avoid; }
.nearby-links a { color: var(--text); }

/* Textes de l'IA sur les pages ville (référencement) */
.seo-intro { margin: 4px 0 16px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.faq { margin: 24px 0 8px; }
.faq h3 { font-size: 15px; margin: 14px 0 4px; }
.faq p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
