/* marketplace.css — estudos MP001–MP003 (js/components/marketplace-studies.js).
   Sem marca própria: --mp-main / --mp-acc vêm do tema (TOMI ou cor do contexto)
   e a tinta (--mp-*-ink) é sempre preto ou branco pelo contraste.
   Área útil ≈ 946 × 1522 px — tudo cabe num ecrã, sem scroll. */
.mp-root { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; overflow: hidden;
  padding: 22px 26px 22px; background: #f3f2ef; color: #111; }
.mp-noimg { display: grid; place-items: center; width: 100%; height: 100%; background: #e9e6df; color: #111; }
.mp-noimg .tomi-icon { font-size: 48px; }
.mp-root .tomi-icon { flex: 0 0 auto; }

/* ---------- cabeçalho (sem hambúrguer) ---------- */
.mp-head { flex: 0 0 auto; display: flex; align-items: center; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid #e0ddd6; }
.mp-head__back { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; background: var(--mp-main); color: var(--mp-main-ink); }
.mp-head__back .tomi-icon { font-size: 36px; }
.mp-head__all { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 22px; border-radius: 999px; background: var(--mp-main); color: var(--mp-main-ink);
  font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 22px; text-transform: uppercase; }
.mp-head__all .tomi-icon { font-size: 22px; }
.mp-head div { flex: 1; min-width: 0; }
.mp-head small { display: block; font-size: 14px; font-weight: 800; letter-spacing: .14em; color: #5d6166; }
.mp-head h1 { margin: 4px 0 2px; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 52px; line-height: .95; text-transform: uppercase; }
.mp-head p { margin: 0; font-size: 18px; color: #5d6166; }

/* ---------- MP001 · destaque ---------- */
.mp-feat { flex: 0 0 250px; display: grid; grid-template-columns: 44% 1fr; border-radius: 26px; overflow: hidden; background: #fff; text-align: left;
  box-shadow: 0 16px 30px -24px rgba(0,0,0,.5); }
.mp-feat__img { position: relative; background: #fff; overflow: hidden; }
.mp-feat__img img, .mp-feat__img .mp-noimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.mp-feat__info { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 26px 30px; background: var(--mp-main); color: var(--mp-main-ink); }
.mp-feat__info small { font-size: 14px; font-weight: 800; letter-spacing: .14em; }
.mp-feat__info h2 { margin: 0; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 38px; line-height: 1; text-transform: uppercase; }
.mp-feat__info b { font-family: var(--ds-font-display); font-size: 36px; }
.mp-feat__info span { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; letter-spacing: .08em; }
.mp-feat__info span .tomi-icon { font-size: 18px; }

/* ---------- secções ---------- */
.mp-sec { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; }
.mp-sec > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.mp-sec small { display: block; font-size: 13px; font-weight: 800; letter-spacing: .14em; color: #5d6166; }
.mp-sec h3 { margin: 2px 0 0; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 32px; line-height: 1; text-transform: uppercase; }

/* escolher a loja — chips, como “Escolhe o teu clube” */
.mp-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mp-chip { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 96px; padding: 12px 14px; border-radius: 18px;
  background: #fff; color: #111; border: 2px solid transparent; text-align: left; }
.mp-chip i { font-style: normal; min-width: 44px; height: 38px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; background: var(--mp-main); color: var(--mp-main-ink);
  font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 17px; }
.mp-chip span { font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 16px; line-height: 1.05; text-transform: uppercase; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mp-chip.is-on { border-color: #111; box-shadow: 0 0 0 3px var(--mp-acc); }
.mp-chip--more i { background: var(--mp-acc); color: var(--mp-acc-ink); }

/* categorias — tons do tema, tinta automática */
.mp-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mp-cat { display: flex; align-items: center; gap: 12px; min-height: 96px; padding: 14px 16px; border-radius: 18px; text-align: left; border: 3px solid transparent; }
.mp-cat > .tomi-icon:first-child { font-size: 38px; }
.mp-cat > .tomi-icon:last-child { margin-left: auto; font-size: 20px; }
.mp-cat span { min-width: 0; }
.mp-cat b { display: block; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 20px; line-height: 1.05; text-transform: uppercase; }
.mp-cat small { display: block; margin-top: 4px; font-size: 13px; letter-spacing: 0; font-weight: 600; color: inherit; }
.mp-cat.is-on { border-color: #111; box-shadow: 0 0 0 3px #fff inset; }
.mp-cat.is-empty { opacity: .45; }

/* resultados — mudam no lugar; paginação em vez de scroll */
.mp-sec--results { flex: 1 1 auto; min-height: 0; }
.mp-pager { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.mp-pager button { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-main); color: var(--mp-main-ink); }
.mp-pager button:disabled { background: #d9d5cc; color: #111; opacity: .5; }
.mp-pager span { min-width: 54px; text-align: center; }
.mp-pager .mp-clear { width: auto; height: 52px; padding: 0 16px; border-radius: 999px; display: flex; gap: 6px; background: #fff; color: #111; border: 2px solid #111; }
.mp-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mp-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 16px; border-radius: 20px; background: #fff; text-align: left; min-height: 0; overflow: hidden; }
.mp-card__img { flex: 1 1 auto; min-height: 0; border-radius: 14px; overflow: hidden; background: #f1efe9; margin-bottom: 8px; }
.mp-card__img img { width: 100%; height: 100%; object-fit: cover; }
.mp-card small { padding: 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0; color: #5d6166; }
.mp-card b { padding: 0 6px; font-size: 19px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-card i { padding: 0 6px; font-style: normal; font-weight: 800; font-size: 20px; }
.mp-empty { grid-column: 1 / -1; align-self: center; text-align: center; font-size: 20px; color: #5d6166; }

/* banner do lugar (fundo) */
.mp-banner { flex: 0 0 auto; display: flex; align-items: center; gap: 20px; padding: 22px 26px; border-radius: 24px; background: var(--mp-main); color: var(--mp-main-ink); }
.mp-banner__mark { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-acc); color: var(--mp-acc-ink); }
.mp-banner__mark .tomi-icon { font-size: 38px; }
.mp-banner div { flex: 1; }
.mp-banner small { display: block; font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.mp-banner b { display: block; margin-top: 4px; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 32px; line-height: 1; text-transform: uppercase; }
.mp-banner em { font-style: normal; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 24px; text-transform: uppercase; padding: 12px 16px; border-radius: 14px; background: var(--mp-acc); color: var(--mp-acc-ink); }

/* camada "ver tudo" (lojas, categorias, produtos) */
.mp-layer { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end; background: rgba(0,0,0,.55); }
.mp-layer__panel { position: relative; width: 100%; max-height: 88%; display: flex; flex-direction: column; gap: 16px; padding: 26px; border-radius: 30px 30px 0 0; background: #fff; animation: mp-sheet-in .25s ease-out; }
.mp-layer__panel > header { display: flex; align-items: center; justify-content: space-between; }
.mp-layer__panel h2 { margin: 0; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 42px; text-transform: uppercase; }
.mp-layer__panel .mp-sheet__close { position: static; }
.mp-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mp-sheet-grid--chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mp-sheet-grid--chips .mp-chip { background: #f3f2ef; }
.mp-sheet-grid--products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mp-card--mini .mp-card__img { flex: 0 0 150px; }
.mp-card--mini b { font-size: 16px; }
.mp-card--mini i { font-size: 16px; }

/* ================= MP002 · montra curada ================= */
.mp2-pick { flex: 0 0 470px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 28px; overflow: hidden; background: var(--mp-main); color: var(--mp-main-ink); text-align: left; }
.mp2-pick__img { position: relative; }
.mp2-pick__img img, .mp2-pick__img .mp-noimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp2-pick__info { padding: 30px 30px; display: flex; flex-direction: column; gap: 12px; }
.mp2-tag { align-self: flex-start; font-size: 14px; font-weight: 800; letter-spacing: .12em; padding: 8px 12px; border-radius: 8px; background: var(--mp-acc); color: var(--mp-acc-ink); }
.mp2-why { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.mp2-why .tomi-icon { font-size: 22px; }
.mp2-pick h2 { margin: 6px 0 0; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 42px; line-height: 1; text-transform: uppercase; }
.mp2-pick small { font-size: 20px; }
.mp2-pick__foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.mp2-pick__foot b { font-family: var(--ds-font-display); font-size: 38px; }
.mp2-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 14px; background: var(--mp-acc); color: var(--mp-acc-ink); font-weight: 800; font-size: 20px; }
.mp2-cta .tomi-icon { font-size: 28px; }
.mp2-sec { flex: 0 0 auto; }
.mp2-sec:nth-of-type(1) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mp2-sec header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.mp2-sec h3 { margin: 0; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 32px; text-transform: uppercase; }
.mp2-sec header span { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; color: #5d6166; }
.mp2-sec header span .tomi-icon { color: #111; }
.mp2-top { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mp2-card { position: relative; background: #fff; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; text-align: left; min-height: 0; }
.mp2-card em { position: absolute; top: 12px; left: 12px; z-index: 1; font-style: normal; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 22px; padding: 4px 10px; border-radius: 8px; background: var(--mp-main); color: var(--mp-main-ink); }
.mp2-card > img, .mp2-card > .mp-noimg { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: cover; }
.mp2-card b { padding: 12px 16px 0; font-size: 19px; line-height: 1.25; }
.mp2-card small { padding: 4px 16px 0; font-size: 15px; color: #5d6166; }
.mp2-card__foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 14px; font-size: 16px; }
.mp2-card__foot i { font-style: normal; font-weight: 800; }
.mp2-card__foot u { display: flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 700; }
.mp2-card__foot u .tomi-icon { font-size: 16px; color: #111; }
.mp2-shops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mp2-shop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; background: #fff; border-radius: 18px; text-align: center; }
.mp2-shop img, .mp2-shop .mp-noimg { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.mp2-shop b { font-size: 16px; line-height: 1.2; }
.mp2-shop small { font-size: 14px; color: #5d6166; }

/* ================= MP003 · compra por conversa ================= */
.mp3-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; }
.mp3-steps { display: flex; gap: 6px; }
.mp3-steps i { width: 44px; height: 7px; border-radius: 4px; background: #d9d5cc; }
.mp3-steps i.is-on { background: var(--mp-main); }
.mp3-restart { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: #fff; border: 2px solid #111; font-weight: 700; font-size: 17px; }
.mp3-bubble { flex: 0 0 auto; display: flex; gap: 18px; align-items: flex-start; }
.mp3-avatar { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-main); color: var(--mp-main-ink); }
.mp3-avatar .tomi-icon { font-size: 36px; }
.mp3-bubble > div { background: #fff; border-radius: 6px 26px 26px 26px; padding: 20px 24px; }
.mp3-bubble b { display: block; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 42px; line-height: 1; text-transform: uppercase; }
.mp3-bubble small { display: block; margin-top: 8px; font-size: 19px; color: #5d6166; }
.mp3-answer { align-self: flex-end; padding: 14px 22px; border-radius: 26px 26px 6px 26px; background: var(--mp-acc); color: var(--mp-acc-ink); font-weight: 800; font-size: 21px; }
.mp3-options { flex: 0 1 760px; min-height: 0; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(0, 1fr); gap: 14px; }
.mp3-options--row { flex: 0 0 auto; grid-auto-rows: 130px; }
.mp3-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 26px; border-radius: 24px; background: #fff; color: #111; text-align: left; }
.mp3-opt .tomi-icon { font-size: 64px; margin-bottom: auto; }
.mp3-opt b { font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 40px; line-height: 1; text-transform: uppercase; }
.mp3-opt small { font-size: 19px; }
.mp3-opt--small { justify-content: center; border: 2px solid #111; }
.mp3-best { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 380px 1fr; border-radius: 26px; overflow: hidden; background: var(--mp-main); color: var(--mp-main-ink); text-align: left; }
.mp3-best img, .mp3-best .mp-noimg { width: 100%; height: 100%; object-fit: cover; }
.mp3-best > div { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.mp3-best h2 { margin: 6px 0 0; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 44px; line-height: 1; text-transform: uppercase; }
.mp3-best small { font-size: 18px; }
.mp3-best b { margin-top: auto; font-family: var(--ds-font-display); font-size: 40px; }
.mp3-alt { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mp3-alt__item { display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 14px; background: #fff; border-radius: 20px; text-align: left; }
.mp3-alt__item img, .mp3-alt__item .mp-noimg { grid-row: span 2; width: 120px; height: 120px; border-radius: 14px; object-fit: cover; }
.mp3-alt__item b { font-size: 20px; line-height: 1.2; align-self: end; }
.mp3-alt__item small { font-size: 17px; color: #5d6166; align-self: start; }

/* ================= ficha + Locker ================= */
.mp-sheet { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; }
.mp-sheet__panel { position: relative; width: 100%; max-height: 92%; overflow: hidden; background: #fff; border-radius: 30px 30px 0 0; display: grid; grid-template-columns: 400px 1fr; animation: mp-sheet-in .25s ease-out; }
@keyframes mp-sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.mp-sheet__img img, .mp-sheet__img .mp-noimg { width: 100%; height: 100%; min-height: 460px; object-fit: cover; }
.mp-sheet__body { padding: 34px 32px 26px; display: flex; flex-direction: column; gap: 12px; }
.mp-sheet__body small { font-size: 18px; font-weight: 700; color: #5d6166; text-transform: uppercase; letter-spacing: .06em; }
.mp-sheet__body h2 { margin: 0; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 46px; line-height: 1; text-transform: uppercase; }
.mp-sheet__body > b { font-family: var(--ds-font-display); font-size: 42px; }
.mp-sheet__actions { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.mp-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; border-radius: 16px; border: 2px solid #111; background: #fff; color: #111; font-weight: 800; font-size: 20px; }
.mp-btn .tomi-icon { font-size: 28px; }
.mp-btn--accent { background: var(--mp-main); border-color: var(--mp-main); color: var(--mp-main-ink); }
.mp-sheet__done { margin-top: auto; display: flex; gap: 16px; align-items: center; padding: 22px; border-radius: 18px; background: var(--mp-acc); color: var(--mp-acc-ink); }
.mp-sheet__done > .tomi-icon { font-size: 54px; }
.mp-sheet__done b { display: block; font-size: 24px; }
.mp-sheet__done small { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 18px; color: inherit; }
.mp-sheet__close { position: absolute; top: 16px; right: 16px; z-index: 1; width: 56px; height: 56px; border-radius: 50%; background: #111; color: #fff; display: grid; place-items: center; }
.mp-sheet__demo { margin: 4px 0 0; font-size: 14px; color: #5d6166; }

/* cartão partilhado com as listagens (Notícias/Eventos) dentro da grelha da loja */
.mp-grid .card { display: flex; flex-direction: column; min-height: 0; }
.mp-grid .card__media { flex: 1 1 auto; height: auto; min-height: 0; }
.mp-grid .card__body { flex: 0 0 auto; }
.mp-pcard__price { font-weight: 800; font-size: 20px; color: #111; }
.mp-pcard--mini .card__media { flex: 0 0 150px; height: 150px; }
.mp-pcard--mini .card__title { font-size: 17px; }
.mp-sheet-grid--products { max-height: 1100px; overflow: hidden; }
.mp-chips--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mp-ph { display: block; width: 100%; height: 100%; min-height: 120px; }
.mp-feat__img.card__media--ph, .mp2-pick__img.card__media--ph { height: auto; }
/* MP002: ranking com o cartão partilhado */
.mp2-rank { position: relative; }
.mp2-rank__n { position: absolute; top: 12px; left: 12px; z-index: 1; font-style: normal; font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 22px; padding: 4px 10px; border-radius: 8px; background: var(--mp-main); color: var(--mp-main-ink); }
.mp2-rank__local { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: #111; }
.mp2-rank__local .tomi-icon { font-size: 16px; }
.mp2-shop__mark { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-main); color: var(--mp-main-ink); font-family: var(--ds-font-display); font-weight: var(--ds-fw-bold); font-size: 28px; }
