 {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* BASE */
html, body {
  height: 100%;
  margin: 0;
  color: #222;
}

/* HEADER */
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid #eee;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #19a1c9;
}

/* SEARCH */
.search-bar {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.search-bar input {
  border: none;
  padding: 0.6rem 1rem;
  outline: none;
}

.search-bar button {
  background: #19a1c9;
  border: none;
  color: white;
  padding: 0 1rem;
  cursor: pointer;
}

/* LAYOUT */
.layout {
  display: grid;
  grid-template-columns: 45% 55%;
  height: calc(100vh - 72px);
}

/* MAP */
.map-container {
  height: 100%;
}

#map {
  height: 100%;
  width: 100%;
}

/* LISTINGS */
.listings {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  overflow-y: auto;
}

.card {
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-4px);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-info {
  padding: 0.8rem;
}

.card-info h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.card-info p {
  font-size: 0.85rem;
  color: #717171;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 1030;
}

.modal.active {
  display: flex;
}

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 150px;
  border-radius: 40px 20px 0 0;
  padding: 20px;
  animation: slideUp 0.35s ease;
  position: relative;
   max-height: 90vh;
    overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* IMPORTANT iOS */
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: #f3f3f3;
  cursor: pointer;
  font-weight: 600;
  border-radius: 12px;
}

.tab.active {
  background: #19a1c9;
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

input {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
}
select {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
}
button[type="submit"] {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: #19a1c9;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* DESKTOP */
@media (min-width: 768px) {
  .modal {
    align-items: center;
  }

  .modal-card {
    border-radius: 20px;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }
}

header {
  position: fixed;
  top: 0;
  z-index: 1000;
}

body.modal-open nav {
  display: none !important;
}