/* Identidade: tokens do Travel by Me (src/theme/tokens.ts e docs/redesign/padrao-visual.md). */
:root {
  --bg: #F6F6F8;
  --bg-end: #ECECEF;
  --text: #1C1C1E;
  --text-2: #6E6E73;
  --text-3: #8E8E93;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  --shadow: 0 14px 30px rgba(17, 17, 26, 0.06);
  --shadow-lg: 0 16px 34px rgba(17, 17, 26, 0.07);
  --well: rgba(17, 17, 26, 0.05);
  --hairline: rgba(17, 17, 26, 0.08);
  --primary: #FE5702;
  --action: linear-gradient(180deg, #FF7433, #FE5702);
  --primary-text: #C2410C;
  --primary-text-sm: #9A3412;
  --primary-soft: #FFEFE3;
  --selected: linear-gradient(135deg, rgba(255, 246, 239, 0.95), rgba(255, 228, 210, 0.9));
  --selected-edge: inset 0 0 0 1.5px rgba(254, 87, 2, 0.30);
  --card: #FFFFFF;
  --inverse: #1C1C1E;
  --on-inverse: #FFFFFF;
  --warning: #8A5200;
  --warning-soft: #FFF1D6;
  --dashed: rgba(17, 17, 26, 0.18);
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #17181B;
  --bg-end: #111214;
  --text: #F4F4F6;
  --text-2: #A6A6AE;
  --text-3: #96969E;
  --glass: rgba(40, 41, 46, 0.74);
  --glass-strong: rgba(48, 49, 55, 0.92);
  --glass-edge: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 34px rgba(0, 0, 0, 0.3);
  --well: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.08);
  --primary-text: #FF8A4C;
  --primary-text-sm: #FF8A4C;
  --primary-soft: rgba(254, 87, 2, 0.16);
  --selected: linear-gradient(135deg, rgba(254, 87, 2, 0.22), rgba(254, 87, 2, 0.12));
  --selected-edge: inset 0 0 0 1.5px rgba(255, 128, 64, 0.5);
  --card: #26272C;
  --inverse: #F4F4F6;
  --on-inverse: #1C1C1E;
  --warning: #F5B755;
  --warning-soft: rgba(245, 183, 85, 0.14);
  --dashed: rgba(255, 255, 255, 0.2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-end)) fixed;
  background-color: var(--bg);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 12px 16px 48px; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow), var(--glass-edge);
  border-radius: 26px;
}

/* Capa */
.hero {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: #2C2C30;
}
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(1, 21, 71, 0.88) 0%, rgba(1, 21, 71, 0.45) 45%, rgba(1, 21, 71, 0.05) 75%);
}
.hero-top, .hero-text { position: relative; z-index: 1; }
.hero-top { display: flex; justify-content: space-between; align-items: center; padding: 16px; }
.glass-pill, .glass-round {
  background: rgba(255, 255, 255, 0.24);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
  color: #fff;
  border: 0;
}
.glass-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 100px; text-decoration: none; font-size: 14px; font-weight: 500; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--action); display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; }
.hero-actions { display: flex; gap: 8px; }
.glass-round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.hero-text { padding: 0 22px 64px; text-shadow: 0 1px 12px rgba(1, 21, 71, 0.35); }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; opacity: 0.85; }
h1 { margin: 0; font-size: 40px; line-height: 44px; letter-spacing: -2px; font-weight: 600; }
.lede { margin: 10px 0 0; font-size: 16px; max-width: 36ch; color: rgba(255, 255, 255, 0.9); }

