:root {
    --p: #7c3aed; --s: #ffcb47; --bg: #fffaf3; --t: #2a2235; --font: 'Fredoka';
    --base: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 var(--base); background-color: var(--bg); color: var(--t); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font), var(--base); margin: 0; }

/* ---------- Padrões de fundo por tema ---------- */
.pat-dots { background-image: radial-gradient(color-mix(in srgb, var(--p) 16%, transparent) 2px, transparent 2.5px); background-size: 22px 22px; }
.pat-stripes { background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--p) 10%, transparent) 0 12px, transparent 12px 26px); }
.pat-grid { background-image: linear-gradient(color-mix(in srgb, var(--p) 14%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--p) 14%, transparent) 1px, transparent 1px); background-size: 24px 24px; }
.pat-waves { background-image: radial-gradient(circle at 50% 120%, transparent 20px, color-mix(in srgb, var(--p) 13%, transparent) 21px 23px, transparent 24px); background-size: 46px 23px; }
.pat-confetti { background-image: radial-gradient(color-mix(in srgb, var(--p) 28%, transparent) 2px, transparent 3px), radial-gradient(color-mix(in srgb, var(--s) 55%, transparent) 2.5px, transparent 3.5px); background-size: 38px 38px, 29px 29px; background-position: 0 0, 14px 19px; }

