/* ============================================================
   VIVIENDIS.COM — Estilos mínimos sobre Bootstrap 5
   Solo lo que Bootstrap no puede hacer solo
   ============================================================ */

body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: #f0f4ff; }

/* ── NAVBAR ── */
.navbar-viviendis {
    background: linear-gradient(135deg, #0f172a, #1e3a8a) !important;
    box-shadow: 0 2px 20px rgba(15,23,42,.5);
    border-bottom: 1px solid rgba(139,92,246,.2);
    min-height: 56px;
}
.navbar-viviendis .container-xl { min-height: 56px; }
/* navbar-dark de Bootstrap ya pone los textos en blanco.
   Solo necesitamos el tamaño y peso del logo. */
.logo-text   { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; }
.logo-accent { color: #fbbf24 !important; }
.logo-dot    { opacity: .5; font-size: 1.2rem; font-weight: 400; }

/* ── HERO ── */
.hero-viviendis {
    padding: 28px 0 80px;
    background:
        radial-gradient(ellipse at 20% 60%, rgba(139, 92, 246, .28) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 15%, rgba(37, 99, 235, .35) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 90%, rgba(16, 185, 129, .12) 0%, transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #312e81 100%) !important;
    position: relative;
    overflow: hidden;
}
/* Patrón de puntos muy sutil */
.hero-viviendis::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}
/* Línea brillante inferior */
.hero-viviendis::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,.6) 30%, rgba(37,99,235,.8) 60%, transparent);
}
.hero-title {
    font-size: clamp(1.25rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -.3px;
    text-shadow: 0 2px 10px rgba(0,0,0,.2);
    line-height: 1.25;
}
.hero-stat {
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px;
    padding: 7px 18px;
    text-align: center;
}
.hero-stat strong { display: block; font-size: 1.1rem; font-weight: 800; color: #fbbf24; }
.hero-stat span   { font-size: .68rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }

/* ── BUSCADOR FLOTANTE ── */
.search-floating {
    margin-top: -44px;
    position: relative;
    z-index: 10;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(30,64,175,.18);
    overflow: hidden;
}
.search-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    display: flex;
    gap: 4px;
    padding: 12px 24px 0;
}
.search-tab {
    color: rgba(255,255,255,.65);
    font-size: .82rem;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 10px 10px 0 0;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.search-tab:hover { color: #fff; background: rgba(255,255,255,.12); }
.search-tab.active  { background: #fff; color: #1d4ed8; }
.search-body { padding: 24px; }
.search-label {
    display: block;
    font-size: .7rem;
    font-weight: 800;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 6px;
}
.search-input {
    border: 1.5px solid #dbeafe !important;
    border-radius: 9px !important;
    background: #f8fbff !important;
    font-size: .9rem !important;
    padding: 10px 14px !important;
    color: #1e293b !important;
}
.search-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
    background: #fff !important;
}
.btn-buscar {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(37,99,235,.3);
    font-family: inherit;
}
.btn-buscar:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(37,99,235,.4); }
.btn-limpiar {
    color: #64748b;
    font-size: .83rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all .15s;
}
.btn-limpiar:hover { background: #e2e8f0; color: #334155; }

@media (max-width: 768px) {
    .hero-viviendis { padding: 20px 0 70px; }
    .search-floating { margin-top: -36px; }
}
@media (max-width: 576px) {
    .hero-viviendis { padding: 16px 0 64px; min-height: 36vh; }
    .search-floating { margin-top: -32px; border-radius: 14px; }
    .search-header { padding: 8px 12px 0; gap: 2px; }
    .search-tab { font-size: .74rem; padding: 7px 10px; }
    .search-body { padding: 14px; }
    .hero-stat { padding: 5px 12px; }
    .hero-stat strong { font-size: .95rem; }
}

/* ── TAGLINE EXCLUSIVIDAD ── */
.tagline-bar {
    background: linear-gradient(90deg, #eff6ff, #dbeafe 50%, #eff6ff);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 11px 18px;
    font-size: .85rem;
    color: #1e3a8a;
    font-weight: 500;
}

/* ── BARRA RESULTADOS ── */
.results-bar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    background: #fff; border-radius: 10px; padding: 12px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06); border: 1px solid #dbeafe;
}
.sort-select-custom {
    border: 1.5px solid #dbeafe; border-radius: 8px; padding: 6px 12px;
    font-size: .84rem; background: #f8fbff; cursor: pointer;
}
.sort-select-custom:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ── SLIDER DE CARDS ── */
.cslider {
    position: relative;
    height: 215px;
    aspect-ratio: 400 / 215;
    overflow: hidden;
    background: #e2e8f0;
    flex-shrink: 0;
    width: 100%;
    contain: layout style;
}
.cslider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .38s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}
.cslider-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.cslider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}
.prop-card:hover .cslider-slide img { transform: scale(1.04); }

/* Flechas */
.csl-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.9);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: .95rem;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    z-index: 4;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.cslider:hover .csl-btn { opacity: 1; }
.csl-btn:hover { transform: translateY(-50%) scale(1.12); }
.csl-prev { left: 8px; }
.csl-next { right: 8px; }

