/* ============================================
   EasyBroker Listings v1.5 — Estilos completos
   ============================================ */

/* ── VARIABLES ─────────────────────────────── */
:root {
    --eb-blue:       #1a6ef7;
    --eb-blue-dark:  #1455cc;
    --eb-blue-light: #e8f0fe;
    --eb-green:      #25d366;
    --eb-text:       #1a1a2e;
    --eb-muted:      #6c757d;
    --eb-border:     #e9ecef;
    --eb-bg:         #f8f9fa;
    --eb-white:      #ffffff;
    --eb-radius:     12px;
    --eb-shadow:     0 2px 12px rgba(0,0,0,.08);
    --eb-shadow-lg:  0 8px 32px rgba(0,0,0,.12);
}

/* ── SVG ICONS ─────────────────────────────── */
.eb-card__location svg,
.eb-card__features svg,
.eb-detail__location svg,
.eb-map__label svg,
.eb-back svg,
.eb-amenities svg,
.eb-contact-btn svg {
    width: 16px; height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    flex-shrink: 0;
}

/* ── GRID LISTADO ───────────────────────────── */
.eb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    padding: 8px 0 32px;
}

/* ── TARJETA ────────────────────────────────── */
.eb-card {
    border-radius: var(--eb-radius);
    overflow: hidden;
    background: var(--eb-white);
    box-shadow: var(--eb-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}
.eb-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--eb-shadow-lg);
}

.eb-card__img-wrap {
    position: relative;
    display: block;
    height: 210px;
    overflow: hidden;
    background: var(--eb-border);
    text-decoration: none;
}
.eb-card__img-tag {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.eb-card:hover .eb-card__img-tag { transform: scale(1.04); }
.eb-card__img-placeholder { width: 100%; height: 100%; background: var(--eb-border); }

/* Badges */
.eb-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 4px 10px;
    border-radius: 20px;
    line-height: 1.4;
}
.eb-badge--rental  { background: var(--eb-blue);  color: #fff; }
.eb-badge--sale    { background: #16a34a;          color: #fff; }
.eb-badge--type    { background: var(--eb-bg);     color: var(--eb-muted); border: 1px solid var(--eb-border); }

.eb-card__img-wrap .eb-badge {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 1;
}

.eb-card__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.eb-card__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.35;
    color: var(--eb-text);
}
.eb-card__title a { color: inherit; text-decoration: none; }
.eb-card__title a:hover { color: var(--eb-blue); }

.eb-card__location {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--eb-muted);
    margin: 0 0 10px;
    gap: 2px;
}
.eb-card__features {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: #495057;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.eb-card__features span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.eb-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 8px;
    flex-wrap: wrap;
}
.eb-card__price {
    font-size: 17px;
    font-weight: 800;
    color: var(--eb-blue);
}

/* ── BOTÓN ──────────────────────────────────── */
.eb-btn {
    display: inline-block;
    background: var(--eb-blue);
    color: #fff !important;
    text-decoration: none !important;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.eb-btn:hover { background: var(--eb-blue-dark); }
.eb-btn--full  { width: 100%; text-align: center; display: block; padding: 12px; font-size: 15px; }


/* ═══════════════════════════════════════════
   DETALLE DE PROPIEDAD
   ═══════════════════════════════════════════ */

.eb-detail { max-width: 1100px; margin: 0 auto; padding: 0 0 60px; }

/* Back link */
.eb-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--eb-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color .15s;
}
.eb-back:hover { color: var(--eb-blue); }
.eb-back svg   { width: 18px; height: 18px; }

/* ── GALERÍA ────────────────────────────────── */
.eb-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 320px;
    gap: 6px;
    border-radius: var(--eb-radius);
    overflow: hidden;
    margin-bottom: 32px;
}
.eb-gallery__main {
    grid-row: span 2;
    position: relative;
}
.eb-gallery__main a,
.eb-gallery__thumbs a {
    display: block;
    width: 100%; height: 100%;
    overflow: hidden;
    position: relative;
    background: var(--eb-border);
}
.eb-gallery__main img,
.eb-gallery__thumbs img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.eb-gallery__main a:hover img,
.eb-gallery__thumbs a:hover img { transform: scale(1.04); }

.eb-gallery__count {
    position: absolute;
    bottom: 14px; right: 14px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}
.eb-gallery__count svg { width: 15px; height: 15px; }

.eb-gallery__thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
}
.eb-gallery__more {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

/* ── LAYOUT 2 COLUMNAS ──────────────────────── */
.eb-detail__layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}

