/**
 * Estilos para el Mapa Interactivo de Oficinas España
 */

/* Contenedor principal */
.mapa-oficinas-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Responsive: Móviles - menos padding para más espacio */
@media (max-width: 768px) {
    .mapa-oficinas-container {
        padding: 20px 10px;
    }
}

/* Responsive: Móviles pequeños */
@media (max-width: 480px) {
    .mapa-oficinas-container {
        padding: 15px 8px;
    }
}

/* Layout principal */
.mapa-oficinas-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

/* Responsive: Tablets */
@media (max-width: 1024px) {
    .mapa-oficinas-wrapper {
        grid-template-columns: 1.5fr 1fr;
        gap: 20px;
        margin: 20px 0;
    }
}

/* Responsive: Móviles */
@media (max-width: 768px) {
    .mapa-oficinas-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 15px 0;
    }
    
    .mapa-oficinas-intro {
        padding: 15px;
    }
    
    .mapa-oficinas-intro h2 {
        font-size: 1.5rem;
    }
    
    .mapa-oficinas-intro p {
        font-size: 0.95rem;
    }
}

/* Título principal */
.mapa-titulo {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-align: center;
}

/* Responsive: Móviles - títulos más compactos */
@media (max-width: 768px) {
    .mapa-titulo {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .mapa-titulo {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
}

.mapa-titulo-linea {
    width: 120px;
    height: 4px;
    background-color: #8B1A1A;
    margin: 0 auto 30px;
}

.mapa-subtitulo {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    line-height: 1.6;
}

/* Responsive: Móviles - subtítulo más compacto */
@media (max-width: 768px) {
    .mapa-subtitulo {
        font-size: 0.95rem;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    
    .mapa-titulo-linea {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .mapa-subtitulo {
        font-size: 0.9rem;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    .mapa-titulo-linea {
        margin-bottom: 12px;
    }
}

/* Contenedor del mapa SVG */
.mapa-svg-container {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
}

.mapa-svg-container svg {
    width: 100%;
    height: auto;
    max-height: 800px;
    min-height: 500px;
    display: block;
    margin: 0 auto;
}

/* Responsive: Tablets */
@media (max-width: 1024px) {
    .mapa-svg-container {
        padding: 20px;
    }
    
    .mapa-svg-container svg {
        max-height: 600px;
        min-height: 400px;
    }
}

/* Responsive: Móviles */
@media (max-width: 768px) {
    .mapa-svg-container {
        padding: 10px;
        border-radius: 8px;
    }
    
    .mapa-svg-container svg {
        max-height: none;
        min-height: 450px;
        height: auto;
    }
    
    /* Ajustar Canarias en móviles - mismo que desktop ahora */
    #ES-CN {
        transform: translate(0, -200px) scale(1.0) !important;
    }
}

/* Responsive: Móviles pequeños */
@media (max-width: 480px) {
    .mapa-svg-container {
        padding: 8px;
    }
    
    .mapa-svg-container svg {
        max-height: none;
        min-height: 380px;
        height: auto;
    }
}

/* Estilos para las regiones del mapa SVG */
.mapa-svg-container path.region {
    fill: #e8e8e8;
    stroke: #ffffff;
    stroke-width: 1.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Regiones CON oficinas - color más oscuro */
.mapa-svg-container path.region[data-has-office="true"] {
    fill: #c4a57b;
    stroke: #ffffff;
    stroke-width: 2;
}

/* Responsive: Móviles - stroke más visible */
@media (max-width: 768px) {
    .mapa-svg-container path.region {
        stroke-width: 2;
    }
    
    .mapa-svg-container path.region[data-has-office="true"] {
        stroke-width: 2.5;
    }
    
    .mapa-svg-container path.region:hover {
        stroke-width: 3;
    }
}

.mapa-svg-container path.region:hover {
    fill: #8B1A1A;
    opacity: 0.9;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.mapa-svg-container path.region.active {
    fill: #8B1A1A;
    opacity: 1;
}

/* Panel de información */
#mapa-info-panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 20px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

/* Responsive: Tablets */
@media (max-width: 1024px) {
    #mapa-info-panel {
        padding: 20px;
    }
}

/* Responsive: Móviles */
@media (max-width: 768px) {
    #mapa-info-panel {
        position: relative;
        top: 0;
        padding: 20px;
        border-radius: 8px;
        margin-top: 20px;
    }
    
    #mapa-info-panel h2 {
        font-size: 1.5rem;
    }
    
    #mapa-info-panel h3 {
        font-size: 1.2rem;
    }
}

/* Responsive: Móviles pequeños */
@media (max-width: 480px) {
    #mapa-info-panel {
        padding: 15px;
    }
    
    #mapa-info-panel h2 {
        font-size: 1.3rem;
    }
    
    #mapa-info-panel h3 {
        font-size: 1.1rem;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contenido del panel */
.oficina-info-content {
    position: relative;
}

.oficina-titulo {
    font-size: 1.8rem;
    color: #8B1A1A;
    margin: 0 0 20px 0;
    font-weight: bold;
    line-height: 1.3;
}

.oficina-detalles {
    margin-bottom: 25px;
}

.oficina-detalles p {
    margin: 12px 0;
    font-size: 1rem;
    line-height: 1.6;
}

.oficina-alcance {
    color: #444;
}

.oficina-telefono {
    color: #1a1a1a;
    font-size: 1.2rem;
}

.oficina-telefono a {
    color: #8B1A1A;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.oficina-telefono a:hover {
    color: #b52222;
    text-decoration: underline;
}

/* Oficinas provinciales */
.oficinas-provinciales {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e0e0e0;
}

.oficinas-provinciales h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.oficinas-provinciales ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.provincia-item {
    padding: 15px;
    margin-bottom: 12px;
    background: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid #8B1A1A;
    transition: transform 0.2s ease;
}

.provincia-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive: Móviles */
@media (max-width: 768px) {
    .provincia-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .provincia-item:hover {
        transform: none;
    }
}

/* Responsive: Móviles pequeños */
@media (max-width: 480px) {
    .provincia-item {
        padding: 10px;
    }
}

.provincia-item strong {
    display: block;
    color: #1a1a1a;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.provincia-ciudad {
    color: #666;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 8px;
}

.provincia-telefono {
    color: #8B1A1A;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.05rem;
}

.provincia-telefono:hover {
    text-decoration: underline;
}

/* Botón de contacto */
.btn-contacto {
    width: 100%;
    padding: 15px 30px;
    margin-top: 25px;
    background-color: #8B1A1A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-contacto:hover {
    background-color: #a82020;
    transform: scale(1.02);
}

.btn-contacto:active {
    transform: scale(0.98);
}

/* Responsive: Móviles */
@media (max-width: 768px) {
    .btn-contacto {
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .btn-contacto:hover {
        transform: none;
    }
}

/* Responsive: Móviles pequeños */
@media (max-width: 480px) {
    .btn-contacto {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* Mensaje inicial */
.mensaje-inicial {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* Responsive: Móviles */
@media (max-width: 768px) {
    .mensaje-inicial {
        padding: 40px 15px;
    }
    
    .mensaje-inicial .icono {
        font-size: 2.5rem;
    }
    
    .mensaje-inicial p {
        font-size: 0.95rem;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mapa-oficinas-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    #mapa-info-panel {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .mapa-oficinas-container {
        padding: 20px 15px;
    }
    
    .mapa-titulo {
        font-size: 2rem;
    }
    
    .mapa-subtitulo {
        font-size: 1rem;
    }
    
    .mapa-svg-container {
        padding: 20px;
    }
    
    #mapa-info-panel {
        padding: 20px;
    }
    
    .oficina-titulo {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .mapa-titulo {
        font-size: 1.6rem;
    }
    
    .oficina-titulo {
        font-size: 1.3rem;
    }
    
    .mapa-svg-container svg {
        max-height: 400px;
    }
}

/* Animación para regiones activas */
.region.active {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Tooltip simple */
.region-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}