/* Puntos */
.csl-dots {
    position: absolute;
    bottom: 9px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 4;
}
.csl-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    transition: background .2s, transform .2s;
    display: block;
}
.csl-dots span.active {
    background: #fff;
    transform: scale(1.3);
}

/* ── CARDS ── */
.prop-card {
    border: 1px solid rgba(37,99,235,.1) !important;
    border-radius: 14px !important;
    overflow: hidden;
    transition: transform .25s, box-shadow .25s;
}
.prop-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 18px 40px rgba(37,99,235,.18) !important;
}

/* ── CARDS SIMILARES (ficha detalle) ── */
.similar-card {
    border: none !important;
    border-radius: 18px !important;
    box-shadow: 0 6px 24px rgba(15,23,42,.1);
    transition: transform .28s, box-shadow .28s;
}
.similar-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 44px rgba(37,99,235,.22) !important;
}
.similar-card .card-img-wrap {
    position: relative;
    height: 205px !important;
    overflow: hidden;
}
.similar-card .card-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(10,20,50,.62) 100%);
    pointer-events: none;
    z-index: 1;
}
.similar-card .badge-operacion,
.similar-card .price-tag { z-index: 2; }
.similar-card .card-body {
    padding: 16px 18px 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.similar-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .74rem;
    font-weight: 700;
    color: #2563eb;
    transition: gap .2s, color .2s;
    text-decoration: none;
}
.similar-card-cta:hover { gap: 10px; color: #1d4ed8; }
.badge-operacion {
    position: absolute; top: 11px; left: 11px;
    font-size: .68rem; font-weight: 700; padding: 5px 12px;
    border-radius: 20px; text-transform: uppercase; letter-spacing: .05em;
}
.price-tag {
    position: absolute; bottom: 11px; right: 11px;
    background: rgba(10,20,50,.78); color: #fff;
    font-size: .92rem; font-weight: 800; padding: 5px 13px;
    border-radius: 8px; backdrop-filter: blur(5px);
}
.spec-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe;
    border-radius: 20px; padding: 4px 10px; font-size: .74rem; font-weight: 600;
}

/* ── PAGINACIÓN ── */
.page-link { border-color: #dbeafe; color: #2563eb; font-weight: 600; transition: all .15s; }
.page-link:hover { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.page-item.active .page-link {
    background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
    border-color: transparent !important;
}

/* Miniatura similar en ficha (propiedad.php) */
.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── DETALLE: GALERÍA (aspect-ratio reserva hueco antes de la imagen → menos CLS) ── */
.gallery-main {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 420px;
    min-height: 200px;
    overflow: hidden;
    border-radius: 14px;
    background: #e2e8f0;
    contain: layout style;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.gallery-thumbs img {
    width: 82px; height: 62px; object-fit: cover; border-radius: 8px;
    cursor: pointer; opacity: .6; flex-shrink: 0;
    border: 2.5px solid transparent; transition: all .2s;
}
.gallery-thumbs img:hover, .gallery-thumbs img.active { opacity: 1; border-color: #2563eb; }

/* Flechas galería */
.gal-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.92); border: none; border-radius: 50%;
    width: 44px; height: 44px; font-size: 1.1rem; color: #1d4ed8;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,.2);
    transition: all .18s; z-index: 5;
}
.gal-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.1); box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gal-counter {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; font-weight: 700;
    padding: 4px 12px; border-radius: 20px; backdrop-filter: blur(4px); z-index: 5;
}

/* Fotos al 100% apiladas */
.fotos-stack { display: flex; flex-direction: column; gap: 16px; }
.foto-stack-item { border-radius: 16px; overflow: hidden; background: #e2e8f0; }
.foto-stack-item img { width: 100%; display: block; }

/* Lightbox */
#lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(5,10,25,.93); z-index: 9999;
    align-items: center; justify-content: center;
    cursor: zoom-out;
}
#lbImg {
    max-width: 92vw; max-height: 90vh;
    object-fit: contain; border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    cursor: default;
}
.lb-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.2);
    color: #fff; border-radius: 50%; width: 46px; height: 46px;
    font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .18s; z-index: 10;
}
.lb-close:hover { background: rgba(255,255,255,.28); transform: scale(1.1); }

