/* =============================================
   EasyBroker Sync Pro — Frontend Styles
   ============================================= */

:root {
    --ebs-primary: #1a56db;
    --ebs-primary-dark: #1e429f;
    --ebs-green: #057a55;
    --ebs-green-light: #f0fdf4;
    --ebs-gray-50: #f9fafb;
    --ebs-gray-100: #f3f4f6;
    --ebs-gray-200: #e5e7eb;
    --ebs-gray-300: #d1d5db;
    --ebs-gray-500: #6b7280;
    --ebs-gray-700: #374151;
    --ebs-gray-900: #111827;
    --ebs-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --ebs-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --ebs-radius: 12px;
    --ebs-radius-sm: 8px;
}

/* ---- GRID DE PROPIEDADES ---- */
.ebs-properties-grid {
    display: grid;
    gap: 24px;
    margin: 20px 0;
}
.ebs-cols-1 { grid-template-columns: 1fr; }
.ebs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ebs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ebs-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .ebs-cols-3, .ebs-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ebs-cols-2, .ebs-cols-3, .ebs-cols-4 { grid-template-columns: 1fr; }
}

/* ---- TARJETA DE PROPIEDAD ---- */
.ebs-property-card {
    background: #fff;
    border-radius: var(--ebs-radius);
    overflow: hidden;
    box-shadow: var(--ebs-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ebs-property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ebs-shadow-lg);
}
.ebs-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.ebs-card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--ebs-gray-100);
}
.ebs-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.ebs-property-card:hover .ebs-card-image img {
    transform: scale(1.05);
}
.ebs-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--ebs-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ebs-badge-venta   { background: var(--ebs-primary); }
.ebs-badge-renta   { background: #7c3aed; }
.ebs-badge-vacacional { background: #d97706; }

.ebs-card-body { padding: 16px; }
.ebs-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ebs-gray-500);
    margin-bottom: 6px;
}
.ebs-card-location svg { flex-shrink: 0; width: 13px; height: 13px; }
.ebs-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ebs-gray-900);
    margin: 0 0 8px;
    line-height: 1.3;
}
.ebs-card-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--ebs-primary);
    margin-bottom: 10px;
}
.ebs-card-features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ebs-gray-500);
    margin-bottom: 12px;
}
.ebs-card-features span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ebs-card-features svg { width: 14px; height: 14px; }
.ebs-card-cta {
    font-size: 13px;
    font-weight: 600;
    color: var(--ebs-primary);
}

/* ---- PÁGINA INDIVIDUAL ---- */
.ebs-single-property {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Galería */
.ebs-gallery { margin-bottom: 30px; }
.ebs-gallery-main {
    position: relative;
    border-radius: var(--ebs-radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--ebs-gray-100);
    max-height: 550px;
}
.ebs-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ebs-gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--ebs-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}
.ebs-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.5);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.ebs-gallery-nav:hover { background: rgba(0,0,0,.75); }
.ebs-gallery-prev { left: 12px; }
.ebs-gallery-next { right: 12px; }
.ebs-gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 16px;
    background: rgba(0,0,0,.5);
    color: white;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 12px;
}
.ebs-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.ebs-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color .2s;
}
.ebs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ebs-thumb.active { border-color: var(--ebs-primary); }
.ebs-thumb:hover { border-color: var(--ebs-primary); opacity: .9; }

/* Cuerpo principal */
.ebs-property-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
}
@media (max-width: 900px) {
    .ebs-property-body { grid-template-columns: 1fr; }
    .ebs-property-sidebar { order: -1; }
}

.ebs-property-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--ebs-gray-500);
    margin-bottom: 8px;
}
.ebs-property-location svg { width: 15px; height: 15px; }
.ebs-property-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--ebs-gray-900);
    margin: 0 0 12px;
    line-height: 1.2;
}
.ebs-property-price {
    font-size: 32px;
    font-weight: 900;
    color: var(--ebs-primary);
    margin-bottom: 24px;
}

/* Características */
.ebs-property-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    background: var(--ebs-gray-50);
    border-radius: var(--ebs-radius);
    padding: 20px;
    margin-bottom: 30px;
}
.ebs-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}
.ebs-feature-icon {
    width: 40px;
    height: 40px;
    background: var(--ebs-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ebs-feature-icon svg { width: 20px; height: 20px; stroke: white; }
.ebs-feature-value { font-weight: 800; font-size: 18px; color: var(--ebs-gray-900); }
.ebs-feature-label { font-size: 12px; color: var(--ebs-gray-500); }

/* Descripción */
.ebs-property-description h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--ebs-gray-900);
}
.ebs-description-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ebs-gray-700);
}