/* ---------- Cabeçalho ---------- */
.cat-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 24px; flex-wrap: wrap;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--t) 10%, transparent); }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Fredoka', var(--base); font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--t); }
.logo-dot { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, #ffcb47 13% 45%, #ff5d8f 46%); box-shadow: 0 3px 10px rgba(255,93,143,.4); }
.search { flex: 1; display: flex; max-width: 460px; margin-left: auto; background: #fff; border-radius: 99px; border: 2px solid color-mix(in srgb, var(--p) 30%, transparent); overflow: hidden; }
.search input { flex: 1; border: 0; padding: 10px 16px; font: inherit; outline: none; min-width: 0; background: transparent; }
.search button { border: 0; background: none; padding: 0 14px; cursor: pointer; font-size: 1rem; }
.shape-toggle { display: flex; background: #fff; border-radius: 99px; padding: 3px; border: 2px solid color-mix(in srgb, var(--p) 20%, transparent); }
.shape-toggle button { border: 0; background: none; width: 34px; height: 30px; border-radius: 99px; cursor: pointer; font-size: 1rem; color: var(--p); }
.shape-toggle button.active { background: var(--p); color: #fff; }
.list-btn { border: 0; background: var(--p); color: #fff; padding: 10px 18px; border-radius: 99px; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 4px 14px color-mix(in srgb, var(--p) 40%, transparent); }
.list-btn span { background: #fff; color: var(--p); border-radius: 99px; padding: 0 8px; margin-left: 4px; }

/* ---------- Home ---------- */
.home { background: radial-gradient(circle at 10% 0%, #ffe1ec, transparent 35%), radial-gradient(circle at 90% 10%, #e3dcff, transparent 35%), #fffaf3; }
.hero { text-align: center; padding: 56px 20px 30px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-family: 'Fredoka', var(--base); }
.hero p { font-size: 1.1rem; opacity: .8; max-width: 560px; margin: 10px auto 0; }
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; padding: 20px 24px 60px; max-width: 1280px; margin: 0 auto; width: 100%; }
.cat-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 24px; text-decoration: none; color: var(--t); background-color: var(--bg);
    border: 3px solid var(--p); box-shadow: 0 10px 0 var(--p); transition: transform .18s, box-shadow .18s; overflow: hidden; min-height: 260px; }
.cat-card:hover { transform: translateY(-5px); box-shadow: 0 15px 0 var(--p); }
.cat-card h2 { font-size: 1.6rem; color: var(--p); line-height: 1.15; }
.cat-card p { margin: 0; opacity: .8; font-size: .95rem; }
.cc-icon { font-size: 2.2rem; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--s); }
.cc-samples { display: flex; margin-top: auto; padding-top: 8px; }
.cc-samples .mini-btn { width: 54px; height: 54px; margin-right: -12px; border: 3px solid var(--bg); }
.cc-count { font-weight: 800; color: var(--p); font-family: var(--font), var(--base); }

/* ---------- Página da categoria ---------- */
.themed .cat-hero { text-align: center; padding: 34px 20px 18px; position: relative; }
.back { position: absolute; left: 24px; top: 20px; text-decoration: none; font-weight: 700; opacity: .75; }
.cat-hero:not(:has(.ch-icon)) { padding-top: 54px; }
.ch-icon { font-size: 3rem; width: 96px; height: 96px; display: grid; place-items: center; margin: 0 auto 10px; background: var(--s); border-radius: 50%; border: 4px solid var(--p); }
.cat-hero h1 { font-size: clamp(2rem, 5vw, 3rem); color: var(--p); }
.cat-hero p { margin: 6px auto 0; max-width: 600px; opacity: .85; }
.chip { display: inline-block; background: color-mix(in srgb, var(--p) 12%, #fff); padding: 4px 14px; border-radius: 99px; }
.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding: 6px 24px 14px; justify-content: center; flex-wrap: wrap; }
.cat-pills a { text-decoration: none; padding: 6px 14px; border-radius: 99px; background: color-mix(in srgb, var(--bg) 70%, #fff); border: 2px solid color-mix(in srgb, var(--p) 25%, transparent); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.cat-pills a.active { background: var(--p); color: var(--bg); border-color: var(--p); }

.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 20px; padding: 14px 24px 40px; max-width: 1280px; margin: 0 auto; width: 100%; flex: 1; }
.botton-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px; border-radius: 20px; background: color-mix(in srgb, var(--bg) 60%, #fff); transition: transform .15s; }
.botton-card:hover { transform: translateY(-3px); }
/* nomes longos (ex.: "WhatsApp Image 2026…") ficam em no máximo 2 linhas com reticências */
.botton-card h3 { font-size: 1rem; line-height: 1.25; margin-top: 8px; width: 100%; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-height: 2.5em; }
.botton-card small { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.botton-card small a { opacity: .75; }
.botton-card .ref { font-size: .72rem; opacity: .55; }
.botton { position: relative; width: 150px; height: 150px; border-radius: 50%; overflow: hidden; background: #eee;
    box-shadow: 0 0 0 5px var(--ring, var(--p)), 0 12px 22px rgba(0,0,0,.22); transition: transform .2s; }
.botton img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gloss { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(ellipse at 32% 22%, rgba(255,255,255,.65), rgba(255,255,255,0) 42%), radial-gradient(circle at 50% 50%, transparent 60%, rgba(0,0,0,.18) 100%); }
.botton-card:hover .botton { transform: rotate(-5deg) scale(1.04); }
.want { margin-top: 6px; border: 2px solid var(--p); background: transparent; color: var(--p); padding: 6px 16px; border-radius: 99px; font: inherit; font-weight: 800; cursor: pointer; }
.in-list .want { background: var(--p); color: var(--bg); }

/* prévia em coração */
.shape-heart .botton, .shape-heart .mini-btn { border-radius: 0; clip-path: url(#clipHeart); box-shadow: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,.2)); }
.shape-heart .botton { width: 160px; height: 146px; }

.mini-btn { display: inline-block; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none; background: #eee; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.mini-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pager { display: flex; justify-content: center; gap: 14px; padding: 0 0 40px; }
.pager a { text-decoration: none; background: var(--p); color: #fff; padding: 9px 20px; border-radius: 99px; font-weight: 800; }
.empty { grid-column: 1 / -1; text-align: center; opacity: .7; padding: 40px 0; }
.cat-footer { text-align: center; font-size: .82rem; opacity: .6; padding: 20px; }

/* ---------- Lista / gaveta ---------- */
.drawer { position: fixed; inset: 0; background: rgba(20, 10, 40, .45); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; font-family: var(--base); color: #2a2235; }
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer-box { position: absolute; right: 0; top: 0; bottom: 0; width: min(420px, 100%); background: #fff; padding: 22px; overflow-y: auto; transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column; gap: 14px; }
.drawer.open .drawer-box { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { font-family: 'Fredoka', var(--base); }
.close { border: 0; background: #f3f1f8; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.list-items { display: flex; flex-direction: column; gap: 10px; }
.li { display: flex; align-items: center; gap: 10px; }
.li-info { flex: 1; min-width: 0; }
.li-info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-info small { opacity: .6; }
.li input { width: 64px; padding: 6px; border: 1px solid #ddd; border-radius: 8px; font: inherit; }
.li .rm { border: 0; background: none; cursor: pointer; opacity: .5; font-size: 1rem; }
.req-form { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #eee; padding-top: 14px; }
.req-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .88rem; }
.req-form input, .req-form textarea { font: inherit; padding: 9px 12px; border: 1px solid #ddd; border-radius: 10px; }
.req-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.send, .wa { border: 0; background: #7c3aed; color: #fff; padding: 12px; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer; text-align: center; text-decoration: none; }
.wa { background: #25d366; }
.req-ok { background: #e8f8ee; color: #135c2f; padding: 14px; border-radius: 12px; font-weight: 700; }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: #1e1533; color: #fff; padding: 10px 16px; border-radius: 10px; transition: opacity .4s; }
.toast.error { background: #e11d48; }
.toast.out { opacity: 0; }

@media (max-width: 700px) {
    .cat-header { padding: 10px 14px; }
    .search { order: 5; max-width: none; flex-basis: 100%; }
    .back { position: static; display: inline-block; margin-bottom: 10px; }
    .btn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; padding: 12px; }
    .botton-card { padding: 12px 8px; border-radius: 16px; }
    .botton-card h3 { font-size: .85rem; margin-top: 6px; }
    .botton-card .ref { font-size: .66rem; }
    .want { padding: 5px 12px; font-size: .82rem; }
    .botton { width: 120px; height: 120px; }
    .shape-heart .botton { width: 128px; height: 117px; }
    .cat-cards { padding: 14px; }
}

/* ---------- PWA ---------- */
.install-btn { border: 2px solid var(--p); background: #fff; color: var(--p); padding: 8px 14px; border-radius: 99px; font: inherit; font-weight: 800; cursor: pointer; }
@media (display-mode: standalone) {
    .cat-header { padding-top: calc(12px + env(safe-area-inset-top)); }
}