/* ── DETALLE: CARDS SIDEBAR ── */
.detail-card {
    background: #fff; border-radius: 14px; padding: 20px;
    box-shadow: 0 2px 14px rgba(0,0,0,.07); border: 1px solid #e8f0fe;
}
.detail-card-title {
    font-size: .71rem; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px;
    display: flex; align-items: center; gap: 6px;
}
.detail-card-title i { color: #2563eb; }
.spec-item { background: #f0f5ff; border-radius: 10px; padding: 12px; text-align: center; border: 1px solid #dbeafe; }
.spec-item .spec-label { font-size: .68rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; display: block; }
.spec-item .spec-value { font-size: 1rem; font-weight: 800; color: #1e293b; display: block; margin-top: 3px; }
.spec-item .spec-icon  { font-size: 1.2rem; display: block; margin-bottom: 3px; color: #2563eb; }

/* ── SIDEBAR PRECIO ── */
.sidebar-price {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff; border-radius: 14px; padding: 22px; text-align: center;
}
.sidebar-price .price-big { font-size: 1.9rem; font-weight: 800; color: #fbbf24; }

/* ── BOTONES CONTACTO ── */
.btn-call {
    display: block; width: 100%; text-align: center; padding: 13px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6); color: #fff;
    border-radius: 10px; font-weight: 700; text-decoration: none; margin-bottom: 10px;
    transition: all .2s; box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.btn-call:hover { background: linear-gradient(135deg, #1e40af, #2563eb); transform: translateY(-2px); color: #fff; }
.btn-wa {
    display: block; width: 100%; text-align: center; padding: 13px;
    background: #25d366; color: #fff; border-radius: 10px; font-weight: 700;
    text-decoration: none; transition: all .2s; box-shadow: 0 4px 12px rgba(37,211,102,.25);
}
.btn-wa:hover { background: #1da851; transform: translateY(-2px); color: #fff; }

/* ── BADGE EXCLUSIVO (sidebar detalle) ── */
.exclusive-detail-badge {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fefce8; border: 1.5px solid #fde68a; border-radius: 12px; padding: 13px 15px;
}
.exclusive-detail-badge i { color: #d97706; flex-shrink: 0; margin-top: 2px; }
.exclusive-detail-badge strong { display: block; font-size: .8rem; font-weight: 700; color: #92400e; }
.exclusive-detail-badge span  { font-size: .74rem; color: #78350f; line-height: 1.4; }

/* ── CARACTERÍSTICAS ── */
.caract-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
    border-radius: 20px; padding: 5px 13px; font-size: .79rem; font-weight: 600;
}
.agency-logo {
    max-width: 120px;
    max-height: 70px;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    border: 1.5px solid #dbeafe;
}
.agency-verified { font-size: .75rem; color: #2563eb; font-weight: 600; }

/* ── FOOTER ── */
.footer-viviendis { background: linear-gradient(135deg, #0f172a, #1e3a8a); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.5); font-size: .87rem; text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: #fbbf24; }

/* ── BOOTSTRAP OVERRIDES (mínimos, sin romper nada) ── */
:root {
    --bs-primary:     #2563eb;
    --bs-primary-rgb: 37, 99, 235;
}
/* El botón buscar ya tiene btn btn-primary; solo añadimos el gradiente */
.btn-buscar {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
    border: none !important;
    font-weight: 700;
    padding: 11px 28px;
    font-size: .93rem;
    box-shadow: 0 4px 14px rgba(37,99,235,.3);
    transition: all .2s;
}
.btn-buscar:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37,99,235,.4) !important; }
.breadcrumb-item a { color: #2563eb; text-decoration: none; }

/* ── BOTONES COMPARTIR ── */
.share-btn {
    font-size: .8rem;
    font-weight: 600;
    border: none;
    display: inline-flex;
    align-items: center;
    transition: opacity .2s, transform .15s;
}
.share-btn:hover { opacity: .88; transform: translateY(-1px); }
.share-wa   { background: #075e54; color: #fff; } /* ratio ≈ 7.1:1 ✓ */
.share-wa:hover { background: #064d45; color: #fff; }
.share-fb   { background: #0a58ca; color: #fff; } /* ratio ≈ 5.1:1 ✓ */
.share-fb:hover { background: #0847a8; color: #fff; }
.share-x    { background: #000; color: #fff; }    /* ratio 21:1 ✓ */
.share-x:hover { background: #222; color: #fff; }
.share-tg   { background: #006ea6; color: #fff; } /* ratio ≈ 4.8:1 ✓ */
.share-tg:hover { background: #005d8e; color: #fff; }
.share-copy { background: #374151; color: #fff; border: 1px solid #374151; } /* ratio ≈ 10:1 ✓ */
.share-copy:hover { background: #1f2937; color: #fff; }

/* ── AGENCIA LINK EN CARDS ── */
.card-agency-link { cursor: pointer; color: #6c757d; }
.card-agency-link:hover { color: #1e3a8a !important; text-decoration: underline !important; }

/* ── SEO HUB — bloque de enlaces internos en index ── */
.seo-hub-links {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;          /* separación mínima entre pills */
}
.seo-hub-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;    /* touch target mínimo accesible (WCAG 2.5.8) */
    padding: .45rem 1rem;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.2;
    color: #1d4ed8;
    background: #f0f4ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}
.seo-hub-links a:hover,
.seo-hub-links a:focus-visible {
    background: #dbeafe;
    border-color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(29,78,216,.15);
    color: #1e40af;
    outline: none;
}
.seo-hub-links a:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}
.seo-hub-links a i {
    font-size: .85rem;
    flex-shrink: 0;
}
@media (max-width: 576px) {
    .seo-hub-links { gap: .5rem; }
    .seo-hub-links a { font-size: .8rem; padding: .4rem .8rem; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .hero-viviendis { padding: 50px 0 100px; }
    .search-floating { margin-top: -50px; padding: 18px; }
    .gallery-main { max-height: 260px; min-height: 170px; }
    .share-btn { font-size: .75rem; padding: .3rem .7rem; }
}
