/* css/ev.css - Estilos para página de Cargadores Eléctricos */

/* ============================================================
   VARIABLES EV
   ============================================================ */
:root {
    --ev-primary: #22c55e;
    --ev-secondary: #3b82f6;
    --ev-accent: #06b6d4;

    /* Colores por nivel de potencia */
    --ev-normal: #22c55e;
    --ev-normal-light: #dcfce7;
    --ev-rapida: #f59e0b;
    --ev-rapida-light: #fef3c7;
    --ev-ultra: #ef4444;
    --ev-ultra-light: #fee2e2;

    /* Gradientes */
    --ev-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #134e4a 100%);
    --ev-gradient-light: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
}

/* ============================================================
   HERO EV
   ============================================================ */
.ev-hero {
    background: var(--ev-gradient);
    padding: 3rem 1.5rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.ev-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.ev-hero-content {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.ev-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.ev-hero h1 .highlight {
    color: var(--ev-primary);
}

.ev-hero .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* Breadcrumb EV */
.ev-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    /* Más espacio */
    margin-top: 1rem;
    /* Separación del header */
    color: #64748b;
}

.ev-breadcrumb a {
    color: #64748b;
    /* Gris medio */
    text-decoration: none;
    transition: color 0.2s;
}

.ev-breadcrumb a:hover {
    color: var(--ev-primary);
    /* Verde al hover */
    text-decoration: underline;
}

.ev-breadcrumb span {
    color: #1e293b;
    /* Gris oscuro para el último elemento */
    font-weight: 500;
}

.ev-breadcrumb i {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* ============================================================
   BUSCADOR EV
   ============================================================ */
.ev-search-box {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ev-search-box input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #1e293b;
}

.ev-search-box input::placeholder {
    color: #94a3b8;
}

.ev-search-box .btn-search {
    padding: 0.875rem 1.5rem;
    background: var(--ev-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.ev-search-box .btn-search:hover {
    background: #16a34a;
}

/* ============================================================
   FILTROS EV
   ============================================================ */
.ev-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.ev-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ev-filter-label {
    font-size: 0.875rem;
    opacity: 0.8;
    white-space: nowrap;
}

/* Chips EV - Diseño Visible */
.ev-chip {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    /* Gris claro visible */
    border: 1px solid #cbd5e1;
    /* Borde visible */
    border-radius: 20px;
    color: #475569;
    /* Texto oscuro */
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ev-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

.ev-chip.active {
    background: var(--ev-primary);
    border-color: var(--ev-primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.ev-chip.chip-normal.active {
    background: var(--ev-normal);
    border-color: var(--ev-normal);
}

.ev-chip.chip-rapida.active {
    background: var(--ev-rapida);
    border-color: var(--ev-rapida);
}

.ev-chip.chip-ultra.active {
    background: var(--ev-ultra);
    border-color: var(--ev-ultra);
}

/* Botón Cerca de mí */
.ev-btn-nearby {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ev-btn-nearby:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ev-btn-nearby i {
    color: var(--ev-primary);
}

/* Slider Radio */
.ev-range-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ev-range-group input[type="range"] {
    width: 100px;
    accent-color: var(--ev-primary);
}

.ev-range-label {
    font-size: 0.875rem;
    min-width: 50px;
}

/* ============================================================
   MAPA EV
   ============================================================ */
.ev-map-container {
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#ev-map {
    height: 500px;
    width: 100%;
}

/* Leyenda del mapa */
.ev-map-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.8rem;
}

.ev-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ev-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.ev-legend-dot.normal {
    background: var(--ev-normal);
}

.ev-legend-dot.rapida {
    background: var(--ev-rapida);
}

.ev-legend-dot.ultra {
    background: var(--ev-ultra);
}

/* Estado de carga */
.ev-map-status {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.ev-map-status i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================================
   RESULTADOS EV
   ============================================================ */
.ev-results-section {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.ev-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ev-results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ev-results-count {
    background: var(--ev-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.ev-results-list {
    display: grid;
    gap: 1rem;
}

/* ============================================================
   CARD CARGADOR
   ============================================================ */
.ev-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ev-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Indicador de nivel (barra lateral) */
.ev-card-level {
    width: 6px;
    border-radius: 3px;
    min-height: 80px;
}

.ev-card-level.normal {
    background: var(--ev-normal);
}

.ev-card-level.rapida {
    background: var(--ev-rapida);
}

.ev-card-level.ultra {
    background: var(--ev-ultra);
}

/* Info principal */
.ev-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ev-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ev-card-logo {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ev-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.ev-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.ev-card-operator {
    font-size: 0.875rem;
    color: #64748b;
}

/* Badges */
.ev-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.ev-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ev-badge-normal {
    background: var(--ev-normal-light);
    color: #166534;
}

.ev-badge-rapida {
    background: var(--ev-rapida-light);
    color: #92400e;
}

.ev-badge-ultra {
    background: var(--ev-ultra-light);
    color: #b91c1c;
}

.ev-badge-24h {
    background: #dbeafe;
    color: #1e40af;
}

.ev-badge-public {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.ev-badge-membership {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Detalles */
.ev-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #475569;
    margin-top: 0.5rem;
}

.ev-card-detail {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ev-card-detail i {
    color: #94a3b8;
    width: 16px;
}

.ev-card-address {
    font-size: 0.875rem;
    color: #64748b;
}

/* Stats (potencia) */
.ev-card-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    min-width: 120px;
}

.ev-card-power {
    text-align: right;
}

.ev-card-power-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.ev-card-power-unit {
    font-size: 0.875rem;
    color: #64748b;
}

.ev-card-distance {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Botón Cómo llegar */
.ev-btn-directions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--ev-secondary);
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.ev-btn-directions:hover {
    background: #2563eb;
}

/* ============================================================
   CARGADORES RÁPIDOS CERCA
   ============================================================ */
.ev-nearby-section {
    padding: 2rem 1.5rem;
    background: var(--ev-gradient-light);
}

.ev-nearby-section .container {
    max-width: 1400px;
    margin: 0 auto;
}

.ev-nearby-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ev-nearby-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ev-nearby-subtitle {
    color: #64748b;
    margin-top: 0.25rem;
}

.ev-nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.ev-nearby-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.ev-nearby-placeholder i {
    font-size: 2.5rem;
    color: var(--ev-primary);
    margin-bottom: 0.5rem;
}

/* ============================================================
   CONTENIDO SEO
   ============================================================ */
.ev-content-section {
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ev-content-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.ev-content-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.ev-content-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ev-content-card h3 i {
    color: var(--ev-primary);
}

.ev-content-card p,
.ev-content-card ul {
    color: #475569;
    line-height: 1.7;
}

.ev-content-card ul {
    padding-left: 1.25rem;
}

.ev-content-card li {
    margin-bottom: 0.5rem;
}

/* ============================================================
   FAQ
   ============================================================ */
.ev-faq-section {
    padding: 3rem 1.5rem;
    background: #f8fafc;
}

.ev-faq-section .container {
    max-width: 900px;
    margin: 0 auto;
}

.ev-faq-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.ev-faq-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.ev-faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.ev-faq-question:hover {
    background: #f8fafc;
}

.ev-faq-question i {
    color: #94a3b8;
    transition: transform 0.2s;
}

.ev-faq-item.open .ev-faq-question i {
    transform: rotate(180deg);
}

.ev-faq-answer {
    padding: 0 1.25rem 1rem;
    color: #475569;
    line-height: 1.7;
    display: none;
}

.ev-faq-item.open .ev-faq-answer {
    display: block;
}

/* ============================================================
   OPERADORES
   ============================================================ */
.ev-operators-section {
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ev-operators-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.ev-operators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.ev-operator-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
}

.ev-operator-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ev-operator-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.ev-operator-name {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* ============================================================
   PROVINCIAS EV
   ============================================================ */
.ev-provinces-section {
    padding: 2rem 1.5rem;
    background: #f8fafc;
}

.ev-provinces-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.ev-provinces-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.ev-provinces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.ev-provinces-grid a {
    padding: 0.625rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    text-align: center;
}

.ev-provinces-grid a:hover {
    background: var(--ev-primary);
    color: white;
    border-color: var(--ev-primary);
}

/* ============================================================
   ATRIBUCIÓN OPENCHARGE MAP
   ============================================================ */
.ev-attribution {
    text-align: center;
    padding: 1rem;
    background: #f1f5f9;
    font-size: 0.8rem;
    color: #64748b;
}

.ev-attribution a {
    color: var(--ev-primary);
    text-decoration: none;
}

.ev-attribution a:hover {
    text-decoration: underline;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .ev-hero {
        padding: 2rem 1rem 1.5rem;
    }

    .ev-search-box {
        flex-direction: column;
    }

    .ev-search-box .btn-search {
        width: 100%;
    }

    .ev-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .ev-filter-group {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    #ev-map {
        height: 350px;
    }

    .ev-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .ev-card-level {
        display: none;
    }

    .ev-card-stats {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-top: 0.75rem;
        border-top: 1px solid #e2e8f0;
    }

    .ev-card-power {
        text-align: left;
    }

    .ev-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Dark mode compatibility */
.theme-dark .ev-results-section,
.theme-dark .ev-content-section,
.theme-dark .ev-operators-section {
    background: #1e293b;
}

.theme-dark .ev-card,
.theme-dark .ev-content-card,
.theme-dark .ev-faq-item,
.theme-dark .ev-operator-card {
    background: #334155;
    border-color: #475569;
}

.theme-dark .ev-card-title,
.theme-dark .ev-content-card h3,
.theme-dark .ev-faq-question,
.theme-dark .ev-results-header h2 {
    color: #f1f5f9;
}

.theme-dark .ev-card-operator,
.theme-dark .ev-card-address,
.theme-dark .ev-card-details,
.theme-dark .ev-content-card p,
.theme-dark .ev-faq-answer {
    color: #94a3b8;
}

/* ============================================================
   ESTILOS POPUP LEAFLET
   ============================================================ */
.ev-popup {
    font-family: 'Inter', sans-serif;
}

.ev-popup-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.ev-popup-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.ev-popup-operator {
    font-size: 0.8rem;
    color: #64748b;
}

.ev-popup-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: #475569;
}

.ev-popup-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ev-popup-row i {
    width: 16px;
    color: #94a3b8;
    text-align: center;
}

/* Acciones Popup */
.ev-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ev-popup-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.ev-popup-btn-primary {
    background: var(--ev-primary);
    color: white !important;
    /* FORZAR BLANCO */
}

.ev-popup-btn-primary:hover {
    background: #16a34a;
    color: white !important;
}

.ev-popup-btn-secondary {
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
}

.ev-popup-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b !important;
}