/* ============================================
   PÁGINA DE AGENTES - RE/MAX Metropolitana
   Estilos basados en la guía oficial
   ============================================ */

/* Variables de la guía de estilos RE/MAX */
:root {
    --remax-blue: #003DA5;
    --remax-blue-dark: #002764;
    --remax-red: #E11B22;
    --remax-red-dark: #DC1C2E;
    --success-green: #00AB4A;
    --success-green-dark: #008c3d;
    --text-dark: #0f172a;
    --text-medium: #1a1a1a;
    --text-gray: #475569;
    --text-gray-light: #64748b;
    --text-light: #999999;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-gray: #F5F5F5;
    --border-color: #e5e7eb;
    --border-radius-md: 10px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 32px rgba(0, 61, 165, 0.15);
}

/* ============================================
   CONTAINER
   ============================================ */
.agentes-page {
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
    min-height: 80vh;
}

.agentes-page .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.agentes-hero {
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
    padding: 60px 0 50px;
    position: relative;
    overflow: hidden;
}

.agentes-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect fill="rgba(255,255,255,0.03)" width="100" height="100"/></svg>');
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.agentes-title {
    font-family: 'Poppins', sans-serif;
    font-size: 52px;
    font-weight: 800;
    color: white;
    margin: 0 0 16px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agentes-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 40px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-number {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.stat-label {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.agentes-search-section {
    padding: 40px 0;
    background: white;
    box-shadow: var(--shadow-sm);
}

.search-form {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

.search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-gray-light);
    pointer-events: none;
}

.search-form input[type='search'] {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: var(--text-dark);
    background: white;
    transition: all 0.3s ease;
}

.search-form input[type='search']:focus {
    outline: none;
    border-color: var(--remax-blue);
    box-shadow: 0 0 0 4px rgba(0, 61, 165, 0.1);
}

.search-form input[type='search']::placeholder {
    color: var(--text-gray-light);
}

.clear-search {
    position: absolute;
    right: 15px;
    color: var(--text-gray-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.search-btn {
    padding: 16px 32px;
    background: var(--remax-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--remax-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 61, 165, 0.3);
}

.search-results-info {
    text-align: center;
    margin-top: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    color: var(--text-gray);
}

/* ============================================
   AGENTS GRID
   ============================================ */
.agentes-grid-section {
    padding: 60px 0;
}

#agents-results-container {
    transition: opacity 0.2s ease;
}

#agents-results-container.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.agentes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

/* ============================================
   AGENT CARD
   ============================================ */
.agent-card {
    background: white;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

/* Hover neutralizado para evitar animaciones al abrir el perfil */
.agent-card:hover {
    /* sin transform ni sombras adicionales */
}

.agent-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ============================================
   IMAGE WRAPPER
   ============================================ */
.agent-image-wrapper {
    position: relative;
    height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
}

.agent-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.agent-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Sin escala en hover para la foto */
.agent-card:hover .agent-photo {}

.agent-no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
}

.agent-no-photo span {
    font-family: 'Poppins', sans-serif;
    font-size: 96px;
    font-weight: 700;
    color: white;
    opacity: 0.9;
}

/* ============================================
   OVERLAY
   ============================================ */
/* Overlay eliminado a solicitud: se navega con click en foto o nombre */

/* ============================================
   AGENT INFO
   ============================================ */
.agent-info {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.agent-name {
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.agent-name a {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.agent-name a:hover {
    color: var(--remax-blue);
}

.agent-role {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--remax-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Rating del agente */
.agent-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 8px 0;
    border-top: 1px solid #F0F0F0;
    border-bottom: 1px solid #F0F0F0;
}

.agent-rating .mt-review-stars {
    font-size: 16px;
    gap: 2px;
}

.agent-rating .rating-text {
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 500;
}

.agent-contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: var(--border-radius-md);
}

.contact-item:hover {
    background: var(--bg-gray);
    color: var(--remax-blue);
}

.contact-item svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.contact-item.phone {
    font-weight: 600;
    color: var(--text-dark);
}

.contact-item.email span {
    word-break: break-all;
    font-size: 13px;
}

/* Contenedor de acciones (botones) */
.agent-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.btn-whatsapp,
.btn-review {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    color: white;
    border-radius: var(--border-radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-whatsapp {
    background: var(--success-green);
}

.btn-whatsapp:hover {
    background: var(--success-green-dark);
    transform: scale(1.02);
}

.btn-review {
    background: var(--remax-blue);
    border: 2px solid var(--remax-blue);
}

.btn-review:hover {
    background: var(--remax-blue-dark);
    border-color: var(--remax-blue-dark);
    transform: scale(1.02);
}

.btn-whatsapp svg,
.btn-review svg {
    flex-shrink: 0;
}

/* ============================================
   PAGINATION
   ============================================ */
.agentes-pagination {
    margin: 60px 0;
}

.agentes-pagination ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.pagination-item {
    display: flex;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: var(--remax-blue);
    border-color: var(--remax-blue);
    color: white;
    transform: translateY(-2px);
}

.pagination-btn svg {
    width: 8px;
    height: 14px;
}

.pagination-numbers {
    list-style: none;
}

.pagination-numbers-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-num {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-gray);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
}

.page-num:hover {
    background: var(--bg-light);
    color: var(--remax-blue);
}

.page-num.active {
    background: var(--remax-blue);
    color: white;
    pointer-events: none;
}

.page-dots {
    color: var(--text-light);
    padding: 0 8px;
    display: inline-block;
}

/* ============================================
   NO RESULTS
   ============================================ */
.no-agents {
    text-align: center;
    padding: 100px 20px;
}

.no-results-icon {
    color: var(--text-light);
    margin-bottom: 24px;
}

.no-agents h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 12px 0;
}

.no-agents p {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: var(--text-gray);
    margin: 0 0 32px 0;
}

.btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--remax-blue);
    color: white;
    border-radius: var(--border-radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--remax-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 61, 165, 0.3);
}

/* ============================================
   SEO CONTENT SECTION
   ============================================ */
.agentes-seo-content {
    background: white;
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.seo-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.seo-block h2,
.seo-block h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.seo-block h3 {
    font-size: 20px;
}

.seo-block p {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-gray);
    margin: 0 0 16px 0;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-gray);
}

.benefits-list svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.seo-block.highlight {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-gray) 100%);
    padding: 40px;
    border-radius: var(--border-radius-xl);
    text-align: center;
    border: 2px solid var(--border-color);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn-secondary,
.cta-buttons .btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: white;
    color: var(--remax-blue);
    border: 2px solid var(--remax-blue);
}

