/* ========= MAGMA overrides (limpio) ========= */

/* -------------------- Variables / marca -------------------- */
:root,
html,
body,
[data-theme="light"],
[data-theme="dark"]{
  --accent: #F59E0B !important;
  --accent-rgb: 245,158,11 !important;
}

/* -------------------- Enlaces globales -------------------- */
a,
a:visited,
.breadcrumb a,
footer a {
  color: var(--accent) !important;
  text-decoration: none !important;
}
a:hover { text-decoration: underline !important; }

/* Dentro de las cards, los enlaces NO usan naranja: heredan negro */
.cards-grid .card a,
.cards-grid .card a:visited {
  color: inherit !important;
  text-decoration: none !important;
}
.cards-grid .card a:hover { text-decoration: underline !important; }

/* -------------------- Botón primario -------------------- */
.btn-primary,
button.btn-primary,
a.btn-primary,
html body .btn.btn-primary,
button[type="submit"].btn-primary,
input[type="submit"].btn-primary{
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #04131f !important;
  background-image: none !important;
}
.btn-primary:hover,
.btn-primary:focus{
  filter: brightness(1.05) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25);
}

/* -------------------- Topbar fija clara -------------------- */
.topbar { background:#fff; border-bottom:1px solid rgba(0,0,0,.08); color:#111; }
[data-theme="dark"] .topbar { background:#fff; color:#111; }

.topbar-inner { display:flex; align-items:center; justify-content:flex-end; gap:12px; padding-block:6px; }
.topbar-right { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.tb-link, .tb-social { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#111; text-decoration:none; }
.tb-link:hover, .tb-social:hover { opacity:.85; }
.tb-sep { width:1px; height:16px; background:rgba(0,0,0,.25); display:inline-block; }
.tb-link svg { width:16px; height:16px; }
.tb-social svg { width:18px; height:18px; }
.tb-wa svg { color:#25D366; } .tb-mail svg { color:#111; } .tb-fb svg { color:#1877F2; } .tb-ig svg { color:#E4405F; }

@media (max-width:768px){
  .tb-link span { display:none; }
  .tb-sep { display:none; }
  .topbar-right { gap:10px; }
}

/* -------------------- Ancho del contenido -------------------- */
.wrap, .container { max-width: 1240px; }
@media (min-width: 1400px){ .wrap, .container { max-width: 1320px; }}

/* -------------------- Grilla de cards (4 col) -------------------- */
.cards-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:16px;
}
@media (min-width: 740px){  .cards-grid{ grid-template-columns: repeat(3,1fr);} }
@media (min-width: 1024px){ .cards-grid{ grid-template-columns: repeat(4,1fr);} }

/* -------------------- Card compacta -------------------- */
/* NEGRO SIEMPRE: ponemos color base en la card y lo propagamos a todo adentro */
.cards-grid .card{
  background:#fff !important;
  color:#111 !important;              /* ← color base negro */
  box-shadow: 0 2px 14px rgba(0,0,0,.06);
  border: 1px solid #e5e7ef;
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  /* por si el tema usa variables dentro: fijamos --text local a negro */
  --text: #111;
}
.cards-grid .card:hover{ transform:translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.10); }

/* En oscuro, mantenemos card clara y texto negro (refuerzo) */
[data-theme="dark"] .cards-grid .card{
  background:#fff !important;
  color:#111 !important;
  box-shadow: 0 2px 14px rgba(0,0,0,.35);
}

/* TODO lo interno hereda negro y evita naranjas heredados */
.cards-grid .card *{
  color: inherit !important;
  -webkit-text-fill-color: currentColor; /* Safari */
}

/* Media */
.card-media{ aspect-ratio: 4/3; background:#f2f2f2; position:relative; }
.card-media img{ width:100%; height:100%; object-fit:cover; display:block; }
.card .badge{
  position:absolute; left:8px; top:8px;
  font-size:11px; padding:4px 8px; border-radius:999px;
  background:rgba(0,0,0,.65); color:#fff !important;
}

/* Texto */
.card-body{ padding:10px 12px 12px; }
.card-title h3{
  margin:0 0 6px;
  font-size:14px;
  font-weight:500;
  line-height:1.25;
}
.card-location{
  display:block;
  margin:0 0 6px;
  font-size:15px;
  font-weight:700;
}
.card-price{
  display:block;
  font-size:16px;
  font-weight:600;
  margin:0 0 8px;
}
.card-price .price-line{
  display:block;
  line-height:1.25;
}
.card-price .price-line + .price-line{
  margin-top:3px;
}
.card-price .price-label{
  font-weight:800;
}
.card-meta{
  display:flex; gap:10px; align-items:center;
  font-size:12px;
}
.card-meta span{ display:inline-flex; align-items:center; gap:6px; }

/* Si algún SVG usa fill/stroke fijo, lo forzamos a currentColor (= negro) */
.cards-grid .card svg { fill: currentColor; stroke: currentColor; }

/* Header un poco más alto por el nuevo ancho */
.site-header .header-inner{ padding-block: 14px; }

/* -------------------- Single (mini ajustes) -------------------- */
.thumbs{
  margin-top:10px;
  display:grid;
  gap:8px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width:600px){ .thumbs{ grid-template-columns: repeat(3, 1fr); } }
@media (min-width:981px){ .thumbs{ grid-template-columns: repeat(4, 1fr); } }

.side .card .cta{
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}
#ctaWhats{
  display: inline-flex; align-items: center; gap: 8px;
  padding: .9rem 1.2rem; border-radius: 12px;
}
#ctaWhats::before{
  content: ''; width: 18px; height: 18px; display: inline-block;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3a9 9 0 0 0-7.8 13.5L3 21l4.7-1.2A9 9 0 1 0 12 3Z' stroke='%2304131f' stroke-width='1.4'/%3E%3Cpath d='M8.5 9.2c0 3.2 3.3 5.8 5.5 5.8.5 0 1-.1 1.4-.3l1 .6c.3.2.7.1.9-.2l.6-1a2.3 2.3 0 0 0 .3-1.1c0-.2 0-.4-.2-.6l-1.2-1.1a.8.8 0 0 0-.6-.2c-.2 0-.5.2-.7.4l-.3.4c-.2.2-.5.2-.8.1-1-.4-2-1.1-2.7-2-.2-.3-.2-.6 0-.8l.3-.4c.2-.2.3-.4.3-.7 0-.2 0-.5-.2-.6L10 7.6a.8.8 0 0 0-.6-.2c-.4 0-.8.1-1 .4-.3.3-.6.8-.6 1.4Z' fill='%2304131f'/%3E%3C/svg%3E");
}

/* Mapas/mini-mapas placeholder fuera por ahora */
.map-placeholder, .mapPh, .card .map, .card .mini-map { display:none !important; }



/* ===== Unificar badge de Propiedades con el de la Home ===== */
#propGrid .card .badge{
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .8rem;
  color: #fff;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}

/* Tema claro: mismo matiz que en la Home */
:root[data-theme="light"] #propGrid .card .badge{
  background: rgba(0,0,0,.35);
}
/* 1 columna en móvil (ajusta el breakpoint a tu gusto) */
@media (max-width: 900px){
  .cards-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 18px;
  }
}

