/* Modulos: Arrendamos & Vendemos + Aporte Facil */

.dropdown-content--empresa {
  min-width: 280px;
}

.dropdown-item-empresa {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
}

.dropdown-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ——— Modulo inmobiliario ——— */
.module-hero {
  min-height: 48vh;
  display: flex;
  align-items: flex-end;
  padding: 6.5rem 0 2.75rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(
    165deg,
    var(--color-tertiary) 0%,
    var(--color-primary) 55%,
    var(--color-secondary) 100%
  );
}

.module-hero--inmobiliaria {
  background:
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(214, 176, 111, 0.1) 0%, transparent 55%),
    linear-gradient(165deg, var(--color-tertiary) 0%, var(--color-primary) 55%, var(--color-secondary) 100%);
}

.module-hero--aporte {
  background:
    radial-gradient(ellipse 50% 40% at 10% 30%, rgba(76, 175, 0, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, var(--color-tertiary) 0%, var(--color-primary) 55%, var(--color-secondary) 100%);
}

.module-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.module-brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
}

.module-hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  max-width: 820px;
}

.filters-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 26, 47, 0.85);
}

.filters-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.filters-bar select,
.filters-bar input {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--color-secondary);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.filters-bar select:focus,
.filters-bar input:focus {
  outline: 2px solid rgba(214, 176, 111, 0.45);
  outline-offset: 1px;
}

.btn-filter {
  align-self: end;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-filter:hover {
  background: transparent;
  color: var(--gold);
}

.btn-clear {
  align-self: end;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-clear:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.catalog-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.property-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #041a2f;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.property-card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--color-secondary);
  overflow: hidden;
}

.property-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-arriendo {
  background: var(--gold);
  color: var(--color-primary);
}

.badge-venta {
  background: #fff;
  color: var(--color-primary);
}

.badge-destacado {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(214, 176, 111, 0.9);
  color: var(--color-primary);
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

.property-card__body {
  padding: 1.1rem 1.15rem 1.25rem;
}

.property-card__price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.property-card__title {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.property-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.property-card__link {
  display: inline-block;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}

.property-card__link:hover {
  text-decoration: underline;
}

.catalog-empty {
  margin-top: 2rem;
  padding: 2.5rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
}

.catalog-loading {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
}

/* Detalle inmueble */
.detail-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.gallery-main {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--color-secondary);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.gallery-thumbs button {
  flex-shrink: 0;
  width: 80px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: none;
}

.gallery-thumbs button.active,
.gallery-thumbs button:hover {
  border-color: var(--gold);
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  background: #041a2f;
  align-self: start;
  position: sticky;
  top: 7.5rem;
}

.detail-price {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.detail-tag {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  color: var(--muted);
}

.detail-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-feature {
  text-align: center;
}

.detail-feature strong {
  display: block;
  font-size: 1.25rem;
  color: var(--gold);
  font-family: var(--font-heading);
}

.detail-feature span {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-description {
  margin-top: 2rem;
}

.detail-description h2 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

/* ——— Aporte Facil ——— */
.aporte-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.aporte-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  background: #041a2f;
  transition: transform 0.25s ease;
}

.aporte-card:hover {
  transform: translateY(-4px);
}

.aporte-card h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
}

.aporte-card p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.aporte-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

.aporte-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}

.aporte-link-btn:hover {
  border-color: var(--gold);
  background: rgba(214, 176, 111, 0.1);
  color: var(--gold);
}

.contact-form {
  margin-top: 2.5rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #041a2f;
}

.contact-form h2 {
  margin-bottom: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--color-secondary);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid rgba(214, 176, 111, 0.45);
}

.form-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(76, 175, 0, 0.15);
  border: 1px solid rgba(76, 175, 0, 0.4);
  color: #a5d86a;
}

.form-message.error {
  display: block;
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #f5a5ad;
}

/* ——— Admin ——— */
.admin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: linear-gradient(
    165deg,
    var(--color-tertiary) 0%,
    var(--color-primary) 50%,
    var(--color-secondary) 100%
  );
}

.login-card {
  width: min(420px, 100%);
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4, 26, 47, 0.95);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-card .subtitle {
  text-align: center;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}

.admin-panel {
  padding: 6rem 0 4rem;
  background: var(--bg-soft);
  min-height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-secondary {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.btn-secondary:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(220, 53, 69, 0.5);
  background: rgba(220, 53, 69, 0.15);
  color: #f5a5ad;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
}

.btn-danger:hover {
  background: rgba(220, 53, 69, 0.3);
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.admin-tab {
  padding: 0.55rem 1rem;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.92rem;
  border-radius: 6px 6px 0 0;
}

.admin-tab.active {
  color: var(--gold);
  background: rgba(214, 176, 111, 0.1);
}

.admin-form {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #041a2f;
  margin-bottom: 2rem;
}

.admin-form h2 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.admin-table .actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-body);
}

.btn-edit:hover {
  background: rgba(214, 176, 111, 0.15);
}

.status-active {
  color: #a5d86a;
}

.status-inactive {
  color: #f5a5ad;
}

.footer-admin-link {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  opacity: 0.45;
}

.footer-admin-link a {
  color: var(--muted);
  text-decoration: none;
}

.footer-admin-link a:hover {
  color: var(--gold);
  opacity: 1;
}

/* ——— Login admin ——— */
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.login-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
}

.login-brand-rae {
  width: 64px !important;
  height: auto !important;
  max-height: 52px;
}

.btn-login {
  width: 100%;
  text-align: center;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.85rem;
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-hint {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(214, 176, 111, 0.08);
  border: 1px solid rgba(214, 176, 111, 0.25);
  font-size: 0.82rem;
  text-align: center;
}

.login-hint p {
  margin: 0.2rem 0;
  color: var(--muted);
}

.login-hint strong {
  color: var(--gold);
}

.login-back {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
}

.login-back a {
  color: var(--gold);
  text-decoration: none;
}

.login-back a:hover {
  text-decoration: underline;
}

/* ——— Subida de imagenes admin ——— */
.file-upload-zone {
  position: relative;
  padding: 2rem 1.5rem;
  border: 2px dashed rgba(214, 176, 111, 0.35);
  border-radius: 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(214, 176, 111, 0.06);
}

.file-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-zone p {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 0.95rem;
}

.file-upload-zone small {
  color: var(--muted);
  font-size: 0.78rem;
}

.image-preview-grid,
.existing-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.preview-thumb,
.existing-thumb {
  position: relative;
  width: 88px;
  height: 66px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.preview-thumb img,
.existing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.existing-thumb .btn-remove-img {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}

.admin-table .thumb-cell img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(76, 175, 0, 0.15);
  border: 1px solid rgba(76, 175, 0, 0.4);
  color: #a5d86a;
}

.form-status.error {
  display: block;
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #f5a5ad;
}

@media (max-width: 980px) {
  .filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-info {
    position: static;
  }

  .aporte-grid,
  .aporte-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .filters-bar {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-features {
    grid-template-columns: repeat(3, 1fr);
  }
}
