/* Explain: Homepage specific styling for layout and sections. */
/* MARKET HOME — Mark Food : conteneur, titres, recherche, catégories, cartes restaurant */

/* ---------- Conteneur ---------- */
.wrap {
    max-width: 1200px;
    margin-inline: auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap > .dgrid,
.wrap > .olist,
.wrap > .sgrid { margin-top: 6px; }

/* ---------- Titre de page ---------- */
.ptitle { padding-block: 16px 6px; }
.ptitle h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 2rem);
    letter-spacing: -0.035em;
    line-height: 1.1;
}
.ptitle p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 44ch;
}

/* ---------- Bouton « Tout voir » ---------- */
.more {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--food);
}
.more:focus-visible { outline: 2px solid var(--food); outline-offset: 3px; }

/* ---------- Onglets Plats / Restaurants (recherche) ---------- */
.sgc {
    position: relative;
    display: flex;
    gap: 2px;
    width: 100%;
    margin-top: 14px;
    padding: 4px;
    border-radius: 999px;
    background: var(--glass-strong);
    box-shadow: inset 0 0 0 1px var(--stroke);
}
.sgi {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 10px) / 2);
    border-radius: 999px;
    background: var(--fg);
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.15, 1);
    z-index: 0;
    pointer-events: none;
}
.sgc[data-v="restos"] .sgi { transform: translateX(calc(100% + 2px)); }
.sgb {
    position: relative;
    z-index: 1;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 8px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
    background: none;
    transition: color 0.3s;
}
.sgb:focus-visible { outline: 2px solid var(--food); outline-offset: 3px; }
.sgb b {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    font-style: normal;
    color: var(--fg);
    background: var(--glass-strong);
    box-shadow: inset 0 0 0 1px var(--stroke);
}
.sgb[aria-selected="true"] { color: var(--bg); }
.sgb[aria-selected="true"] b { color: var(--bg); background: var(--glass-strong); box-shadow: none; }

/* ---------- Grilles et rails de restaurants ---------- */
.rgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 14px;
}
.rgrid .rc { width: auto; height: 100%; }
.rrow.hscroll { gap: 12px; }

/* ---------- Carte restaurant (liste de l'écran Restos) ---------- */
.mlist-r {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}
.mc {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 26px;
}
.mc-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px 6px;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
    color: var(--fg);
    font: inherit;
}
.mc-head > .mono { flex: none; }
.mc-head .rc-txt { flex: 1; min-width: 0; }
.mc-go {
    flex: none;
    display: grid;
    place-items: center;
    color: var(--muted);
}
.mc-go svg { width: 18px; height: 18px; }
.mc-stats { padding: 4px 16px 12px; }
.mc .mosaic { margin-top: auto; }

/* ---------- Statistiques (icônes SVG) ---------- */
.stats svg,
.rc-stats svg,
.mc-stats svg {
    width: 15px;
    height: 15px;
    flex: none;
    vertical-align: middle;
}

/* ---------- Carte vendeur (accueil) ---------- */
.sellcard > svg:last-child {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

/* ---------- Sélecteur d'adresse de l'accueil ---------- */
.loc {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 8px;
    border: 0;
    border-radius: 14px;
    background: none;
    cursor: pointer;
    color: var(--fg);
    font: inherit;
    text-align: center;
}
.loc:focus-visible {
    outline: 2px solid var(--food);
    outline-offset: 2px;
}
.loc .kick {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.loc strong {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.loc strong svg {
    width: 14px;
    height: 14px;
    flex: none;
}