/* Tokens centralizados em profarm-tokens.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--pf-font-sans);
  background: var(--bg); color: var(--tx);
  min-height: 100vh; line-height: 1.6;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--pr-d);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.topbar-logo { display: flex; align-items: center; gap: 10px; flex: 1; text-decoration: none; }
.topbar-logo img { width: 34px; height: 34px; border-radius: 8px; }
.topbar-logo .brand { font-family: var(--pf-font-display); font-size: 1.05rem; font-weight: 800; color: var(--pf-on-primary); line-height: 1.1; }
.topbar-logo .brand span { color: var(--ac); }
.topbar-logo .tagline { font-size: .65rem; color: rgba(255,255,255,.65); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: none; cursor: pointer;
  background: rgba(255,255,255,.12); color: var(--pf-on-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: var(--tr);
}
.icon-btn:hover { background: rgba(255,255,255,.22); transform: scale(1.05); }
.install-btn { display: none; background: var(--ac); color: var(--pf-on-accent) !important; font-weight: 700; font-size: .75rem; width: auto; padding: 0 12px; gap: 4px; }
.install-btn.show { display: flex; }

/* ── HERO ── */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, var(--pf-green-700) 0%, var(--pf-green-500) 55%, var(--pf-green-400) 100%);
  padding: 32px 16px 28px;
  text-align: center;
}
.hero-particles { position: absolute; inset: 0; pointer-events: none; }
.hero-particle {
  position: absolute; border-radius: 50%; opacity: .18;
  animation: float-p linear infinite;
}
@keyframes float-p {
  0% { transform: translateY(0) rotate(0deg); opacity: .18; }
  50% { opacity: .35; }
  100% { transform: translateY(-120px) rotate(360deg); opacity: 0; }
}
.hero-title { font-family: var(--pf-font-display); font-size: 2rem; font-weight: 900; color: var(--pf-on-primary); line-height: 1.1; position: relative; z-index: 1; }
.hero-title span { color: var(--ac); }
.hero-sub { font-size: .9rem; color: rgba(255,255,255,.8); margin-top: 8px; position: relative; z-index: 1; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; position: relative; z-index: 1; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; font-size: .75rem; font-weight: 600; background: rgba(255,255,255,.15); color: var(--pf-on-primary); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.2); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ac); animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── WEATHER WIDGET ── */
.weather-bar {
  background: rgba(255,255,255,.1); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-sm); margin: 16px 0 0;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  position: relative; z-index: 1;
}
.weather-item { display: flex; align-items: center; gap: 5px; color: rgba(255,255,255,.9); font-size: .82rem; font-weight: 500; }
.weather-icon { font-size: 1.1rem; }
.weather-loading { color: rgba(255,255,255,.6); font-size: .8rem; font-style: italic; }

/* ── SEARCH ── */
.search-wrap { padding: 16px; background: var(--surf); border-bottom: 1px solid var(--bd); }
.search-box {
  position: relative; max-width: 600px; margin: 0 auto;
  display: flex; align-items: center;
}
.search-icon { position: absolute; left: 14px; color: var(--tx3); font-size: 1rem; pointer-events: none; }
#searchInput {
  width: 100%; padding: 12px 40px 12px 42px;
  border: 2px solid var(--bd); border-radius: 14px;
  font-size: 1rem; font-family: var(--pf-font-sans);
  background: var(--bg); color: var(--tx);
  transition: var(--tr); outline: none;
}
#searchInput:focus { border-color: var(--pr); box-shadow: 0 0 0 4px rgba(26,107,60,.12); }
.search-clear { position: absolute; right: 12px; border: none; background: none; cursor: pointer; color: var(--tx3); font-size: 1.2rem; display: none; padding: 4px; border-radius: 50%; transition: var(--tr); }
.search-clear.show { display: flex; }
.search-clear:hover { background: var(--bd); color: var(--tx); }

/* ── FILTERS ── */
.filters-wrap { padding: 12px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; display: flex; gap: 8px; background: var(--surf); border-bottom: 1px solid var(--bd); scrollbar-width: none; }
.filters-wrap::-webkit-scrollbar { display: none; }
.filter-chip {
  white-space: nowrap; padding: 7px 16px; border-radius: 20px;
  border: 1.5px solid var(--bd); background: var(--surf2); color: var(--tx2);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: var(--tr); display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.filter-chip:hover { border-color: var(--pr); color: var(--pr); }
.filter-chip.active { background: var(--pr); border-color: var(--pr); color: var(--pf-on-primary); }
[data-theme=dark] .filter-chip.active { color: var(--pf-bg); }

/* ── CONTENT AREA ── */
.content { max-width: 1200px; margin: 0 auto; padding: 20px 12px 80px; }
.section-title { font-family: var(--pf-font-display); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--tx3); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--bd); }
.section { margin-bottom: 28px; }

