/* ============================================================
   site-extras.css — Estilos comunes del sitio
   - Pie de página unificado
   - Botón flotante de WhatsApp (animado)
   - Botón "Compartir" de los departamentos
   - Filtros de departamentos.html
   ============================================================ */

/* ===== PROTECCIÓN: la página nunca se desplaza hacia los costados ===== */
html, body { max-width: 100%; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}

/* ===== PIE DE PÁGINA ===== */
footer.site-footer {
  background: #0d2137;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 0;
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
}
footer.site-footer a { text-decoration: none; }
/* Páginas de departamento: separación con el contenido */
body:has(.sticky-price-bar) footer.site-footer { margin-top: 60px; }

.site-footer .sf-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 20px 22px;
  text-align: center;
}
.site-footer .sf-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.site-footer .sf-creci {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.4px;
}
.site-footer .sf-copy { color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.site-footer .sf-mail {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13.5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
}
.site-footer .sf-mail a { color: rgba(255, 255, 255, 0.85); font-weight: 500; overflow-wrap: anywhere; }
.site-footer .sf-mail a:hover { color: #ffb703; }
.site-footer .sf-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 20px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.site-footer .sf-bottom a { color: #ffb703; font-weight: 600; }
.site-footer .sf-bottom a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .site-footer .sf-main { padding: 24px 16px 20px; }
  .site-footer .sf-mail { flex-direction: column; gap: 2px; }
  .site-footer .sf-mail .sf-sep { display: none; }
  /* Espacio extra para que el botón flotante no tape el texto final */
  .site-footer .sf-bottom { padding: 12px 16px 22px; }
}

/* ===== BOTÓN FLOTANTE DE WHATSAPP ===== */
.wa-float {
  position: fixed;
  right: 24px;
  bottom: 34px;
  z-index: 998;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
  -webkit-animation: wa-float 3s ease-in-out infinite;
          animation: wa-float 3s ease-in-out infinite;
}
.wa-float svg { width: 30px; height: 30px; fill: currentColor; position: relative; z-index: 1; }
/* Onda verde que se expande */
.wa-float::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  background: #25d366;
  z-index: 0;
  pointer-events: none;
  -webkit-animation: wa-pulse 2.4s ease-out infinite;
          animation: wa-pulse 2.4s ease-out infinite;
}
.wa-float:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); }

@-webkit-keyframes wa-float {
  0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); }
  50%      { -webkit-transform: translateY(-8px); transform: translateY(-8px); }
}
@keyframes wa-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@-webkit-keyframes wa-pulse {
  0%   { -webkit-transform: scale(1); transform: scale(1); opacity: 0.55; }
  80%, 100% { -webkit-transform: scale(1.45); transform: scale(1.45); opacity: 0; }
}
@keyframes wa-pulse {
  0%   { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(1.45); opacity: 0; }
}

@media (max-width: 768px) {
  .wa-float { right: 18px; bottom: 30px; width: 56px; height: 56px; }
  /* Páginas de departamento: hay una barra fija abajo, el botón va encima */
  body:has(.sticky-price-bar) .wa-float { bottom: 108px; }
}

/* ===== BOTÓN COMPARTIR (páginas de departamento) ===== */
.rating-bar { flex-wrap: wrap; row-gap: 10px; }
.share-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid #e8e4dc;
  border-radius: 30px;
  background: #fff;
  color: #2c3e50;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.share-btn:hover { border-color: #ffb703; color: #fb8500; box-shadow: 0 3px 12px rgba(255, 183, 3, 0.2); }
.share-btn svg { flex-shrink: 0; }

/* Aviso breve ("Enlace copiado") */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10000;
}
.site-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== FILTROS (departamentos.html) ===== */
.dfilters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -8px 0 22px;
}
.dfilters > * { min-width: 0; }
.dfilters-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 100%; }
.dchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #e8e4dc;
  border-radius: 30px;
  background: #fff;
  color: #2c3e50;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.dchip:hover { border-color: #ffb703; }
.dchip.active {
  background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(255, 183, 3, 0.3);
}
.dfilters-cap { display: flex; align-items: center; gap: 8px; }
.dfilters-cap label { font-size: 14px; font-weight: 600; color: #2c3e50; white-space: nowrap; }
.dfilters-cap select {
  padding: 8px 34px 8px 14px;
  border: 1px solid #e8e4dc;
  border-radius: 30px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 14px center;
  -webkit-appearance: none;
  appearance: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #2c3e50;
  cursor: pointer;
}
.dfilters-cap select:focus { outline: none; border-color: #ffb703; }
.dfilters-count { margin: 0 0 14px; font-size: 13px; color: #6b7280; }
.dfilters-count:empty { display: none; }
.dfilters-empty {
  padding: 28px 20px;
  border: 1px dashed #e8e4dc;
  border-radius: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 15px;
  margin-bottom: 24px;
}

/* Celular: filtros en cuadrícula prolija de 2 columnas */
@media (max-width: 580px) {
  .dfilters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: -6px 0 18px;
  }
  .dfilters-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .dchip {
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 8px;
    border-radius: 12px;
    font-size: 14px;
    white-space: normal;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }
  /* "Todos" sólo aparece (a lo ancho) cuando hay filtros aplicados, para limpiarlos */
  .dchip[data-filter="all"] {
    grid-column: 1 / -1;
    order: 5;
    background: #fafaf8;
    font-weight: 600;
  }
  .dchip[data-filter="all"].active { display: none; }
  .dfilters-cap {
    width: 100%;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 4px 4px 4px 14px;
    min-height: 44px;
  }
  .dfilters-cap label { font-size: 14px; }
  .dfilters-cap select {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 10px;
    padding: 9px 30px 9px 10px;
    background-color: #fafaf8;
    background-position: right 12px center;
  }
  .dfilters-count { text-align: center; }
}
