/*
 * heckel-2.css — H&H Heckel Propiedades
 * Bootstrap 5 polish layer for the modernized site.
 * All variables use the --hk-* prefix.
 */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  --hk-primary:       #0c1b3a;
  --hk-primary-dark:  #081229;
  --hk-primary-light: #16305f;
  --hk-accent:        #c8a24a;
  --hk-ink:           #1d2430;
  --hk-muted:         #6b7280;
  --hk-bg:            #f7f8fa;

  --hk-primary-rgb:   12, 27, 58;
  --hk-accent-rgb:    200, 162, 74;

  /* Spacing and sizing */
  --hk-navbar-height: 76px;
  --hk-radius:        0.5rem;
  --hk-radius-sm:     0.25rem;
  --hk-transition:    0.25s ease;
}

/* ============================================================
   2. GLOBAL RESETS AND BASE
   ============================================================ */

/* Ensure the hidden attribute always wins — critical for toggling with JS */
[hidden] {
  display: none !important;
}

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

body {
  /* Navbar is sticky-top (stays in normal flow), so no body padding-top is
     needed. A padding here leaves an empty band above the navbar. */
  background-color: var(--hk-bg);
  color: var(--hk-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--hk-primary);
  text-decoration: none;
}
a:hover {
  color: var(--hk-accent);
}

/* ============================================================
   3. NAVBAR
   ============================================================ */
.navbar {
  min-height: var(--hk-navbar-height);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  z-index: 1030;
}

.navbar-brand img {
  height: 50px;
  width: auto;
}

.navbar .nav-link {
  color: var(--hk-ink);
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  transition: color var(--hk-transition);
  position: relative;
}

.navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.9rem;
  right: 0.9rem;
  height: 2px;
  background: var(--hk-accent);
  transform: scaleX(0);
  transition: transform var(--hk-transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--hk-primary);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
  transform: scaleX(1);
}

/* ============================================================
   4. HERO SECTION — Ken Burns bg, dark overlay, search on top
   ============================================================ */
.hk-hero {
  position: relative;
  min-height: calc(100vh - var(--hk-navbar-height));
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--hk-primary-dark);
}

/* Animated background layer — uses CSS not inline style to avoid CSP issues */
.hk-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/bg-1.jpg');
  background-size: cover;
  background-position: center;
  animation: kenBurns 20s ease-in-out infinite alternate;
  will-change: transform;
}

/* Dark overlay on top of the animated bg */
.hk-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(var(--hk-primary-rgb), 0.80) 0%,
    rgba(var(--hk-primary-rgb), 0.55) 100%
  );
}

@keyframes kenBurns {
  0%   { transform: scale(1.00) translate(0, 0); }
  100% { transform: scale(1.10) translate(-2%, -1%); }
}

.hk-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 3rem 0;
}

.hk-hero-tagline {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.5rem;
}

.hk-hero-subtitle {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2rem;
}

/* ============================================================
   5. SEARCH BOX (.hk-buscador)
   ============================================================ */
.hk-buscador {
  background: #fff;
  border-radius: var(--hk-radius);
  padding: 1.5rem 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.hk-buscador .form-select,
.hk-buscador .form-control {
  border-color: #d1d5db;
  border-radius: var(--hk-radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  transition: border-color var(--hk-transition), box-shadow var(--hk-transition);
}

.hk-buscador .form-select:focus,
.hk-buscador .form-control:focus {
  border-color: var(--hk-accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--hk-accent-rgb), 0.25);
  outline: none;
}

.hk-buscador label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hk-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

/* Gold submit button */
.btn-hk-accent {
  background-color: var(--hk-accent);
  border-color: var(--hk-accent);
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: var(--hk-radius-sm);
  transition: background-color var(--hk-transition), box-shadow var(--hk-transition);
}

.btn-hk-accent:hover,
.btn-hk-accent:focus {
  background-color: #b8913d;
  border-color: #b8913d;
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--hk-accent-rgb), 0.45);
}

/* Navy primary button */
.btn-hk-primary {
  background-color: var(--hk-primary);
  border-color: var(--hk-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--hk-radius-sm);
  transition: background-color var(--hk-transition);
}

.btn-hk-primary:hover,
.btn-hk-primary:focus {
  background-color: var(--hk-primary-light);
  border-color: var(--hk-primary-light);
  color: #fff;
}

/* ============================================================
   6. SECTION TITLES
   ============================================================ */
.hk-section-title {
  text-align: center;
  color: var(--hk-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hk-section-title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background: var(--hk-accent);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

.hk-section-subtitle {
  text-align: center;
  color: var(--hk-muted);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

/* ============================================================
   7. PROPERTY CARDS
   ============================================================ */
.hk-property-card {
  border: 0;
  border-radius: var(--hk-radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: transform var(--hk-transition), box-shadow var(--hk-transition);
  height: 100%;
}

.hk-property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
}

/* Image wrapper — badges are siblings of this, NOT children */
.hk-card-img-wrap {
  position: relative;
  overflow: hidden;
}

.hk-card-img-wrap .ratio img {
  transition: transform 0.45s ease;
}

.hk-property-card:hover .hk-card-img-wrap .ratio img {
  transform: scale(1.06);
}

/* Operation badge — OUTSIDE the .ratio element */
.hk-badge-opera {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: var(--hk-radius-sm);
  z-index: 2;
  color: #fff;
}

.hk-badge-opera--venta {
  background-color: var(--hk-primary);
}

.hk-badge-opera--alquiler {
  background-color: var(--hk-accent);
  color: #fff;
}

/* Price badge — OUTSIDE the .ratio element */
.hk-badge-price {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: rgba(var(--hk-primary-rgb), 0.88);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--hk-radius-sm);
  z-index: 2;
}

.hk-card-body {
  padding: 1rem 1.1rem 1.1rem;
}

.hk-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hk-ink);
  margin-bottom: 0.3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hk-card-location {
  font-size: 0.82rem;
  color: var(--hk-muted);
  margin-bottom: 0.75rem;
}

.hk-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--hk-muted);
}