/* ── RECENTS HORIZONTAL SCROLL ── */
.recents-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.recents-scroll::-webkit-scrollbar { display: none; }
.recent-chip {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px;
  background: var(--surf); border: 1.5px solid var(--bd);
  text-decoration: none; color: var(--tx);
  font-size: .82rem; font-weight: 500; transition: var(--tr);
  box-shadow: var(--sh);
}
.recent-chip:hover { border-color: var(--pr); color: var(--pr); transform: translateY(-2px); box-shadow: var(--sh-l); }
.recent-chip .ricon { font-size: 1.2rem; }

/* ── CALCULATOR GRID ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
@media(min-width:480px) { .calc-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
@media(min-width:768px) { .calc-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; } }
@media(min-width:1024px) { .calc-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }

.calc-card {
  position: relative; border-radius: var(--r);
  background: var(--surf); border: 1.5px solid var(--bd);
  text-decoration: none; color: var(--tx);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 10px;
  transition: var(--tr); box-shadow: var(--sh); overflow: hidden;
  cursor: pointer;
}
.calc-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--card-color, var(--pr)), transparent 60%); opacity: 0; transition: var(--tr); }
.calc-card:hover::before { opacity: .06; }
.calc-card:hover { transform: translateY(-4px); box-shadow: var(--sh-l); border-color: var(--card-color, var(--pr)); }
.calc-card:active { transform: translateY(-1px); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.card-icon-wrap {
  width: 48px; height: 48px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
  background: color-mix(in srgb, var(--card-color, var(--pr)) 15%, transparent);
}
[data-theme=dark] .card-icon-wrap { background: color-mix(in srgb, var(--card-color, var(--pr)) 20%, transparent); }
.fav-btn {
  border: none; background: none; cursor: pointer; font-size: 1.1rem;
  color: var(--tx3); padding: 2px; border-radius: 6px;
  transition: var(--tr); line-height: 1;
}
.fav-btn:hover { color: var(--ac); transform: scale(1.2); }
.fav-btn.active { color: var(--ac); }

.card-name { font-weight: 700; font-size: .92rem; line-height: 1.3; color: var(--tx); }
.card-sub { font-size: .75rem; color: var(--tx3); }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card-tag { font-size: .65rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--card-color, var(--pr)) 12%, transparent); color: var(--card-color, var(--pr)); }
.card-arrow { position: absolute; bottom: 14px; right: 14px; font-size: .85rem; color: var(--tx3); transition: var(--tr); }
.calc-card:hover .card-arrow { color: var(--card-color, var(--pr)); transform: translateX(3px); }

.badge-new { position: absolute; top: 10px; right: 10px; background: var(--red); color: var(--pf-on-primary); font-size: .6rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }
.badge-hot { background: var(--ac); color: var(--pf-on-accent); }

/* ── NO RESULTS ── */
.no-results { text-align: center; padding: 48px 16px; color: var(--tx3); }
.no-results .nr-icon { font-size: 3rem; margin-bottom: 12px; }
.no-results p { font-size: 1rem; }

/* ── STATS SECTION ── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media(min-width:600px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--surf); border: 1.5px solid var(--bd); border-radius: var(--r);
  padding: 16px 12px; text-align: center; box-shadow: var(--sh);
}
.stat-num { font-family: var(--pf-font-display); font-size: 1.6rem; font-weight: 900; color: var(--pr); line-height: 1; }
.stat-lbl { font-size: .75rem; color: var(--tx3); margin-top: 4px; }

/* ── FIELD MODE ── */
.field-mode body, body.field-mode {
  font-size: 18px !important;
}
body.field-mode .calc-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
body.field-mode .calc-card { padding: 22px 16px; }
body.field-mode .card-name { font-size: 1rem; }
body.field-mode .card-icon-wrap { width: 56px; height: 56px; font-size: 1.8rem; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--tx); color: var(--bg);
  padding: 12px 22px; border-radius: 24px; font-size: .88rem; font-weight: 600;
  box-shadow: 0 4px 24px rgba(0,0,0,.25); z-index: 200; white-space: nowrap;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s;
  opacity: 0; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── OFFLINE BANNER ── */
.offline-banner {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  background: var(--pf-danger); color: var(--pf-on-danger); text-align: center;
  font-size: .85rem; font-weight: 600; padding: 8px; z-index: 300;
}
.offline-banner.show { display: block; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 10px; }

/* ── SKELETON ── */
.skeleton { background: linear-gradient(90deg, var(--bd) 25%, var(--surf2) 50%, var(--bd) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r); }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── TRANSITIONS ── */
.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
