/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #00352C;
  --green-light: #004D40;
  --bg: #F9F9F7;
  --white: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --border: #E5E5E0;
  --visited: #00352C;
  --planned: #7EB8C9;
  --ongoing: #F59E0B;
  --wishlist: #E8A598;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 12px rgba(0, 53, 44, 0.08);
  --nav-height: 64px;
  --nav-offset: 100px;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: #E8E6E1;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; font-size: 15px; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-container {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.12);
}

/* ===== PAGES ===== */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: var(--nav-offset);
  overflow-y: auto;
}

.page-no-nav { padding-bottom: 24px; }

.page-body {
  padding: 0 20px 24px;
  flex: 1;
}

/* ===== HOME HEADER ===== */
.home-header {
  background: var(--green);
  color: var(--white);
  padding: 48px 20px 48px;
  border-radius: 0 0 28px 28px;
  position: relative;
  z-index: 1;
}

.home-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.logo {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.tagline {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

.flight-path {
  margin-top: 12px;
  opacity: 0.8;
}

.flight-path svg { width: 100%; height: 36px; }

.avatar-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.35);
  flex-shrink: 0;
  background: none;
  padding: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--green-light);
}

.home-stats-wrap {
  position: relative;
  z-index: 10;
  margin: -28px 20px 0;
}

.stats-card-front {
  margin-bottom: 0;
  box-shadow: 0 4px 20px rgba(0, 53, 44, 0.12);
}

.home-body { padding: 24px 20px 24px; }

/* ===== STATS CARD ===== */
.stats-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-header h2,
.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.section-title { margin: 24px 0 12px; }

.link-btn {
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}

/* ===== TRIPS CAROUSEL ===== */
.trips-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 28px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.trips-carousel::-webkit-scrollbar { display: none; }

.trip-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.trip-card:active { transform: scale(0.97); }

.trip-card-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--green-light), var(--green));
}

.trip-card-body { padding: 10px 12px; }

.trip-card-city {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.trip-card-country {
  font-size: 12px;
  color: var(--text-muted);
}

.trip-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.empty-carousel {
  font-size: 14px;
  color: var(--text-muted);
  padding: 20px 0;
  text-align: center;
  width: 100%;
}

/* ===== MAP PREVIEW ===== */
.map-preview {
  border-radius: var(--radius);
  overflow: hidden;
  height: 160px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  background: #D4E8E0;
}

#mini-map { width: 100%; height: 100%; }

/* ===== DISTANCE CARD ===== */
.distance-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.distance-icon { font-size: 28px; }

.distance-label {
  font-size: 13px;
  color: var(--text-muted);
}

.distance-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 52px 20px 16px;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}

/* ===== SEARCH ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
}

.search-bar input::placeholder { color: #B0B0AA; }

.filter-btn { color: var(--text-muted); padding: 2px; }

/* ===== TRIPS LIST ===== */
.trips-list { display: flex; flex-direction: column; gap: 10px; }

.trip-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
  text-decoration: none;
  color: inherit;
}

.trip-row:active { transform: scale(0.98); }

.trip-row-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--green-light), var(--green));
}

.trip-row-info { flex: 1; min-width: 0; }

.trip-row-city {
  font-weight: 600;
  font-size: 15px;
}

.trip-row-country {
  font-size: 13px;
  color: var(--text-muted);
}

.trip-row-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.trip-row-status {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trip-row-status svg { color: white; }

.trip-row-status.future { background: var(--planned); }
.trip-row-status.ongoing { background: var(--ongoing); }
.trip-row-status.wishlist { background: var(--wishlist); }

.empty-list {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== MAP PAGE ===== */
.page-map {
  padding-bottom: 0;
  position: relative;
}

#full-map {
  width: 100%;
  height: calc(100vh - var(--nav-offset) + 20px);
  z-index: 1;
}

.map-sheet {
  position: fixed;
  bottom: var(--nav-offset);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 20px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 14px;
}

.map-sheet-stats {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.dot-sep { margin: 0 6px; color: var(--text-muted); }

.map-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.visited { background: var(--visited); }
.legend-dot.planned { background: var(--planned); }
.legend-dot.ongoing { background: var(--ongoing); }
.legend-dot.wishlist { background: var(--wishlist); }

/* ===== PROFILE ===== */
.profile-header {
  background: var(--green);
  color: var(--white);
  padding: 52px 20px 32px;
  border-radius: 0 0 28px 28px;
  text-align: center;
}

.profile-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.3);
  background: var(--green-light);
}

.avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--white);
  color: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#profile-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  outline: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}

#profile-name:focus { border-bottom-color: rgba(255,255,255,0.4); }