/* Progresso */
.progress {
  position: relative; z-index: 2;
  margin: -44px 12px 0;
  padding: 16px 18px 18px;
  display: flex; gap: 14px; align-items: center;
}
.progress-fig { width: 58px; height: 58px; object-fit: contain; flex: none; }
.progress-body { flex: 1; min-width: 0; }
.progress-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.progress-title { margin: 0; font-weight: 600; font-size: 17px; }
.progress-sub { margin: 2px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.35; }
.progress-num { margin: -4px 0 0; font-size: 34px; font-weight: 300; letter-spacing: -1px; line-height: 1.1; white-space: nowrap; }
.progress-num .of { color: var(--text-3); font-size: 20px; letter-spacing: 0; }
.bar { margin-top: 12px; height: 8px; border-radius: 100px; background: var(--well); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: 100px; background: linear-gradient(90deg, #FFB37A, #FE5702); transition: width 0.5s cubic-bezier(.2, .8, .2, 1); }

/* Busca e categorias */
.toolbar {
  position: sticky; top: 0; z-index: 5;
  margin: 18px -16px 0;
  padding: 12px 16px 10px;
  transition: background 0.2s, box-shadow 0.2s;
}
.toolbar.stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--hairline);
}
.search { position: relative; display: flex; align-items: center; }
.search > svg { position: absolute; left: 16px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 48px;
  border: 0; border-radius: 100px;
  padding: 0 44px 0 46px;
  background: var(--glass-strong);
  box-shadow: 0 8px 18px rgba(17, 17, 26, 0.05), var(--glass-edge);
  font: inherit; font-size: 16px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }
.clear { position: absolute; right: 6px; width: 36px; height: 36px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.clear svg { width: 18px; height: 18px; }
.clear[hidden] { display: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 16px 0 8px;
  border: 0; border-radius: 100px;
  background: var(--glass);
  box-shadow: 0 6px 14px rgba(17, 17, 26, 0.04), var(--glass-edge);
  font-size: 15px; font-weight: 500; color: var(--text);
  transition: transform 0.15s;
}
.chip:active { transform: scale(0.97); }
.chip img { width: 30px; height: 30px; object-fit: contain; }
.chip .n { color: var(--text-3); font-weight: 400; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--selected); box-shadow: var(--selected-edge); color: var(--primary-text-sm); }
.chip[aria-pressed="true"] .n { color: var(--primary-text); }

/* Alternância de visão */
.seg { display: flex; padding: 4px; margin: 8px 0 4px; border-radius: 100px; background: var(--well); max-width: 420px; }
.seg button { flex: 1; height: 38px; border: 0; border-radius: 100px; background: transparent; font-size: 14px; font-weight: 500; color: var(--text-2); transition: background 0.2s, color 0.2s; }
.seg button[aria-selected="true"] { background: var(--glass-strong); color: var(--text); box-shadow: 0 4px 10px rgba(17, 17, 26, 0.08); }

/* Seções e cartões */
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 4px 12px; }
.section-head img { width: 48px; height: 48px; object-fit: contain; }
.section-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.8px; font-weight: 600; line-height: 1.2; }
.section-head p { margin: 0; font-size: 14px; color: var(--text-2); }
.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

.card { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; transition: opacity 0.25s; animation: rise 0.4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card-top { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.photo {
  width: 96px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 18px; overflow: hidden;
  background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--hairline);
  display: grid; place-items: center; cursor: zoom-in;
}
.photo img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.35s cubic-bezier(.2, .8, .2, 1); }
.photo:hover img { transform: scale(1.04); }
.photo.is-fig { background: var(--well); box-shadow: none; cursor: default; }
.photo.is-fig img { width: 64%; height: 64%; }
.photo.is-fig:hover img { transform: none; }
.card-head { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-name { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.2px; }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 100px; background: var(--well); color: var(--text-2); letter-spacing: 0; }
.tag.warn { background: var(--warning-soft); color: var(--warning); }
.check {
  flex: none; width: 32px; height: 32px; margin: -4px -4px 0 0;
  border-radius: 50%; border: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-3);
  display: grid; place-items: center; color: transparent;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.check svg { width: 16px; height: 16px; stroke-width: 3; }