/* Sidebar */
.ebs-property-sidebar { position: sticky; top: 20px; }
.ebs-btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25D366;
    color: white !important;
    text-decoration: none;
    padding: 16px 24px;
    border-radius: var(--ebs-radius);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    transition: background .2s, transform .1s;
    box-shadow: 0 4px 12px rgba(37, 211, 102, .4);
}
.ebs-btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
    color: white;
}
.ebs-sidebar-card {
    background: #fff;
    border: 1px solid var(--ebs-gray-200);
    border-radius: var(--ebs-radius);
    padding: 20px;
    margin-bottom: 16px;
}
.ebs-sidebar-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 12px; color: var(--ebs-gray-900); }
.ebs-details-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ebs-details-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--ebs-gray-100);
    font-size: 14px;
}
.ebs-details-list li:last-child { border-bottom: none; }
.ebs-details-list span { color: var(--ebs-gray-500); }
.ebs-details-list strong { color: var(--ebs-gray-900); }

/* ---- ARCHIVO DE PROPIEDADES ---- */
.ebs-archive-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.ebs-archive-header {
    text-align: center;
    margin-bottom: 30px;
}
.ebs-archive-header h1 { font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.ebs-archive-header p { font-size: 16px; color: var(--ebs-gray-500); }

/* Filtros */
.ebs-filters {
    background: var(--ebs-gray-50);
    border-radius: var(--ebs-radius);
    padding: 20px;
    margin-bottom: 20px;
}
.ebs-filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.ebs-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ebs-filter-group label { font-size: 13px; font-weight: 600; color: var(--ebs-gray-700); }
.ebs-filter-group select {
    border: 1px solid var(--ebs-gray-300);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 160px;
}
.ebs-btn-clear {
    display: inline-block;
    padding: 8px 14px;
    background: var(--ebs-gray-200);
    color: var(--ebs-gray-700);
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s;
}
.ebs-btn-clear:hover { background: var(--ebs-gray-300); }

.ebs-results-count {
    font-size: 14px;
    color: var(--ebs-gray-500);
    margin-bottom: 16px;
}
.ebs-results-count strong { color: var(--ebs-gray-900); }

/* Sin resultados */
.ebs-no-results {
    text-align: center;
    padding: 60px 20px;
}
.ebs-no-results-icon { font-size: 60px; margin-bottom: 16px; }
.ebs-no-results h2 { font-size: 24px; margin-bottom: 8px; }
.ebs-no-results p { color: var(--ebs-gray-500); }
.ebs-no-results a { color: var(--ebs-primary); font-weight: 600; }

/* Paginación */
.ebs-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
}
.ebs-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--ebs-gray-200);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ebs-gray-700);
    transition: all .2s;
}
.ebs-pagination .page-numbers:hover,
.ebs-pagination .page-numbers.current {
    background: var(--ebs-primary);
    border-color: var(--ebs-primary);
    color: white;
}
.ebs-pagination .page-numbers.prev,
.ebs-pagination .page-numbers.next {
    width: auto;
    padding: 0 16px;
}

/* ---- SECCIÓN CONTACTO ---- */
.ebs-contact-section {
    background: linear-gradient(135deg, var(--ebs-primary) 0%, #1e429f 100%);
    color: white;
    border-radius: var(--ebs-radius);
    padding: 48px 40px;
    margin-top: 48px;
    text-align: center;
}
.ebs-contact-icon { font-size: 48px; margin-bottom: 16px; }
.ebs-contact-title { font-size: 28px; font-weight: 800; margin: 0 0 12px; color: white; }
.ebs-contact-subtitle { font-size: 16px; opacity: .9; margin: 0 0 24px; max-width: 500px; margin-left: auto; margin-right: auto; }

.ebs-btn { 
    display: inline-block;
    padding: 14px 28px;
    border-radius: var(--ebs-radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
}
.ebs-btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,.6);
    color: white;
}
.ebs-btn-outline:hover {
    background: rgba(255,255,255,.15);
    border-color: white;
}
.ebs-btn-primary {
    background: #fff;
    color: var(--ebs-primary);
}
.ebs-btn-primary:hover {
    background: var(--ebs-gray-100);
    transform: translateY(-1px);
}

/* Formulario */
.ebs-contact-form-wrap {
    background: white;
    border-radius: var(--ebs-radius);
    padding: 30px;
    margin-top: 24px;
    text-align: left;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.ebs-form { display: flex; flex-direction: column; gap: 16px; }
.ebs-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .ebs-form-row { grid-template-columns: 1fr; } }

.ebs-form-group { display: flex; flex-direction: column; gap: 6px; }
.ebs-form-group label { font-size: 13px; font-weight: 600; color: var(--ebs-gray-700); }
.ebs-form-group input,
.ebs-form-group textarea,
.ebs-form-group select {
    border: 2px solid var(--ebs-gray-200);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--ebs-gray-900);
    transition: border-color .2s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}
.ebs-form-group input:focus,
.ebs-form-group textarea:focus {
    outline: none;
    border-color: var(--ebs-primary);
}
.ebs-form-group textarea { resize: vertical; }
.ebs-form-submit { text-align: center; }
.ebs-form-submit .ebs-btn-primary {
    background: var(--ebs-primary);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
}
.ebs-form-submit .ebs-btn-primary:hover { background: var(--ebs-primary-dark); }

.ebs-form-result {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}
.ebs-form-result.success {
    background: #f0fdf4;
    color: #057a55;
    border: 1px solid #a7f3d0;
    display: block;
}
.ebs-form-result.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    display: block;
}