/* Título truncado a 2 líneas con “…” */
.card-title h3{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Paginador centrado, moderno y accesible */
.pager{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;              /* separación entre botones */
  margin-top: 18px;
  flex-wrap: wrap;
}

.pager-btn{
  appearance: none;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  color: inherit;
  padding: 10px 14px;     /* un poquito más grande */
  min-width: 42px;        /* touch-friendly */
  min-height: 42px;
  border-radius: 9999px;  /* pill */
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}

body.magma-theme:not(.light) .pager-btn{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}

.pager-btn:hover:not(:disabled){
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.pager-btn:active:not(:disabled){
  transform: translateY(0);
  box-shadow: none;
}

.pager-btn.is-active{
  /* usa tu variable de marca si existe; fallback a naranja */
  --_accent: var(--accent, #F59E0B);
  background: var(--_accent);
  border-color: var(--_accent);
  color: #fff;
}

.pager-btn[aria-current="page"]{
  outline: none;
}

.pager-btn:focus-visible{
  outline: 2px solid rgba(245,158,11,.5); /* foco accesible en naranja */
  outline-offset: 2px;
  border-radius: 9999px;
}

.pager-btn:disabled{
  opacity: .5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Ajuste fino en móviles */
@media (max-width: 480px){
  .pager{ gap: 8px; }
  .pager-btn{
    padding: 9px 12px;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.93rem;
  }
}