.btn-secondary:hover {
    background: var(--remax-blue);
    color: white;
}

.cta-buttons .btn-whatsapp {
    background: var(--success-green);
    color: white;
    border: 2px solid var(--success-green);
}

.cta-buttons .btn-whatsapp:hover {
    background: var(--success-green-dark);
    border-color: var(--success-green-dark);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 1024px) {
    .agentes-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 28px;
    }
    
    .agentes-title {
        font-size: 42px;
    }
    
    .stats-bar {
        gap: 40px;
    }
}

@media screen and (max-width: 768px) {
    .agentes-title {
        font-size: 36px;
    }
    
    .agentes-subtitle {
        font-size: 16px;
    }
    
    .stats-bar {
        gap: 30px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .search-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .agentes-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 24px;
    }
    
    .agent-image-wrapper {
        height: 280px;
    }
    
    .seo-content-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .agentes-seo-content {
        padding: 60px 0;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-secondary,
    .cta-buttons .btn-whatsapp {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 600px) {
    .agentes-hero {
        padding: 40px 0 35px;
    }
    
    .agentes-title {
        font-size: 32px;
    }
    
    .agentes-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto 50px;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 20px;
    }
    
    .agentes-search-section {
        padding: 30px 0;
    }
    
    .agentes-grid-section {
        padding: 40px 0;
    }
    
    .pagination-btn span {
        display: none;
    }
    
    .pagination-btn {
        padding: 12px 16px;
    }
}