.hk-card-features span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.hk-card-features img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ============================================================
   8. CAROUSEL COMPATIBILITY (Bootstrap 4/5 mixed legacy)
   ============================================================ */
.carousel .item {
  display: none;
}

.carousel .item.active,
.carousel .item.carousel-item-next,
.carousel .item.carousel-item-prev {
  display: block;
}

/* Both .item and .carousel-item work */
.carousel-item,
.carousel .item {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ============================================================
   9. DETALLE PAGE
   ============================================================ */

/* Sticky sidebar starts below navbar */
.hk-detalle-sidebar {
  position: sticky;
  top: calc(var(--hk-navbar-height) + 1rem);
}

.hk-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.hk-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fff;
  border-radius: var(--hk-radius-sm);
  border: 1px solid #e5e7eb;
  font-size: 0.88rem;
}

.hk-feature-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.hk-map-wrap {
  border-radius: var(--hk-radius);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

/* ============================================================
   10. FOOTER
   ============================================================ */
.hk-footer {
  background-color: var(--hk-primary);
  color: rgba(255, 255, 255, 0.85);
  padding: 3.5rem 0 1.5rem;
}

.hk-footer a {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--hk-transition);
}

.hk-footer a:hover {
  color: var(--hk-accent);
}

.hk-footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hk-accent);
  margin-bottom: 1rem;
}

.hk-footer hr {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 2rem 0 1rem;
}

.hk-footer-bottom {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ============================================================
   11. WHATSAPP FLOATING ACTION BUTTON
   ============================================================ */
.wa-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 1050;

  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;

  background: linear-gradient(135deg, #25d366 0%, #128c4a 100%);
  color: #fff;
  font-size: 1.65rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  animation: waPulse 2.4s ease-in-out infinite;
  transition: transform var(--hk-transition), box-shadow var(--hk-transition);
}

.wa-fab:hover {
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.36);
  animation: none;
}

@keyframes waPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28); }
  50%       { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 0 0 10px rgba(37, 211, 102, 0.18); }
}

.wa-fab.no-motion {
  animation: none;
}

/* Tooltip */
.wa-fab::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 0.75rem);
  top: 50%;
  transform: translateY(-50%);
  background: var(--hk-ink);
  color: #fff;
  font-size: 0.78rem;
  white-space: nowrap;
  padding: 0.3rem 0.65rem;
  border-radius: var(--hk-radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--hk-transition);
}

.wa-fab:hover::before {
  opacity: 1;
}

/* ============================================================
   12. UTILITY / HELPERS
   ============================================================ */

/* Fade-in for sections with IntersectionObserver */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

/* Colored divider */
.hk-divider {
  border: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hk-accent), transparent);
  margin: 2.5rem 0;
}

/* Section padding */
.hk-section {
  padding: 4rem 0;
}

.hk-section-sm {
  padding: 2.5rem 0;
}

/* ============================================================
   13. FORM STYLES (shared by contact form)
   ============================================================ */
.hk-form .form-control,
.hk-form .form-select {
  border-radius: var(--hk-radius-sm);
  border-color: #d1d5db;
  transition: border-color var(--hk-transition), box-shadow var(--hk-transition);
}

.hk-form .form-control:focus,
.hk-form .form-select:focus {
  border-color: var(--hk-accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--hk-accent-rgb), 0.2);
}

.hk-form label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--hk-ink);
}

/* ============================================================
   14. MOBILE — reduce Bootstrap padding accumulation
   ============================================================ */
@media (max-width: 575.98px) {
  .container,
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  .row {
    --bs-gutter-x: 12px;
  }

  .hk-buscador {
    padding: 1rem;
  }

  .hk-hero-tagline {
    font-size: 1.75rem;
  }
}

/* ============================================================
   15. ACTIVE-FILTER CHIPS (.hk-chip)
   ============================================================ */
.hk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: rgba(var(--hk-primary-rgb), 0.07);
  border: 1px solid rgba(var(--hk-primary-rgb), 0.18);
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--hk-primary);
  cursor: pointer;
  transition: background var(--hk-transition), border-color var(--hk-transition), color var(--hk-transition);
  white-space: nowrap;
}

.hk-chip:hover,
.hk-chip:focus-visible {
  background: var(--hk-accent);
  border-color: var(--hk-accent);
  color: #fff;
  outline: none;
}

.hk-chip .bi-x {
  font-size: 0.85rem;
  line-height: 1;
}

/* ============================================================
   16. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hk-hero-bg {
    animation: none;
  }

  .wa-fab {
    animation: none;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