.profile-since {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

.profile-header + .page-body { margin-top: -16px; }

.profile-header + .page-body .stats-card { margin-bottom: 8px; }

/* ===== BADGES ===== */
.badges-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.badges-row::-webkit-scrollbar { display: none; }

.badge {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.badge.earned { opacity: 1; }

.badge-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow);
}

.badge.earned .badge-circle {
  border-color: var(--green);
  background: #E8F5F0;
}

.badge-name {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  max-width: 72px;
  color: var(--text-muted);
}

.badge.earned .badge-name { color: var(--green); }

/* ===== STATS LIST ===== */
.stats-list { display: flex; flex-direction: column; gap: 2px; }

.stat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.stat-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #E8F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-row-info { flex: 1; }

.stat-row-label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-row-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ===== TRIP DETAIL PAGE ===== */
.page-detail { padding-bottom: var(--nav-offset); }

.detail-hero {
  position: relative;
  height: 280px;
  overflow: hidden;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--green-light), var(--green));
}

.detail-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 48px 16px 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  backdrop-filter: blur(4px);
}

.detail-body { padding: 20px; }

.detail-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
}

.detail-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.detail-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--border);
}

.places-list { display: flex; flex-direction: column; gap: 8px; }

.places-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  padding: 10px 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.place-pin {
  color: var(--green);
  font-size: 16px;
}

.convert-trip-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.convert-trip-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin: 6px 0 14px;
  line-height: 1.5;
}

.convert-trip-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.convert-trip-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.convert-trip-form .date-inputs {
  margin-bottom: 14px;
}

.detail-menu-dropdown {
  position: fixed;
  top: 100px;
  right: 20px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 200;
  min-width: 160px;
}

.detail-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 12px 18px;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  transition: background 0.15s;
}

.detail-menu-dropdown button:hover { background: var(--bg); }
.detail-menu-dropdown button.danger { color: #DC2626; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  animation: fadeOverlay 0.2s ease;
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  width: 100%;
  max-width: 430px;
  max-height: 92vh;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.modal-header h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.modal-body { padding: 0 20px 32px; }

/* ===== FORM ===== */
.cover-upload {
  display: block;
  margin-bottom: 20px;
  cursor: pointer;
}

.cover-upload-inner {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  transition: border-color 0.2s;
  min-height: 140px;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.cover-upload-inner.has-image {
  border-style: solid;
  color: transparent;
}

.cover-upload:hover .cover-upload-inner { border-color: var(--green); }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--green); }

.date-inputs {
  display: flex;
  gap: 12px;
}

.date-field {
  flex: 1;
  position: relative;
}

.date-field input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  outline: none;
}

.date-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.places-input-wrap {
  display: flex;
  gap: 8px;
}

.places-input-wrap input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  outline: none;
}

.places-input-wrap input:focus { border-color: var(--green); }

.small-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: white;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.places-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.place-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #E8F5F0;
  color: var(--green);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.place-tag button {
  font-size: 16px;
  line-height: 1;
  color: var(--green);
  opacity: 0.6;
}

.photos-upload {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  position: relative;
}

.photo-thumb-wrap {
  position: relative;
}

.photo-thumb-wrap button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #DC2626;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-add {
  width: 72px;
  height: 72px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s;
}

.photo-add:hover { border-color: var(--green); color: var(--green); }

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--green);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius);
  margin-top: 8px;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:hover { background: var(--green-light); }

/* ===== AUTH ===== */
.auth-page {
  padding: 48px 20px 24px;
  justify-content: flex-start;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--green);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}

.auth-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--green);
}

.auth-card .form-group input[type="email"],
.auth-card .form-group input[type="password"],
.auth-card .form-group input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-footer a {
  color: var(--green);
  font-weight: 600;
}

.auth-error {
  color: #DC2626;
  font-size: 14px;
  margin-bottom: 8px;
}

.auth-cta-card {
  background: #E8F5F0;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.auth-cta-card p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
}

.auth-cta-actions {
  display: flex;
  gap: 10px;
}

.auth-cta-actions .btn-primary,
.auth-cta-actions .btn-secondary {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
}

.auth-cta-actions .btn-secondary {
  background: var(--white);
  color: var(--green);
  border: 1px solid var(--border);
}

.side-menu-logout {
  width: 100%;
  text-align: left;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
}

/* ===== FORM PAGE ===== */
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 16px 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.form-header h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.form-page { padding-top: 0; }

.empty-text {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== ABOUT LINK (perfil) ===== */
.about-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}

.about-link:active { transform: scale(0.98); }

.about-link-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #E8F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.about-link strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.about-link p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.about-link svg {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}

/* ===== ABOUT PAGE ===== */
.page-about { padding-bottom: var(--nav-offset); }

.about-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 48px 20px 20px;
}

