/* FaixaNet — tema escuro, identidade "faixa de estrada" (amarelo de sinalização + tracejado). */
:root {
  --bg: #101218;
  --bg-2: #151821;
  --surface: #1a1e28;
  --surface-2: #232836;
  --line: #2d3343;
  --text: #eef0f6;
  --muted: #9aa2b8;
  --accent: #ffc233;
  --accent-2: #ffd466;
  --accent-ink: #1a1300;
  --danger: #ff8080;
  --radius: 10px;
  --side: 248px;
  --player-h: 88px;
  --tab-h: 58px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---- ícones ---- */
.ic { flex: none; }
.ic-f { fill: currentColor; }
.ic-s { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- a faixa: tracejado amarelo ---- */
.lane { height: 3px; background: repeating-linear-gradient(90deg, var(--accent) 0 14px, transparent 14px 26px); opacity: .9; }

/* ---- estrutura ---- */
.shell { min-height: 100vh; padding-bottom: calc(var(--player-h) + var(--tab-h) + env(safe-area-inset-bottom)); }
.side { display: none; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: rgba(16, 18, 24, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
main { padding: 20px 16px 8px; max-width: 1280px; margin: 0 auto; outline: none; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.25rem; letter-spacing: -0.03em; }
.logo-mark { width: 8px; height: 26px; border-radius: 2px; background: repeating-linear-gradient(180deg, var(--accent) 0 7px, transparent 7px 11px); }
.logo-sm { font-size: 1.1rem; }
.logo-sm .logo-mark { height: 22px; }
.search-form {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--surface-2); border-radius: 999px; padding: 0 14px; color: var(--muted);
}
.search-form input { flex: 1; min-width: 0; background: none; border: 0; padding: 10px 0; outline: none; }
.search-form:focus-within { box-shadow: 0 0 0 2px var(--accent); color: var(--text); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr);
  background: #0d0f14; border-top: 1px solid var(--line);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .68rem; color: var(--muted); }
.tabbar a[aria-current="page"], .tabbar a.on { color: var(--accent); }
.badge-n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-size: .7rem; font-weight: 800; display: inline-grid; place-items: center; line-height: 1;
}
.tabbar .badge-n { position: absolute; top: 5px; left: calc(50% + 6px); }

.foot { margin: 48px 0 16px; color: var(--muted); font-size: .85rem; }
.foot .lane { margin-bottom: 16px; opacity: .35; }
.foot a { text-decoration: underline; text-underline-offset: 3px; }

/* ---- botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 700; text-align: center; transition: transform .12s, background .12s;
}
.btn:hover { transform: scale(1.02); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: transparent; border-color: #5b2d33; color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---- avisos ---- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; background: var(--surface-2); border-left: 4px solid var(--muted); }
.flash-ok { border-left-color: var(--accent); }
.flash-error { border-left-color: var(--danger); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--accent); font-size: .75rem; font-weight: 700; }

/* ---- capas ---- */
.cv { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; border-radius: inherit; }
.ph { display: grid; place-items: center; font-weight: 850; font-size: 1.6rem; color: rgba(255,255,255,.88); letter-spacing: -.03em; }
.ph-0 { background: linear-gradient(135deg, #3b4a6b, #1f2740); }
.ph-1 { background: linear-gradient(135deg, #6b3b4a, #3a1f28); }
.ph-2 { background: linear-gradient(135deg, #3b6b5a, #1d3a30); }
.ph-3 { background: linear-gradient(135deg, #6b5a3b, #3a2f1d); }
.ph-4 { background: linear-gradient(135deg, #5a3b6b, #301d3a); }
.ph-5 { background: linear-gradient(135deg, #3b6b6b, #1d3a3a); }
.ph-6 { background: linear-gradient(135deg, #6b4a3b, #3a251d); }
.ph-7 { background: linear-gradient(135deg, #4a6b3b, #26391d); }

/* ---- grades e cartões ---- */
.section { margin-top: 36px; }
.section > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card { display: block; padding: 12px; border-radius: 12px; background: var(--bg-2); transition: background .15s; }
.card:hover { background: var(--surface-2); }
.card-cv { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; margin-bottom: 10px; background: var(--surface); }
.card-cv.round { border-radius: 50%; }
.card h3 { font-size: .98rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card p { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .price-sm { color: var(--accent); margin-top: 2px; }
.card-play {
  position: absolute; right: 8px; bottom: 8px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); opacity: 0; transform: translateY(6px); transition: .18s;
}
.card:hover .card-play, .card:focus-visible .card-play { opacity: 1; transform: none; }
.card-artist { text-align: center; }

/* ---- destaque da página inicial ---- */
.hero { display: grid; gap: 20px; align-items: end; padding: 8px 0 28px; }
.hero-cv { width: min(60vw, 240px); aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.hero h1 { font-size: clamp(2.2rem, 9vw, 4.4rem); font-weight: 900; letter-spacing: -0.04em; line-height: .98; overflow-wrap: anywhere; }
.hero .by { color: var(--muted); margin-top: 10px; font-size: 1.05rem; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.hero + .lane { margin-bottom: 4px; }

/* ---- cabeçalho de álbum/artista ---- */
.head { display: grid; gap: 18px; align-items: end; padding-bottom: 20px; }
.head .hero-cv { width: min(56vw, 220px); }
.head.artist .hero-cv { border-radius: 50%; }
.head p.meta { color: var(--muted); margin-top: 8px; }
.head p.desc { color: var(--muted); max-width: 62ch; margin-top: 10px; }

/* ---- lista de faixas ---- */
.tracks { list-style: none; margin: 0; padding: 0; }
.trk {
  display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "play main act" "play main dur";
  align-items: center; gap: 0 10px; padding: 8px 6px; border-radius: 8px;
}
.trk:hover { background: var(--bg-2); }
.trk.playing .trk-title { color: var(--accent); }
.trk-play { grid-area: play; position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); display: grid; place-items: center; }
.trk-play:hover { background: var(--accent); color: var(--accent-ink); }
.trk-n { display: none; }
.trk-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; }
.trk-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-sub a:hover { text-decoration: underline; }
.trk-dur { grid-area: dur; color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
.trk-act { grid-area: act; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.price { color: var(--accent); font-weight: 750; font-size: .92rem; font-variant-numeric: tabular-nums; }
.own { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; font-size: .85rem; }
.cart-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); }
.cart-btn:hover { background: var(--accent); color: var(--accent-ink); }
.cart-btn.in { background: var(--accent); color: var(--accent-ink); }
.trk .i-pause, .trk.playing.is-on .trk-ic { opacity: 1; }

/* ---- formulários ---- */
.form { max-width: 440px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .82rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,194,51,.25); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error-text { color: var(--danger); font-size: .9rem; }
.muted { color: var(--muted); }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---- carrinho / pedidos ---- */
.cart-list { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 8px; }
.cart-item { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 12px; align-items: center; padding: 8px; background: var(--bg-2); border-radius: 10px; }
.cart-item .thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; }
.cart-item .t { min-width: 0; }
.cart-item .t strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item .t span { color: var(--muted); font-size: .85rem; }
.summary { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.2rem; font-weight: 800; padding: 14px 4px; border-top: 1px dashed var(--line); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.empty .btn { margin-top: 14px; }
.prose { max-width: 70ch; }
.prose h2 { margin: 28px 0 8px; }
.prose p, .prose li { color: #cfd3e0; margin-bottom: 10px; }
.stack { display: grid; gap: 12px; }
.center-box { max-width: 440px; margin: 24px auto; }
.center-box h1 { margin-bottom: 18px; }

/* ---- escolha da forma de pagamento ---- */
.gw-list { display: grid; gap: 10px; margin-top: 18px; }
.gw-form { margin: 0; }
.gw-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  padding: 14px 16px; min-height: 64px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, background .15s;
}
.gw-btn:hover { border-color: var(--accent); background: var(--surface); }
.gw-btn strong { display: block; font-size: 1.02rem; }
.gw-btn span { color: var(--muted); font-size: .85rem; }
.gw-btn .go { color: var(--accent); font-weight: 800; }

/* ---- player ---- */
.player {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 30; height: var(--player-h);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "info btns" "seek seek"; align-items: center; gap: 0 8px;
  padding: 8px 14px 6px; background: #0b0d12; border-top: 1px solid var(--line);
}
.pl-info { grid-area: info; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pl-cover { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; background: var(--surface-2); flex: none; }
.pl-text { min-width: 0; }
.pl-title { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-artist { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-center { display: contents; }
.pl-btns { grid-area: btns; display: flex; align-items: center; gap: 2px; }
.pl-btns #pl-prev { display: none; }
.pl-seekrow { grid-area: seek; display: flex; align-items: center; gap: 8px; }
.time { font-size: .72rem; color: var(--muted); width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.pl-extra { display: none; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.play-btn:hover { background: var(--accent-2); }
.play-btn .i-pause { display: none; }
.player.is-playing .play-btn .i-play { display: none; }
.player.is-playing .play-btn .i-pause { display: inline; }

/* barra de progresso: faixa tracejada de estrada */
input.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; margin: 0; --p: 0%; cursor: pointer; }
input.seek::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, #0b0d12 11px 15px),
    linear-gradient(90deg, var(--accent) var(--p), var(--surface-2) var(--p));
}
input.seek::-moz-range-track {
  height: 6px; border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, #0b0d12 11px 15px),
    linear-gradient(90deg, var(--accent) var(--p), var(--surface-2) var(--p));
}
input.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); margin-top: -4px; border: 0; }
input.seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
input.vol { width: 110px; }

/* ---- telas grandes: barra lateral ---- */
@media (min-width: 900px) {
  :root { --player-h: 84px; }
  .shell { display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: auto 1fr; padding-bottom: var(--player-h); }
  .side {
    display: flex; flex-direction: column; gap: 22px; grid-row: 1 / span 2; position: sticky; top: 0; height: calc(100vh - var(--player-h));
    padding: 22px 16px; background: #0d0f14; border-right: 1px solid var(--line);
  }
  .top { grid-column: 2; padding: 12px 32px; }
  .top .logo { display: none; }
  .top .search-form { max-width: 420px; flex: none; width: 100%; }
  main { grid-column: 2; width: 100%; padding: 28px 32px 8px; margin: 0; }
  .tabbar { display: none; }
  .side-nav { display: grid; gap: 4px; }
  .nav-link { position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 8px; color: var(--muted); font-weight: 650; }
  .nav-link:hover { color: var(--text); background: var(--surface); }
  .nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
  .nav-link[aria-current="page"] .ic { color: var(--accent); }
  .nav-link .badge-n { margin-left: auto; }
  .side-foot { margin-top: auto; display: grid; gap: 8px; }
  .who { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .hero { grid-template-columns: 240px 1fr; gap: 28px; padding: 12px 0 32px; }
  .hero-cv { width: 240px; }
  .head { grid-template-columns: 220px 1fr; gap: 28px; }
  .head .hero-cv { width: 220px; }
  .trk { grid-template-columns: 44px 1fr 90px 90px 120px; grid-template-areas: "play main dur act act"; }
  .trk-dur { text-align: right; }
  .trk-n { display: block; font-variant-numeric: tabular-nums; color: var(--muted); }
  .trk-play .trk-ic { display: none; }
  .trk-play { background: transparent; }
  .trk:hover .trk-n, .trk.playing .trk-n { display: none; }
  .trk:hover .trk-play .trk-ic, .trk.playing .trk-play .trk-ic, .trk-play:focus-visible .trk-ic { display: block; }
  .trk-play:not(:has(.trk-n)) .trk-ic { display: block; }
  .trk-play:not(:has(.trk-n)) { background: var(--surface-2); }

  .player { bottom: 0; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr); grid-template-areas: "info center extra"; padding: 10px 20px; }
  .pl-center { grid-area: center; display: grid; gap: 2px; justify-items: center; }
  .pl-btns { grid-area: auto; gap: 10px; }
  .pl-btns #pl-prev { display: inline-grid; }
  .pl-seekrow { grid-area: auto; width: 100%; max-width: 560px; }
  .pl-extra { grid-area: extra; display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--muted); }
  .pl-cover { width: 56px; height: 56px; }
}
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); } }
@media (max-width: 480px) {
  .cart-item { grid-template-columns: 48px 1fr auto; }
  .cart-item .thumb { width: 48px; height: 48px; }
  .cart-item form { grid-column: 3; }
  .cart-item .p { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .btn:hover { transform: none; } }

/* ---- aviso rápido ---- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(16px); z-index: 60; max-width: 92vw;
  bottom: calc(var(--player-h) + var(--tab-h) + 16px); padding: 10px 16px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 900px) { .toast { bottom: calc(var(--player-h) + 16px); } }

/* ---- utilitários ---- */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 18px; }
.album-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.inline-form { margin: 0; display: inline-block; }
.order-item { grid-template-columns: 1fr auto auto; }
.flash-info { border-left-color: var(--accent-2); }
