/* Achadinhos da Ju — paleta da página original da Ju (coral sobre creme), modo escuro automático. */
:root {
    --bg: #FFF6F0;
    --bg-2: #FFEDE3;
    --card: #FFFFFF;
    --ink: #2B2420;
    --muted: #8A7B72;
    --coral: #E8603C;
    --coral-2: #F28A5B;
    --coral-ink: #FFFFFF;
    --coral-soft: #FDE7DD;
    --line: #F1E2D8;
    --ok: #2E9E6A;
    --danger: #C9372C;
    --shadow: 0 1px 2px rgba(43, 36, 32, .04), 0 8px 24px -12px rgba(43, 36, 32, .18);
    --shadow-lg: 0 18px 40px -18px rgba(232, 96, 60, .45);
    --radius: 18px;
    --font: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1E1916;
        --bg-2: #261F1B;
        --card: #2A2320;
        --ink: #F7EEE8;
        --muted: #B3A398;
        --coral: #F07150;
        --coral-2: #F59A70;
        --coral-soft: #3E2A22;
        --line: #3A302B;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .7);
        --shadow-lg: 0 18px 40px -20px rgba(240, 113, 80, .5);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 150px; }
body {
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--coral); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Botões */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-2) 100%);
    color: var(--coral-ink); font-weight: 700; text-decoration: none;
    border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer;
    box-shadow: var(--shadow-lg); transition: transform .15s ease, filter .15s ease; white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn-sm { padding: 7px 13px; font-size: 13px; box-shadow: none; }
.btn-lg { padding: 14px 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn-danger { background: var(--danger); box-shadow: none; }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font-size: inherit; }
.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line); color: var(--ink);
    font-size: 14px; font-weight: 600; text-decoration: none; transition: border-color .15s;
}
.pill:hover { border-color: var(--coral); }