.about-header h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  margin-right: 40px;
}

.about-intro {
  padding: 0 20px 32px;
}

.about-logo {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 12px;
}

.about-intro p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

.about-intro strong { color: var(--text); }

/* ===== BOTTOM NAV (floating) ===== */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 400px;
  height: var(--nav-height);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-radius: 40px;
  z-index: 200;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  transition: color 0.2s;
  text-decoration: none;
}

.nav-item.active { color: var(--green); }

.nav-menu-btn {
  background: none;
  border: none;
}

.nav-add { margin-top: -20px; }

.add-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 28px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 53, 44, 0.35);
  transition: transform 0.15s;
}

.add-circle:active { transform: scale(0.92); }

/* ===== HOW IT WORKS (Sobre nós) ===== */
.how-it-works {
  background: var(--green);
  color: var(--white);
  padding: 40px 20px 48px;
  border-radius: 28px 28px 0 0;
  margin-top: 8px;
}

.how-it-works h2 {
  font-family: var(--serif);
  font-size: 24px;
  text-align: center;
  margin-bottom: 28px;
}

.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 16px;
}

.how-item { text-align: center; }

.how-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.how-item h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.how-item p {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.5;
}

/* ===== LEAFLET OVERRIDES ===== */
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { font-size: 13px; margin: 10px 14px; }

.trip-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.trip-marker.completed { background: var(--visited); }
.trip-marker.future { background: var(--planned); }
.trip-marker.ongoing { background: var(--ongoing); }
.trip-marker.wishlist { background: var(--wishlist); }

/* ===== CITY COUNT MARKERS ===== */
.city-count-marker {
  border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: transform 0.15s;
}

.city-count-marker:active { transform: scale(0.9); }

.city-count-marker.md {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.city-count-marker.sm {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-width: 2px;
}

.city-count-marker.completed { background: var(--visited); }
.city-count-marker.future { background: var(--planned); }
.city-count-marker.ongoing { background: var(--ongoing); }
.city-count-marker.wishlist { background: var(--wishlist); }

/* ===== MAP CITY PANEL ===== */
.map-city-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px);
  max-width: 360px;
  max-height: 70vh;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  z-index: 1100;
  overflow-y: auto;
  padding: 20px;
  animation: panelIn 0.2s ease;
}

@keyframes panelIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.map-panel-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.map-panel-header {
  margin-bottom: 14px;
  padding-right: 24px;
}

.map-panel-header h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.map-panel-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.map-panel-visits {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: #E8F5F0;
  padding: 3px 10px;
  border-radius: 12px;
}

.map-panel-trip {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.map-panel-trip:active { transform: scale(0.98); }

.map-panel-cover {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.map-panel-trip-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-panel-trip-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
}

.map-panel-trip-date {
  font-size: 13px;
  color: var(--text-muted);
}

.map-panel-trip-dist {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.map-panel-trip-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-panel-more {
  margin-top: 12px;
  font-size: 14px;
  padding: 12px;
}

.map-panel-list-header {
  margin-bottom: 14px;
  padding-right: 24px;
}

.map-panel-back {
  background: none;
  border: none;
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
}

.map-panel-list-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.map-panel-list-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.map-panel-trips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-trip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}

.map-trip-row:active { transform: scale(0.98); }

.map-trip-row img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.map-trip-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-trip-row-info strong {
  font-size: 13px;
  color: var(--green);
}

.map-trip-row-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.map-trip-row-dist {
  font-weight: 600;
  color: var(--green) !important;
}

.map-trip-row > svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.legend-item small {
  font-size: 10px;
  color: var(--text-muted);
}

/* ===== DISTANCE & ROUTE ===== */
.distance-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #E8F5F0;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.distance-preview-icon { font-size: 24px; }

.distance-preview-label {
  font-size: 12px;
  color: var(--text-muted);
}

.distance-preview-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.trip-route-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0 8px;
  box-shadow: var(--shadow);
}

.route-point {
  display: flex;
  align-items: center;
  gap: 12px;
}

.route-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.route-dot.origin { background: var(--text-muted); }
.route-dot.dest { background: var(--green); }

.route-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.route-city {
  font-size: 15px;
  font-weight: 600;
}

.route-line {
  border-left: 2px dashed var(--border);
  margin: 8px 0 8px 5px;
  padding: 8px 0 8px 20px;
}

.route-distance {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  background: #E8F5F0;
  padding: 4px 10px;
  border-radius: 12px;
}

.trip-row-route {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
  margin-top: 2px;
}