/* ── ENCABEZADO ─────────────────────────────── */
.eb-detail__header { margin-bottom: 24px; }
.eb-detail__header > div { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.eb-detail__title {
    font-size: 26px;
    font-weight: 800;
    color: var(--eb-text);
    margin: 0 0 10px;
    line-height: 1.25;
}
.eb-detail__location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    color: var(--eb-muted);
    margin: 0 0 14px;
}
.eb-detail__price {
    font-size: 30px;
    font-weight: 800;
    color: var(--eb-blue);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.eb-detail__price span {
    font-size: 13px;
    font-weight: 600;
    background: var(--eb-blue-light);
    color: var(--eb-blue);
    padding: 3px 10px;
    border-radius: 20px;
}

/* ── STATS ──────────────────────────────────── */
.eb-detail__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: var(--eb-bg);
    border-radius: var(--eb-radius);
    margin-bottom: 28px;
}
.eb-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
    padding: 0 8px;
    text-align: center;
}
.eb-stat strong {
    font-size: 24px;
    font-weight: 800;
    color: var(--eb-text);
    line-height: 1;
}
.eb-stat span {
    font-size: 11px;
    color: var(--eb-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 5px;
    line-height: 1.3;
}

/* ── SECCIONES ──────────────────────────────── */
.eb-detail__section { margin-bottom: 32px; }
.eb-detail__section h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--eb-text);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--eb-border);
}
.eb-detail__desc {
    font-size: 15px;
    line-height: 1.75;
    color: #444;
}

/* ── AMENIDADES ─────────────────────────────── */
.eb-amenities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0; margin: 0;
}
.eb-amenities li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
}
.eb-amenities svg { color: var(--eb-blue); flex-shrink: 0; }

/* ── TAGS ───────────────────────────────────── */
.eb-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.eb-tags span {
    background: var(--eb-bg);
    color: var(--eb-muted);
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--eb-border);
}

/* ── MAPA ───────────────────────────────────── */
.eb-map iframe {
    width: 100%;
    height: 380px;
    border: 0;
    border-radius: var(--eb-radius);
    display: block;
}
.eb-map__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--eb-muted);
    margin-top: 10px;
}

/* ── SIDEBAR ────────────────────────────────── */
.eb-detail__sidebar { position: sticky; top: 24px; }

.eb-sidebar-card {
    background: var(--eb-white);
    border-radius: var(--eb-radius);
    box-shadow: var(--eb-shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--eb-border);
}
.eb-sidebar-card__price {
    font-size: 26px;
    font-weight: 800;
    color: var(--eb-blue);
    margin: 0 0 4px;
}
.eb-sidebar-card__op {
    font-size: 13px;
    color: var(--eb-muted);
    margin: 0 0 20px;
}

/* ── AGENTE ─────────────────────────────────── */
.eb-agent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--eb-border);
    border-bottom: 1px solid var(--eb-border);
    margin-bottom: 16px;
}
.eb-agent__img {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.eb-agent__name  { font-size: 15px; font-weight: 700; color: var(--eb-text); margin: 0 0 2px; }
.eb-agent__role  { font-size: 12px; color: var(--eb-muted); margin: 0; }

/* ── BOTONES CONTACTO ───────────────────────── */
.eb-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    margin-bottom: 10px;
    transition: opacity .15s ease, filter .15s ease;
}
.eb-contact-btn:hover { opacity: .88; filter: brightness(1.05); }
.eb-contact-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.eb-contact-btn--whatsapp { background: #25d366; color: #fff !important; }
.eb-contact-btn--phone    { background: var(--eb-blue); color: #fff !important; }
.eb-contact-btn--email    { background: var(--eb-bg); color: var(--eb-text) !important; border: 1px solid var(--eb-border); }

/* ── FORMULARIO ─────────────────────────────── */
.eb-sidebar-card--form h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--eb-text);
}
.eb-sidebar-card--form > p {
    font-size: 13px;
    color: var(--eb-muted);
    margin: 0 0 16px;
}
.eb-form__group { margin-bottom: 12px; }
.eb-form__group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--eb-text);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.eb-form__group input,
.eb-form__group textarea,
.eb-form input,
.eb-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--eb-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--eb-text);
    background: var(--eb-white);
    box-sizing: border-box;
    transition: border-color .15s ease;
    font-family: inherit;
}
.eb-form__group input:focus,
.eb-form__group textarea:focus,
.eb-form input:focus,
.eb-form textarea:focus {
    outline: none;
    border-color: var(--eb-blue);
    box-shadow: 0 0 0 3px rgba(26,110,247,.1);
}
.eb-form textarea { resize: vertical; min-height: 80px; }

.eb-form-success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    color: #16a34a;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.eb-form-success svg { width: 20px; height: 20px; flex-shrink: 0; }
.eb-form-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ── ESTADOS ────────────────────────────────── */
.eb-error { color: #c0392b; background: #fdecea; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.eb-empty { color: var(--eb-muted); padding: 12px 0; font-size: 14px; }


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
    .eb-detail__layout {
        grid-template-columns: 1fr;
    }
    .eb-detail__sidebar {
        position: static;
        order: -1; /* sidebar arriba en móvil */
    }
    .eb-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: 260px auto;
        height: auto;
    }
    .eb-gallery__main   { grid-row: span 1; height: 260px; }
    .eb-gallery__thumbs { grid-template-columns: repeat(4, 1fr); height: 90px; }
}

@media (max-width: 600px) {
    .eb-gallery { grid-template-rows: 220px; }
    .eb-gallery__thumbs { display: none; }
    .eb-detail__title { font-size: 20px; }
    .eb-detail__price { font-size: 24px; }
    .eb-grid { grid-template-columns: 1fr; }
}