/* Topo */
.hero {
    text-align: center; padding: 36px 0 22px;
    background: radial-gradient(120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg) 70%);
}
.avatar {
    width: 112px; height: 112px; border-radius: 50%; margin: 0 auto 14px;
    box-shadow: 0 0 0 4px var(--card), 0 0 0 6px var(--coral), var(--shadow-lg);
    animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.avatar.sm { width: 72px; height: 72px; }
.hero h1 { font-size: clamp(28px, 7vw, 42px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.hero h1 span { color: var(--coral); }
.lead { color: var(--muted); margin-top: 6px; font-size: 15px; }
.lead strong { color: var(--ink); }
.socials { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Busca fixa */
.searchbar {
    position: sticky; top: 0; z-index: 10; padding: 10px 0 8px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent; transition: border-color .2s;
}
.searchbar.is-stuck { border-bottom-color: var(--line); }
.search { position: relative; display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto; }
.search input {
    flex: 1; width: 100%; padding: 14px 44px 14px 46px; border-radius: 16px;
    border: 1.5px solid var(--line); background: var(--card); font-size: 16px;
    box-shadow: var(--shadow); outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--coral); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 18%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search-ico { position: absolute; left: 15px; color: var(--muted); pointer-events: none; }
.search-clear {
    position: absolute; right: 8px; width: 30px; height: 30px; border-radius: 50%;
    border: 0; background: var(--coral-soft); color: var(--coral); cursor: pointer; font-size: 13px;
}
.toolbar { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 10px auto 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: var(--card); border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: all .15s;
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sort select {
    border: 1px solid var(--line); background: var(--card); border-radius: 999px;
    padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* Seções */
main.wrap { padding-top: 14px; padding-bottom: 32px; }
.section-title { font-size: 18px; font-weight: 800; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.count { background: var(--coral-soft); color: var(--coral); font-size: 13px; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.notice { background: var(--coral-soft); border-radius: 14px; padding: 12px 16px; margin: 6px 0 4px; font-weight: 600; }
.notice.ok { background: color-mix(in srgb, var(--ok) 15%, var(--card)); }
.notice.error { background: color-mix(in srgb, var(--danger) 15%, var(--card)); }

/* Achou pelo número */
.quick {
    display: flex; align-items: center; gap: 12px; padding: 12px; margin: 8px 0 4px;
    border-radius: var(--radius); text-decoration: none; color: var(--ink);
    background: linear-gradient(135deg, var(--coral-soft), var(--card));
    border: 1.5px solid var(--coral); box-shadow: var(--shadow-lg);
    animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.quick-n { flex: 0 0 52px; height: 52px; border-radius: 14px; background: var(--coral); color: #fff; font-weight: 800; font-size: 22px; display: grid; place-items: center; }
.quick-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.quick-txt small { color: var(--coral); font-weight: 700; }
.quick-txt strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Grade de produtos: lista no celular, cartões a partir de 560px */
.grid { list-style: none; padding: 0; display: grid; gap: 10px; }
.grid-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 6px; }
.grid-row::-webkit-scrollbar { display: none; }
.grid-row .card { flex: 0 0 78%; scroll-snap-align: start; }
.card {
    position: relative; display: flex; gap: 12px; align-items: center; padding: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
    animation: fade .3s ease both;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--coral) 40%, var(--line)); }
.card:active { transform: scale(.99); }
.card.is-destaque { border-color: color-mix(in srgb, var(--coral) 55%, var(--line)); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.thumb {
    position: relative; flex: 0 0 92px; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
    background: linear-gradient(135deg, var(--coral-soft), var(--bg-2));
    display: grid; place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-num { font-size: 40px; font-weight: 800; color: var(--coral); letter-spacing: -.04em; }
.thumb-num.big { font-size: 120px; }
.badge-num, .badge-off {
    position: absolute; top: 6px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; line-height: 1.5;
}
.badge-num { left: 6px; background: rgba(255, 255, 255, .92); color: #2B2420; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.badge-off { right: 6px; background: var(--coral); color: #fff; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.card-title a { color: inherit; text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.price strong { color: var(--coral); font-weight: 800; }
.price s { color: var(--muted); font-size: 13px; }
.price.big { font-size: 28px; margin-top: 8px; }
.price.big s { font-size: 17px; }
.card-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.card-actions .btn { pointer-events: none; }
.more { position: relative; z-index: 2; font-size: 13px; color: var(--muted); font-weight: 600; text-decoration: none; padding: 4px 0; }
.more:hover { color: var(--coral); text-decoration: underline; }

@media (min-width: 560px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .grid-row { display: grid; overflow: visible; margin: 0; padding: 0; }
    .grid-row .card { flex: none; }
    .card { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; }
    .thumb { flex: none; width: 100%; border-radius: 0; }
    .thumb-num { font-size: 84px; }
    .badge-num, .badge-off { top: 10px; font-size: 12px; padding: 3px 9px; }
    .badge-num { left: 10px; }
    .badge-off { right: 10px; }
    .card-body { padding: 12px 14px 14px; }
    .card-title { font-size: 16px; }
    .card-actions { justify-content: space-between; margin-top: auto; padding-top: 8px; }
}
@media (min-width: 900px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
    .grid.grid-row { grid-template-columns: repeat(4, 1fr); }
}

.vazio { text-align: center; color: var(--muted); padding: 34px 12px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.vazio p + p { margin-top: 6px; }
.vazio strong { color: var(--ink); }
.vazio-emoji { font-size: 40px; }

/* Página do produto */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 50%; }
.topnav { display: flex; gap: 16px; font-weight: 600; font-size: 14px; }
.topnav a { color: var(--ink); text-decoration: none; }
.crumbs { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.crumbs a { color: var(--muted); }
.product { display: grid; gap: 22px; }
.product-media { position: relative; border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, var(--coral-soft), var(--bg-2)); aspect-ratio: 1; display: grid; place-items: center; box-shadow: var(--shadow); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .badge-num, .product-media .badge-off { top: 14px; font-size: 14px; padding: 4px 12px; }
.product-media .badge-num { left: 14px; }
.product-media .badge-off { right: 14px; }
.eyebrow { color: var(--coral); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.product-info h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; margin-top: 4px; }
.product-lead { color: var(--muted); font-size: 17px; margin-top: 8px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.cta-row .btn-lg:first-child { flex: 1 1 220px; }
.product-text { line-height: 1.7; padding: 16px 0; border-top: 1px solid var(--line); }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
@media (min-width: 820px) {
    .product { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
    .product-media { position: sticky; top: 80px; }
}

/* Rodapé */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0 90px; text-align: center; color: var(--muted); font-size: 13px; background: var(--bg-2); }
.site-footer .aff { max-width: 620px; margin: 0 auto; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 14px 0 10px; }
.footer-links a, .footer-links button { color: var(--ink); font-weight: 600; text-decoration: none; }
.credit a { color: inherit; }

/* Modais e aviso de cookies */
.modal { max-width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 22px; padding: 26px 22px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal::backdrop { background: rgba(30, 25, 22, .55); backdrop-filter: blur(3px); }
.modal h2 { font-size: 20px; margin-bottom: 12px; }
.modal p { margin-top: 10px; font-size: 14px; line-height: 1.6; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-close button { border: 0; background: var(--coral-soft); color: var(--coral); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.cookie-banner {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 520px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
    background: var(--ink); color: var(--bg); font-size: 13px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
    animation: fade .3s ease both;
}
.cookie-banner p { flex: 1; }

/* Erros */
.error-page { text-align: center; padding-top: 60px !important; max-width: 620px; }
.error-emoji { font-size: 72px; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.error-code { color: var(--coral); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; margin-top: 8px; }
.error-page h1 { font-size: clamp(26px, 6vw, 38px); letter-spacing: -.02em; margin: 6px 0 10px; }
.error-page .search { margin: 24px auto 18px; }
.error-page .search input { padding-left: 16px; }

/* Login e painel */
.auth { display: grid; place-items: center; padding: 40px 16px; min-height: 100vh; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); width: 100%; }
.auth .panel { max-width: 380px; display: grid; gap: 12px; text-align: left; }
.auth h1 { text-align: center; font-size: 22px; }
.auth .avatar { margin-bottom: 0; }
.field { display: grid; gap: 5px; }
.field label { font-weight: 600; font-size: 14px; }
.field input:not([type=checkbox]), .field select, .field textarea {
    width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--coral); }
.field-check { display: flex; align-items: center; gap: 8px; }
.field-check input { width: 18px; height: 18px; accent-color: var(--coral); }
.help { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); font-size: 13px; font-weight: 600; }
.has-error input { border-color: var(--danger) !important; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0 16px; }
.admin-head h1 { font-size: 24px; display: flex; align-items: center; gap: 8px; }
.form-grid { display: grid; gap: 16px; max-width: 760px; }
.form-row-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-media { display: flex; gap: 14px; align-items: flex-start; }
.form-media > div { flex: 1; display: grid; gap: 10px; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.danger-zone { margin-top: 24px; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat small { color: var(--muted); font-weight: 600; }
.stat strong { display: block; font-size: 28px; font-weight: 800; }
.stat-wide { grid-column: 1 / -1; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin-top: 8px; }
.bars span { flex: 1; height: max(var(--h), 4%); background: linear-gradient(var(--coral-2), var(--coral)); border-radius: 4px 4px 0 0; }
.origens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (min-width: 760px) { .stats { grid-template-columns: 1fr 1fr 2fr 2fr; } .stat-wide { grid-column: auto; } }
.admin-search { margin: 0 0 12px; max-width: none; }
.admin-search input { padding-left: 16px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.table td small { display: block; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a { color: var(--ink); }
.table tr.is-off { opacity: .55; }
.warn { color: var(--danger); }
.mini { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.mini.lg { width: 96px; height: 96px; border-radius: 14px; }
.switch { width: 40px; height: 24px; border-radius: 999px; border: 0; background: var(--line); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch.is-on { background: var(--ok); }
.switch.is-on::after { transform: translateX(16px); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Compartilhar: botão nos cartões e folha de opções (no celular sobe de baixo; no computador fica centralizada) */
.share-btn {
    position: relative; z-index: 2; margin-left: auto; flex: 0 0 auto;
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.share-btn:hover, .share-btn:focus-visible { color: var(--coral); border-color: var(--coral); background: var(--coral-soft); }
.sheet {
    width: 100%; max-width: 100%; margin: auto 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
    border: 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--ink);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .3);
}
.sheet[open] { animation: subir .28s cubic-bezier(.2, .9, .3, 1) both; }
.sheet::backdrop { background: rgba(30, 25, 22, .55); backdrop-filter: blur(3px); }
@keyframes subir { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.sheet .modal-close { top: 16px; right: 14px; }
.sheet-eyebrow { color: var(--coral); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.sheet-title { font-size: 17px; margin: 2px 40px 16px 0; line-height: 1.3; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
.share-opt {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0;
    background: none; border: 0; cursor: pointer; color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 600;
}
.share-ico {
    width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
    background: var(--c); color: #fff; transition: transform .15s;
}
.share-ico svg { width: 26px; height: 26px; }
.share-opt:hover .share-ico, .share-opt:focus-visible .share-ico { transform: scale(1.07); }
.share-opt:active .share-ico { transform: scale(.94); }
.share-url { margin-top: 16px; }
.share-url input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 13px; }
@media (min-width: 560px) {
    .sheet { max-width: 440px; margin: auto; border-radius: 24px; padding: 18px 22px 22px; }
    .sheet[open] { animation: pop .25s cubic-bezier(.2, 1.4, .4, 1) both; }
    .sheet-grip { display: none; }
}
