/* /imoveis/assets/css/style.css */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f6f6;
  color: #111;
}

.imv-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem;
}

.imv-header {
  background: #111;
  color: #fff;
  padding: 1.5rem 0;
}

.imv-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.imv-subtitle {
  margin: 0.25rem 0 0;
  opacity: 0.8;
}

.imv-back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: #ffd27f;
  text-decoration: none;
  font-size: 0.9rem;
}

.imv-back-link:hover {
  text-decoration: underline;
}

/* GRID LISTA (catálogo público) */

.imv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.imv-card-link {
  text-decoration: none;
  color: inherit;
}

.imv-card {
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.imv-card-cover {
  position: relative;
  padding-top: 62%;
  overflow: hidden;
}

.imv-card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imv-card-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ddd;
  color: #555;
  font-size: 0.9rem;
}

.imv-card-body {
  padding: 0.75rem 0.9rem 1rem;
}

.imv-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.imv-card-location {
  margin: 0 0 0.4rem;
  font-size: 0.86rem;
  color: #666;
}

.imv-card-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: #444;
}

.imv-card-info-row span {
  background: #f1f1f1;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.imv-card-price {
  margin: 0;
  font-weight: 700;
  color: #008b3a;
}

/* PÁGINA DO IMÓVEL */

.imv-imovel-main {
  padding-top: 1.25rem;
}

/* galeria horizontal com scroll snap */

.imv-gallery {
  margin-bottom: 1rem;
}

.imv-gallery-track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

.imv-gallery-item {
  flex: 0 0 80%;
  max-width: 80%;
  scroll-snap-align: center;
  margin: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
}

.imv-gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.imv-gallery-hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.25rem;
}

/* vídeos */

.imv-videos h2,
.imv-details h2 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.imv-videos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.imv-video-wrapper iframe,
.imv-video-wrapper video {
  width: 100%;
  min-height: 220px;
  border-radius: 0.75rem;
  border: none;
  overflow: hidden;
}

/* detalhes */

.imv-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.imv-details-label {
  font-size: 0.75rem;
  color: #777;
}

.imv-details-value {
  font-weight: 600;
}

.imv-address {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.92rem;
}

.imv-description h3 {
  margin: 0 0 0.3rem;
}

.imv-description p {
  margin: 0;
  white-space: pre-wrap;
}

/* contato */

.imv-contact {
  margin: 1.5rem 0 1.25rem;
  text-align: center;
}

.imv-whatsapp-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.imv-whatsapp-btn:hover {
  filter: brightness(0.95);
}

.imv-contact-note {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.35rem;
}

/* rodapé */

.imv-footer {
  border-top: 1px solid #ddd;
  padding: 0.75rem 0 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #777;
}

/* responsivo para galeria */

@media (min-width: 768px) {
  .imv-gallery-item img {
    height: 360px;
  }
}

/* === Admin: formulários e tabelas === */

.imv-form-card {
  background:#fff;
  border-radius:0.75rem;
  padding:1rem 1.1rem 1.25rem;
  box-shadow:0 4px 12px rgba(0,0,0,0.06);
  margin:1rem 0;
}

.imv-field {
  display:flex;
  flex-direction:column;
  margin-bottom:0.75rem;
  font-size:0.9rem;
}

.imv-field span {
  margin-bottom:0.2rem;
  color:#444;
}

.imv-field input,
.imv-field textarea,
.imv-field select {
  border-radius:0.5rem;
  border:1px solid #ccc;
  padding:0.45rem 0.6rem;
  font:inherit;
}

.imv-field textarea {
  resize: vertical;
}

.imv-field-row {
  display:flex;
  flex-wrap:wrap;
  gap:0.75rem;
}

.imv-field-row .imv-field {
  flex:1 1 0;
}

.imv-btn-primary,
.imv-btn-secondary {
  display:inline-block;
  border-radius:999px;
  padding:0.55rem 1.1rem;
  border:none;
  cursor:pointer;
  font-weight:600;
  text-decoration:none;
  text-align:center;
}

.imv-btn-primary {
  background:#111;
  color:#fff;
}

.imv-btn-secondary {
  background:#fff;
  color:#111;
  border:1px solid #fff;
}

.imv-btn-link {
  margin-left:0.5rem;
  color:#ffd27f;
  text-decoration:none;
  font-size:0.9rem;
}

.imv-btn-primary:hover,
.imv-btn-secondary:hover {
  filter:brightness(0.95);
}

.imv-alert {
  background:#ffe9e9;
  color:#842029;
  border-radius:0.5rem;
  padding:0.5rem 0.7rem;
  margin-bottom:0.75rem;
  font-size:0.86rem;
}

.imv-form-hint {
  margin-top:0.5rem;
  font-size:0.8rem;
  color:#666;
}

.imv-header-flex {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
}

.imv-toolbar {
  margin:1rem 0;
}

.imv-admin-table-wrapper {
  overflow-x:auto;
}

.imv-table {
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:0.75rem;
  overflow:hidden;
  box-shadow:0 4px 12px rgba(0,0,0,0.06);
}

.imv-table th,
.imv-table td {
  padding:0.5rem 0.75rem;
  font-size:0.9rem;
  border-bottom:1px solid #eee;
}

.imv-table th {
  text-align:left;
  background:#f7f7f7;
  font-weight:600;
}

.imv-table tr:last-child td {
  border-bottom:none;
}

@media (max-width:600px) {
  .imv-header-flex {
    flex-direction:column;
    align-items:flex-start;
  }
}