/* =============================================================================
   G2J Vacacional – Frontend CSS
   Paleta: Terracota #8B5E3C | Arena #C9A97A | Lino #F5F0EB | Carbón #2C2C2C
   ============================================================================= */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --g2j-terra:   #8B5E3C;
  --g2j-sand:    #C9A97A;
  --g2j-linen:   #F5F0EB;
  --g2j-dark:    #2C2C2C;
  --g2j-grey:    #666666;
  --g2j-border:  #D9CFC5;
  --g2j-white:   #FFFFFF;
  --g2j-radius:  8px;
  --g2j-shadow:  0 2px 12px rgba(139, 94, 60, 0.10);
  --g2j-trans:   0.22s ease;
}

/* ── Errores (solo visibles para admins) ────────────────────────────────────── */
.g2j-error {
  background: #fdecea;
  border-left: 4px solid #c0392b;
  color: #c0392b;
  padding: 12px 16px;
  border-radius: var(--g2j-radius);
  font-size: 14px;
  margin: 16px 0;
}

/* =============================================================================
   BOTONES
   ============================================================================= */
.g2j-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--g2j-radius);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--g2j-trans), color var(--g2j-trans), transform var(--g2j-trans);
  text-decoration: none;
}
.g2j-btn--primary {
  background: var(--g2j-terra);
  color: var(--g2j-white);
  border-color: var(--g2j-terra);
}
.g2j-btn--primary:hover,
.g2j-btn--primary:focus {
  background: #7a5234;
  border-color: #7a5234;
  transform: translateY(-1px);
}
.g2j-btn--outline {
  background: transparent;
  color: var(--g2j-terra);
  border-color: var(--g2j-terra);
}
.g2j-btn--outline:hover {
  background: var(--g2j-terra);
  color: var(--g2j-white);
}
.g2j-btn[disabled],
.g2j-btn.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.g2j-btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: g2j-spin 0.6s linear infinite;
}
.g2j-btn.is-loading .g2j-btn-spinner { display: inline-block; }
.g2j-btn.is-loading .g2j-btn-text    { opacity: 0.7; }
@keyframes g2j-spin { to { transform: rotate(360deg); } }

/* =============================================================================
   FORMULARIO LIST YOUR PROPERTY
   ============================================================================= */
.g2j-form-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 32px;
  background: var(--g2j-white);
  border-radius: 12px;
  box-shadow: var(--g2j-shadow);
}
.g2j-form-title {
  font-size: 28px;
  color: var(--g2j-dark);
  margin: 0 0 8px;
}
.g2j-form-subtitle {
  color: var(--g2j-grey);
  margin: 0 0 32px;
}

.g2j-form-row {
  margin-bottom: 20px;
}
.g2j-form-row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .g2j-form-wrap { padding: 24px 20px; }
  .g2j-form-row--two { grid-template-columns: 1fr; }
}

.g2j-form-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--g2j-dark);
  margin-bottom: 6px;
}
.g2j-form-field label span { color: var(--g2j-terra); margin-left: 2px; }

.g2j-form-field input[type="text"],
.g2j-form-field input[type="email"],
.g2j-form-field input[type="tel"],
.g2j-form-field input[type="url"],
.g2j-form-field input[type="number"],
.g2j-form-field select,
.g2j-form-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid var(--g2j-border);
  border-radius: var(--g2j-radius);
  font-size: 15px;
  color: var(--g2j-dark);
  background: var(--g2j-white);
  transition: border-color var(--g2j-trans);
  appearance: none;
}
.g2j-form-field input:focus,
.g2j-form-field select:focus,
.g2j-form-field textarea:focus {
  outline: none;
  border-color: var(--g2j-terra);
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.12);
}
.g2j-form-field input.has-error,
.g2j-form-field select.has-error {
  border-color: #c0392b;
}
.g2j-form-field textarea { resize: vertical; min-height: 100px; }

/* Checkbox privacidad */
.g2j-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--g2j-grey);
  cursor: pointer;
}
.g2j-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--g2j-terra);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.g2j-checkbox-label a { color: var(--g2j-terra); }

/* Mensajes de respuesta */
.g2j-form-messages {
  margin-top: 16px;
  padding: 0;
  font-size: 15px;
  min-height: 0;
  transition: all var(--g2j-trans);
}
.g2j-form-messages.is-success {
  background: #e8f5ee;
  border-left: 4px solid #2D7A4F;
  color: #2D7A4F;
  padding: 14px 18px;
  border-radius: var(--g2j-radius);
}
.g2j-form-messages.is-error {
  background: #fdecea;
  border-left: 4px solid #c0392b;
  color: #c0392b;
  padding: 14px 18px;
  border-radius: var(--g2j-radius);
}

/* =============================================================================
   MAPA GOOGLE MAPS
   ============================================================================= */
.g2j-map-section {
  position: relative;
  display: flex;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--g2j-shadow);
}
.g2j-map {
  flex: 1;
  min-height: 400px;
}

/* Sidebar de info del marcador */
.g2j-map-sidebar {
  width: 300px;
  background: var(--g2j-white);
  overflow-y: auto;
  border-left: 1px solid var(--g2j-border);
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .g2j-map-section  { flex-direction: column; }
  .g2j-map-sidebar  { width: 100%; border-left: none; border-top: 1px solid var(--g2j-border); max-height: 240px; }
}

/* Tarjeta de propiedad en el sidebar del mapa */
.g2j-map-card {
  padding: 16px;
  border-bottom: 1px solid var(--g2j-border);
}
.g2j-map-card:last-child { border-bottom: none; }
.g2j-map-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}
.g2j-map-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--g2j-dark);
  margin: 0 0 4px;
}
.g2j-map-card .g2j-map-card__meta {
  font-size: 13px;
  color: var(--g2j-grey);
  margin-bottom: 8px;
}
.g2j-map-card .g2j-map-card__precio {
  font-size: 16px;
  font-weight: 700;
  color: var(--g2j-terra);
  margin-bottom: 10px;
}
.g2j-map-card .g2j-btn {
  padding: 8px 16px;
  font-size: 13px;
  width: 100%;
  justify-content: center;
}

/* InfoWindow de Google Maps */
.g2j-infowindow {
  min-width: 200px;
  font-family: inherit;
}
.g2j-infowindow h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--g2j-dark);
  margin: 0 0 6px;
}
.g2j-infowindow .precio {
  color: var(--g2j-terra);
  font-weight: 700;
  font-size: 15px;
}
.g2j-infowindow a {
  display: inline-block;
  margin-top: 8px;
  color: var(--g2j-terra);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

/* =============================================================================
   WIDGET LODGIFY
   ============================================================================= */
.g2j-lodgify-widget-wrap {
  margin: 32px 0;
}
.g2j-lodgify-search-wrap {
  margin: 0;
}
.g2j-lodgify-search-wrap.g2j-search-horizontal .lodgify-search-widget {
  /* El widget de Lodgify gestiona su propio layout interno */
  width: 100%;
}