/* ===== COMMERCE ===== */
.commerce-section {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.commerce-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.commerce-card-sm {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}

.commerce-card-sm:active { transform: scale(0.98); }

.commerce-cat-icon { font-size: 22px; }

.commerce-card-sm-info {
  flex: 1;
  min-width: 0;
}

.commerce-card-sm-info strong {
  display: block;
  font-size: 14px;
}

.commerce-card-sm-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--white);
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid var(--green);
  text-align: center;
  text-decoration: none;
  margin-top: 12px;
  transition: background 0.2s;
}

.btn-secondary:hover { background: #E8F5F0; }

.commerce-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 48px 20px 16px;
}

.commerce-header h1 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.commerce-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.map-link-btn { flex-shrink: 0; margin-left: auto; }

.radius-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #E8F5F0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.radius-info-icon { font-size: 18px; }

.radius-info strong { color: var(--green); }

.commerce-cat-title {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text);
}

.commerce-list { padding-bottom: 24px; }

.commerce-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}

.commerce-card:active { transform: scale(0.98); }

.commerce-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #E8F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.commerce-card-body { flex: 1; min-width: 0; }

.commerce-card-body strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.commerce-card-addr {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.commerce-card > svg { color: var(--text-muted); flex-shrink: 0; }

/* ===== STARS ===== */
.stars {
  display: flex;
  align-items: center;
  gap: 2px;
}

.star {
  background: none;
  border: none;
  font-size: 16px;
  color: #D1D5DB;
  cursor: default;
  padding: 0 1px;
  line-height: 1;
}

.star.filled { color: #F59E0B; }

.stars-interactive .star { cursor: pointer; transition: color 0.15s, transform 0.15s; }
.stars-interactive .star:hover { transform: scale(1.15); }

.stars-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}

/* ===== COMMERCE DETAIL ===== */
.commerce-detail-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.commerce-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.commerce-detail-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 48px 16px 0;
}

.page-commerce-detail .page-body {
  margin-top: -16px;
  position: relative;
}

.commerce-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 20px 0;
}

.category-badge {
  background: #E8F5F0;
  color: var(--green);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.commerce-detail-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}

.commerce-detail-address {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.commerce-detail-desc {
  font-size: 15px;
  line-height: 1.6;
}

.rating-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.rating-block .stars-interactive .star { font-size: 28px; }

.rating-block-inline {
  margin-top: 4px;
  padding: 0;
  background: none;
  box-shadow: none;
}

.trip-rating-group .rating-block-inline .stars-interactive .star { font-size: 32px; }

.commerce-mini-map {
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* ===== COMMERCE MAP PAGE ===== */
.page-commerce-map {
  padding-bottom: 0;
  position: relative;
}

.commerce-map-top {
  position: absolute;
  top: 48px;
  left: 16px;
  z-index: 1000;
}

.floating-back { box-shadow: 0 2px 12px rgba(0,0,0,0.15); }

#commerce-full-map {
  width: 100%;
  height: calc(100vh - var(--nav-offset));
  z-index: 1;
}

.commerce-map-sheet {
  position: fixed;
  bottom: var(--nav-offset);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 28px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.commerce-map-sheet h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.commerce-legend { margin-top: 12px; }

.commerce-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.city-center-marker {
  font-size: 20px;
  line-height: 1;
}

/* ===== SIDE MENU ===== */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 500;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.side-menu-overlay.open { opacity: 1; }

.side-menu {
  width: 100%;
  max-width: 320px;
  height: 100%;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.side-menu-overlay.open .side-menu { transform: translateX(0); }

.side-menu-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 52px 20px 24px;
  background: var(--green);
  color: var(--white);
}

.side-menu-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}

.side-menu-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.side-menu-since {
  font-size: 12px;
  opacity: 0.75;
}

.side-menu-close {
  margin-left: auto;
  flex-shrink: 0;
}

.side-menu-links {
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-menu-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}

.side-menu-link:active { transform: scale(0.98); }

.side-menu-link-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #E8F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.side-menu-link strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.side-menu-link span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== EXPLORAR PAGE ===== */
.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 20px;
}

.cities-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.cities-grid::-webkit-scrollbar { display: none; }

.city-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 100px;
}

.city-chip.active {
  border-color: var(--green);
  background: #E8F5F0;
}

.city-chip-flag { font-size: 22px; }

.city-chip-name {
  font-size: 14px;
  font-weight: 600;
}

.city-chip-count {
  font-size: 11px;
  color: var(--text-muted);
}

.form-commerce-section {
  padding: 0 20px 32px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 24px;
}

.form-commerce-section .section-title {
  margin: 0;
}

.form-commerce-section .commerce-list {
  margin-top: 8px;
}

.explorar-actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.commerce-card-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #E8F5F0;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .app-container {
    margin: 20px 0;
    border-radius: 24px;
    min-height: calc(100vh - 40px);
    overflow: hidden;
  }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: var(--nav-offset);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 400;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