.check:active { transform: scale(0.9); }
.check[aria-pressed="true"] { background: var(--action); box-shadow: none; color: #fff; }
.tip { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.tip.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { align-self: flex-start; margin: -6px 0 0; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--primary-text); }
.more[hidden] { display: none; }
.coupon {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 10px; border-radius: 18px;
  border: 1.5px dashed var(--dashed);
}
.coupon img { width: 36px; height: 36px; object-fit: contain; }
.coupon-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; color: var(--text-2); }
.coupon-text b { display: block; font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: 0.6px; }
.btn-ghost { height: 36px; padding: 0 14px; border-radius: 100px; border: 0; background: var(--well); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost svg { width: 16px; height: 16px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 2px; }
.store { font-size: 13px; color: var(--text-3); }
.buy {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px 0 18px;
  border-radius: 100px; text-decoration: none;
  background: var(--inverse); color: var(--on-inverse);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: transform 0.15s;
}
.buy:active { transform: scale(0.97); }
.buy svg { width: 16px; height: 16px; }
.buy.off { background: var(--well); color: var(--text-2); pointer-events: none; }
.card.is-done .card-name { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.card.is-done .tip, .card.is-done .coupon, .card.is-done .photo { opacity: 0.55; }

/* Foto ampliada */
.zoom { border: 0; padding: 0; background: transparent; width: min(92vw, 480px); max-width: none; max-height: 92vh; overflow: visible; }
.zoom::backdrop { background: rgba(17, 17, 26, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.zoom[open] .zoom-card { animation: pop 0.28s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
.zoom-card { position: relative; border-radius: 30px; overflow: hidden; background: var(--card); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); }
.zoom-card > img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #FFFFFF; }
.zoom-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 18px 20px; }
.zoom-name { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.zoom-store { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.zoom-close { position: absolute; top: 12px; right: 12px; z-index: 1; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.85); color: #1C1C1E; box-shadow: 0 4px 12px rgba(17, 17, 26, 0.12); }
.buy[hidden] { display: none; }

.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty img { width: 72px; height: 72px; margin: 0 auto 8px; object-fit: contain; }
.empty p { margin: 0; }
.empty b { color: var(--text); font-weight: 600; display: block; font-size: 18px; margin-bottom: 4px; }
.skeleton { height: 132px; margin-top: 12px; opacity: 0.6; }

/* Rodapé */
.foot { margin-top: 48px; text-align: center; font-size: 14px; color: var(--text-2); }
.foot p { margin: 0 auto 6px; max-width: 46ch; }
.updated, .credit { font-size: 12px; color: var(--text-3); }
.made { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; margin: 22px 0 18px; font-size: 13px; color: var(--text-3); }
.made img { height: 30px; width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 18px; border-radius: 100px;
  background: var(--inverse); color: var(--on-inverse);
  font-size: 14px; font-weight: 500;
  transition: opacity 0.25s, transform 0.25s; pointer-events: none; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Telas maiores */
@media (min-width: 720px) {
  .wrap { padding: 20px 28px 64px; }
  .hero { min-height: 440px; }
  .hero-text { padding: 0 40px 76px; }
  h1 { font-size: 56px; line-height: 58px; letter-spacing: -2.6px; }
  .lede { font-size: 18px; }
  .progress { margin: -52px 32px 0; padding: 18px 24px 20px; }
  .toolbar { margin: 20px -28px 0; padding: 14px 28px 10px; }
  .chips { margin: 12px -28px 0; padding: 2px 28px 4px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "photo photo" "head check"; }
  .photo { grid-area: photo; width: 100%; aspect-ratio: 4 / 3; border-radius: 20px; }
  .photo.is-fig img { width: 42%; height: 56%; }
  .card-head { grid-area: head; }
  .check { grid-area: check; margin: 0; }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Foto que veio direto da loja (item novo, ainda sem a foto padronizada): margem para ficar parecida. */
.photo.remote img { padding: 8%; }
.sem-animacao .card { animation: none; }
