/* ==========================================================
   ClasificApp - Estilo Android / Material pastel
   ========================================================== */

:root {
  --primary: #8FCBE0;         /* celeste pastel */
  --primary-dark: #6FB6CE;
  --primary-light: #E4F3F8;
  --secondary: #FFC7A8;       /* durazno pastel */
  --accent: #FFAAB6;          /* rosa pastel */
  --success: #A8E6CF;         /* menta */
  --warning: #FFE2A8;
  --danger: #FF9AA2;
  --gold: #F7D794;
  --silver: #D6D9E0;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --text: #33404F;
  --text-muted: #8A97A6;
  --border: #EAEFF4;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 3px rgba(51, 64, 79, 0.08), 0 1px 2px rgba(51, 64, 79, 0.06);
  --shadow-2: 0 4px 14px rgba(51, 64, 79, 0.10);
  --shadow-3: 0 8px 24px rgba(51, 64, 79, 0.14);
  --nav-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Top App Bar (Android style) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}
.topbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  color: var(--primary-dark);
}
.brand .logo-dot {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  box-shadow: var(--shadow-1);
}
.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 999px;
  padding: 8px 16px;
  gap: 8px;
  border: 1px solid var(--border);
}
.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--text);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border: none;
  font-size: 18px;
  color: var(--text);
  transition: background .15s ease, transform .1s ease;
}
.icon-btn:hover { background: var(--primary-light); }
.icon-btn:active { transform: scale(0.94); }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, opacity .15s ease;
  box-shadow: var(--shadow-1);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #6a3f22; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-success { background: var(--success); color: #226a4d; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); box-shadow: none; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-whatsapp { background: #7FD8A0; color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards (Material elevation) ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: box-shadow .2s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-2); }

.post-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); }
.post-card .thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--primary-light);
}
.post-card .body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.post-card .price { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.post-card .title { font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.post-card .meta { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.post-card .badge-featured {
  position: absolute; margin: 10px; padding: 4px 10px; border-radius: 999px;
  background: var(--gold); font-size: 11px; font-weight: 700; color: #6a4f10;
}
.post-thumb-wrap { position: relative; }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 420px)  { .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* ---------- Category chips (Android chips) ---------- */
.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 0;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
  transition: all .15s ease;
}
.chip.active, .chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Badges (planes) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
}
.badge-free  { background: var(--success); color: #1c6d4c; }
.badge-plata { background: var(--silver); color: #4a5262; }
.badge-oro   { background: var(--gold); color: #7a5b06; }
.badge-status-active { background: var(--success); color: #1c6d4c; }
.badge-status-sold { background: var(--danger); color: #fff; }
.badge-status-pending { background: var(--warning); color: #7a5b06; }
.badge-status-rejected { background: #eee; color: #999; }

/* ---------- FAB (Floating Action Button) ---------- */
.fab {
  position: fixed;
  right: 22px;
  bottom: 86px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-3);
  border: none;
  z-index: 60;
  transition: transform .15s ease;
}
.fab:active { transform: scale(0.92); }

/* ---------- Bottom navigation (mobile Android style) ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  box-shadow: 0 -2px 12px rgba(51,64,79,0.08);
  z-index: 55;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.bottom-nav-inner { display: flex; justify-content: space-around; }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--text-muted); padding: 6px 10px; border-radius: 12px;
  transition: color .15s ease;
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--primary-dark); }
.bottom-nav .bn-icon { font-size: 20px; }

@media (max-width: 768px) {
  .bottom-nav { display: block; }
  body { padding-bottom: calc(var(--nav-h) + 10px); }
  .search-bar { display: none; }
  .search-mobile-trigger { display: flex; }
}
@media (min-width: 769px) {
  .search-mobile-trigger { display: none; }
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-control {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(143,203,224,0.18); }
textarea.form-control { resize: vertical; min-height: 110px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.auth-shell {
  min-height: 90vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-2);
}
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card p.sub { color: var(--text-muted); font-size: 13.5px; margin: 0 0 22px; }

/* ---------- Alerts ---------- */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-success { background: var(--success); color: #1c6d4c; }
.alert-error { background: #FFD9DC; color: #a13341; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); }
.alert-warning { background: var(--warning); color: #7a5b06; }

/* ---------- Section headers ---------- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.section-header h2 { font-size: 18px; margin: 0; }
.section-header a { font-size: 13px; color: var(--primary-dark); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary-light), #fff 70%);
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.hero h1 { font-size: 26px; margin: 0 0 8px; color: var(--text); }
.hero p { color: var(--text-muted); margin: 0 0 18px; max-width: 480px; }
.hero-emoji { font-size: 72px; }

/* ---------- Wallet card ---------- */
.wallet-card {
  background: linear-gradient(135deg, #8FCBE0, #FFAAB6);
  border-radius: var(--radius-lg);
  padding: 26px;
  color: #fff;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}
.wallet-card .label { font-size: 13px; opacity: 0.9; }
.wallet-card .amount { font-size: 32px; font-weight: 800; margin: 6px 0 18px; }
.wallet-card .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wallet-card .btn-outline { border-color: rgba(255,255,255,0.7); color: #fff; }

/* ---------- Plan cards ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 800px) { .plans-grid { grid-template-columns: 1fr; } }
.plan-card {
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  border: 2px solid transparent;
  text-align: center;
  position: relative;
}
.plan-card.current { border-color: var(--primary); }
.plan-card.plan-oro { background: linear-gradient(160deg, #fff, #FFF7E6); }
.plan-card.plan-plata { background: linear-gradient(160deg, #fff, #F3F4F7); }
.plan-card .plan-icon { font-size: 40px; margin-bottom: 8px; }
.plan-card .plan-name { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.plan-card .plan-price { font-size: 26px; font-weight: 800; color: var(--primary-dark); margin: 10px 0; }
.plan-card ul { text-align: left; margin: 16px 0; font-size: 13.5px; color: var(--text); }
.plan-card ul li { padding: 5px 0; display: flex; gap: 8px; align-items: center; }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th, table.data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.data-table tr:hover td { background: var(--primary-light); }

/* ---------- Admin layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.admin-sidebar .brand { padding: 8px 8px 22px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); font-weight: 500;
  margin-bottom: 3px;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--primary-light); color: var(--primary-dark); }
.admin-main { flex: 1; padding: 24px 28px; }
@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .admin-main { padding: 16px; }
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-1); }
.stat-card .stat-icon { font-size: 26px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 24px; font-weight: 800; }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Comments ---------- */
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment .bubble { background: var(--bg); border-radius: var(--radius-md); padding: 10px 14px; flex: 1; }
.comment .who { font-weight: 700; font-size: 13px; }
.comment .when { font-size: 11px; color: var(--text-muted); }

/* ---------- Post detail ---------- */
.post-detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; margin-top: 18px; }
@media (max-width: 860px) { .post-detail-grid { grid-template-columns: 1fr; } }
.post-detail-img { width: 100%; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); aspect-ratio: 4/3; object-fit: cover; background: var(--primary-light); }
.seller-card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-1); }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-20 { gap: 20px; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-10 { margin-top: 10px; } .mt-20 { margin-top: 20px; } .mt-30 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; } .mb-10 { margin-bottom: 10px; } .mb-20 { margin-bottom: 20px; }
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .emoji { font-size: 54px; margin-bottom: 12px; }

.footer { text-align: center; padding: 30px 16px; color: var(--text-muted); font-size: 13px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: var(--shadow-1); font-size: 13px; font-weight: 600;
}
.pagination a.active, .pagination span.active { background: var(--primary); color: #fff; }
