/* Layout: mapa 100%, carrousel superpuesto, barra fija */
:root {
  --bg: #ffffff;
  --surface: #f8f8f8;
  --text: #1a1a1a;
  --muted: #777;
  --accent: #e0702a;
  --border: #e8e8e8;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --bar-h: 52px;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; overflow:hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }

.app-container { height:100%; display:flex; flex-direction:column; overflow:hidden; }
.content { flex:1; position:relative; overflow:hidden; }

/* Mapa: ocupa TODO el content */
.map-full { position:absolute; top:0; left:0; width:100%; height:100%; z-index:1; }
.map-full #map { width:100%; height:100%; }

/* Carrousel: superpuesto sobre el mapa, justo encima de la bottom bar */
.carousel-wrap {
  position:absolute; bottom:calc(var(--bar-h) + 6px); left:0; width:100%;
  display:flex; gap:8px; overflow-x:auto; padding:8px 12px;
  scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
  z-index:400;
}
.carousel-wrap::-webkit-scrollbar { display:none; }
.carousel-card {
  flex:0 0 180px; background:#fff; border-radius:12px; overflow:hidden;
  box-shadow: var(--shadow); scroll-snap-align:start; cursor:pointer;
  border:1px solid var(--border); text-decoration:none; color:inherit;
}
.carousel-card img { width:100%; height:90px; object-fit:cover; display:block; }
.carousel-card-body { padding:7px 9px; }
.carousel-card-body h4 { margin:0 0 3px; font-size:12px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.carousel-card-body .meta { font-size:11px; color: var(--accent); font-weight:600; }
.carousel-card-body .meta span { color: var(--muted); font-weight:400; }

/* Search bar flotante */
.search-float {
  position:absolute; top:10px; left:50%; transform:translateX(-50%);
  width:90%; max-width:480px; z-index:500;
  display:flex; align-items:center; gap:8px;
  background:#fff; border:1px solid var(--border); border-radius:24px;
  padding:8px 14px; box-shadow: var(--shadow);
}
.search-float .search-icon { font-size:16px; color: var(--muted); }
.search-float input { border:none; outline:none; flex:1; font-size:14px; background:transparent; padding:0; }
.search-float input::placeholder { color: #aaa; }

/* Toggle FAB */
.view-toggle-fab {
  position:absolute; top:56px; right:10px; z-index:500;
  background:#fff; border:1px solid var(--border); border-radius:20px;
  padding:6px 12px; font-size:12px; font-weight:500; cursor:pointer;
  box-shadow: var(--shadow); display:flex; align-items:center; gap:5px;
}
.view-toggle-fab.active { background: var(--text); color:#fff; border-color:var(--text); }

/* Bottom bar */
.bottom-bar {
  flex-shrink:0; height:var(--bar-h);
  background: rgba(255,255,255,0.95); border-top:1px solid var(--border);
  display:flex; justify-content:space-around; align-items:center;
}
.nav-item { display:flex; align-items:center; justify-content:center; text-decoration:none; color: #1a1a1a; font-size:20px; flex:1; height:100%; opacity:0.35; }
.nav-item.active { opacity:1; }
.nav-item .icon { line-height:1; }

/* Popup del mapa */
.leaflet-popup-content-wrapper { border-radius:12px; padding:0; overflow:hidden; }
.leaflet-popup-content { margin:0; width:200px !important; }
.popup-img { width:100%; height:110px; object-fit:cover; display:block; }
.popup-body { padding:8px 10px; }
.popup-body h4 { margin:0 0 3px; font-size:13px; font-weight:600; }
.popup-rating { font-size:12px; color: var(--accent); font-weight:600; }
.popup-rating span { color: var(--muted); font-weight:400; }

/* Lista scrollable */
.list-scroll { display:none; padding:12px; overflow-y:auto; gap:10px; }
.list-scroll.active { display:grid; }
.card-row {
  display:flex; gap:12px; background:#fff; border:1px solid var(--border);
  border-radius:14px; overflow:hidden; text-decoration:none; color:inherit;
}
.card-row img { width:100px; height:100px; object-fit:cover; }
.card-row-body { padding:10px 12px 10px 0; display:flex; flex-direction:column; justify-content:center; flex:1; }
.card-row-body h3 { margin:0 0 4px; font-size:15px; }
.card-row-body .meta { font-size:12px; color: var(--muted); }
.card-row-body .meta strong { color: var(--accent); }
.gold { color: #c79a00; font-weight:700; }

/* Login */
.login-page { display:flex; align-items:center; justify-content:center; background: var(--bg); min-height:100vh; }
.login-box { text-align:center; padding:24px; width:100%; max-width:340px; }
.login-box h1 { font-size:32px; margin-bottom:6px; letter-spacing:-0.5px; }
.login-box p { color: var(--muted); font-size:14px; margin-bottom:24px; }
.login-form { display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.login-form input { padding:12px; border-radius:12px; border:1px solid var(--border); font-family:inherit; font-size:15px; outline:none; }
.login-form input:focus { border-color: var(--accent); }
.btn-primary { display:inline-block; background: var(--accent); color:#fff; border:none; padding:14px 24px; border-radius:12px; font-size:15px; font-weight:500; font-family:inherit; cursor:pointer; width:100%; }
.btn-secondary { display:inline-block; background: transparent; color: var(--accent); border:1px solid var(--accent); padding:10px 20px; border-radius:12px; text-decoration:none; font-size:14px; font-weight:500; }
.btn-google { display:block; background:#1a73e8; color:#fff; text-align:center; padding:14px; border-radius:12px; text-decoration:none; font-weight:500; font-size:15px; }
.error { color: #c0392b; font-size:13px; margin:0; }
.divider { color: var(--muted); font-size:13px; margin:16px 0; }
.small { font-size:13px; color: var(--muted); }
.small a { color: var(--accent); text-decoration:none; font-weight:500; }

/* Explore */
.page-header { padding:16px; }
.page-header h2 { margin:0 0 8px; font-size:20px; }
.page-header p { margin:0 0 12px; color: var(--muted); font-size:14px; }
.search-input { width:100%; padding:12px 14px; border-radius:12px; border:1px solid var(--border); font-family:inherit; font-size:15px; outline:none; background: var(--surface); }
.users-list { display:grid; gap:10px; padding:0 16px 80px; }
.user-card { display:flex; gap:14px; align-items:center; background:#fff; border:1px solid var(--border); border-radius:14px; padding:14px; text-decoration:none; color:inherit; }
.user-card img { width:52px; height:52px; border-radius:50%; object-fit:cover; }
.user-card h4 { margin:0 0 2px; font-size:15px; font-weight:600; }
.user-card .tags { font-size:12px; color: var(--muted); }
.user-card .action { margin-left:auto; font-size:13px; color: var(--accent); font-weight:500; white-space:nowrap; }

/* User profile view */
.user-profile { text-align:center; padding:20px 16px; }
.user-profile img { width:90px; height:90px; border-radius:50%; object-fit:cover; margin-bottom:12px; }
.user-profile h2 { margin:0 0 4px; font-size:20px; }
.user-profile .bio { color: var(--muted); font-size:14px; margin-bottom:20px; }
.user-profile .actions { display:flex; gap:10px; justify-content:center; }
.section { margin-top:20px; padding:0 16px; }
.section h3 { font-size:16px; margin-bottom:10px; }
.saved-list { display:flex; gap:12px; overflow-x:auto; padding-bottom:4px; }
.saved-list::-webkit-scrollbar { display:none; }
.mini-card { display:flex; flex-direction:column; gap:6px; min-width:130px; text-decoration:none; color:inherit; }
.mini-card img { width:130px; height:96px; object-fit:cover; border-radius:12px; }
.mini-card span { font-size:13px; text-align:center; }
.empty { color: var(--muted); text-align:center; margin-top:32px; font-size:14px; }

/* Calendar + Chats */
.events-list, .chats-list { display:grid; gap:10px; padding:0 16px 80px; }
.event-card, .chat-card { background:#fff; border:1px solid var(--border); border-radius:14px; padding:14px; text-decoration:none; color:inherit; display:flex; gap:12px; align-items:center; }
.event-card h4, .chat-card h4 { margin:0 0 2px; font-size:15px; }
.event-card p, .chat-card p { margin:0; font-size:13px; color: var(--muted); }
.chat-card img { width:44px; height:44px; border-radius:50%; object-fit:cover; }

/* Chat detail */
.chat-header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border); }
.chat-header a { text-decoration:none; color: var(--text); font-size:16px; font-weight:600; }
.chat-messages { display:flex; flex-direction:column; gap:8px; padding:12px 16px; overflow-y:auto; flex:1; }
.msg { background: var(--surface); border:1px solid var(--border); border-radius:14px; padding:12px; max-width:80%; }
.msg-own { background: var(--text); color: #fff; border-color: var(--text); align-self:flex-end; }
.author { font-size:12px; color: var(--accent); font-weight:600; margin-bottom:2px; }
.msg-own .author { color: rgba(255,255,255,0.7); }
.chat-input-form { display:flex; gap:8px; padding:10px 16px; border-top:1px solid var(--border); background:#fff; }
.chat-input-form input { flex:1; padding:10px 14px; border-radius:12px; border:1px solid var(--border); font-family:inherit; font-size:15px; outline:none; }
.chat-input-form button { background: var(--text); color:#fff; border:none; border-radius:12px; padding:0 18px; cursor:pointer; font-family:inherit; font-weight:500; }
.shared-plans { background: var(--surface); border:1px solid var(--border); border-radius:14px; padding:14px; margin:12px 16px; }
.shared-plans h4 { margin:0 0 10px; font-size:14px; }

/* Detail page */
.detail-page { background: var(--bg); }
.detail-hero { width:100%; height:240px; object-fit:cover; display:block; }
.detail-body { padding:20px 16px 80px; }
.detail-body h2 { margin:0 0 6px; font-size:20px; }
.meta { color: var(--muted); font-size:13px; margin-bottom:16px; }

/* Edit form */
.edit-form { display:flex; flex-direction:column; gap:12px; padding:16px; }
.edit-form label { font-size:13px; color: var(--muted); font-weight:500; }
.edit-form input, .edit-form textarea { padding:10px; border-radius:10px; border:1px solid var(--border); font-family:inherit; font-size:14px; outline:none; }
